The discrepancy of a binary string is the maximum (absolute) difference between the number of ones and the number of zeroes over all possible substrings of the given binary string. In this note we determine the minimal discrepancy that a binary de Bruijn sequence of order $n$ can achieve, which is $n$. This was an open problem until now. We give an algorithm that constructs a binary de Bruijn sequence with minimal discrepancy. A slight modification of this algorithm deals with arbitrary alphabets and yields de Bruijn sequences of order $n$ with discrepancy at most $1$ above the trivial lower bound $n$.
翻译:二进制字符串的差异定义为给定二进制字符串所有可能子串中"1"的数量与"0"的数量之差的绝对值的最大值。本文确定了n阶二进制德布鲁因序列能够达到的最小差异值为n,该问题此前一直悬而未决。我们提出一种能够构造具有最小差异的二进制德布鲁因序列的算法。对该算法稍作修改即可推广至任意字母表,并构造出差异值最多比平凡下界n大1的n阶德布鲁因序列。