Table of Contents
Fetching ...

De Bruijn Sequences with Minimum Discrepancy

Nicolás Álvarez, Verónica Becher, Martín Mereb, Ivo Pajor, Carlos Miguel Soto

TL;DR

This work determines the exact minimal discrepancy attainable by binary de Bruijn sequences of order $n$, proving it equals $n$, and presents an efficient $O(n)$-space algorithm to construct such sequences. Extending to alphabets with $k>2$ yields sequences with discrepancy at most $n+1$, with a conjecture that $n$ is still achievable in many cases. The core method translates the problem to the de Bruijn graph $B_n$, partitions $B_n$ into $ICR$-cycles, and builds a Hamiltonian cycle inside a carefully designed valid subgraph via a depth-structured spanning tree and a transition rule $R$. A detailed analysis establishes difference bounds using histogram and partial-sum techniques, and the paper includes a complete C++ implementation. This advances both the theoretical understanding of discrepancy in de Bruijn sequences and the practical construction of low-discrepancy sequences for binary alphabets.

Abstract

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$.

De Bruijn Sequences with Minimum Discrepancy

TL;DR

This work determines the exact minimal discrepancy attainable by binary de Bruijn sequences of order , proving it equals , and presents an efficient -space algorithm to construct such sequences. Extending to alphabets with yields sequences with discrepancy at most , with a conjecture that is still achievable in many cases. The core method translates the problem to the de Bruijn graph , partitions into -cycles, and builds a Hamiltonian cycle inside a carefully designed valid subgraph via a depth-structured spanning tree and a transition rule . A detailed analysis establishes difference bounds using histogram and partial-sum techniques, and the paper includes a complete C++ implementation. This advances both the theoretical understanding of discrepancy in de Bruijn sequences and the practical construction of low-discrepancy sequences for binary alphabets.

Abstract

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 can achieve, which is . 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 with discrepancy at most above the trivial lower bound .
Paper Structure (20 sections, 17 theorems, 38 equations, 3 figures, 3 tables, 2 algorithms)

This paper contains 20 sections, 17 theorems, 38 equations, 3 figures, 3 tables, 2 algorithms.

Key Result

Theorem 1

There is an algorithm that produces a de Bruijn sequence of order $n$ with discrepancy $n$ in case the alphabet has two symbols, and with discrepancy at most $n+1$ in case the alphabet has more than two symbols. The algorithm computes in $O(n)$ memory and it outputs each symbol in $O(n)$ time.

Figures (3)

  • Figure 1: An example of a valid subgraph for $|\Sigma| = 3$ and $n = 3$ where the $ICR$ cycle of $000$ is assigned depth $1$ and the other two $ICR$ cycles are assigned depth $2$.
  • Figure 2: Explicit Tree for the case $n=3, |\Sigma| = 3$.
  • Figure 3: Graphical representation for the binary sequences of order $n=14$ produced by our algorithm (left), a de Bruijn sequence chosen uniformly at random (center) and the de Bruijn sequence with asymptotically maximum discrepancy in Sawada (right). The symbols of the sequence are displayed in row-major order. Zero is white, one is black.

Theorems & Definitions (43)

  • Theorem 1
  • Definition : Difference
  • Definition : Histogram
  • Definition : Difference of a histogram
  • Definition : Partial sum of a histogram
  • Definition : Incremented Cycle Register Rule
  • Lemma 1
  • proof
  • Lemma 2
  • proof
  • ...and 33 more