Generating key points…
Answers are grounded in this paper and cite their sources.
A binary de Bruijn cycle of order \(n≥ 1\) has \(2^n\) bits and contains each binary \(n\)-bit word exactly once as a cyclic window. For the original greedy Prefer-same cycle \(S_n\), the original greedy Prefer-opposite cycle \(O_n\), and the Fredricksen–Kessler Lex-comp cycle \(L_n\), the largest imbalance between ones and zeros in a cyclic interval grows quadratically with \(n\). The three exact words also admit constant worst-case delay between successive output bits after initialisation, and polynomial-time conversion in both directions between a window and its position. The common structure is a tree of short register orbits. How those orbits are cut and joined determines the output order, which imbalances cancel, and how many positions a query can skip at once. Give each 1 weight \(+1\) and each 0 weight \(-1\). For any of the three words, let \(H(j)\) be the weight of its first \(j\) bits, for \(0≤ j≤ 2^n\). The cycle is balanced, so its cyclic discrepancy is \(max_j H(j)-min_j H(j)\). Gabrić and Sawada asked whether this quantity is \(Θ(n^2)\) separately for Prefer-same and Lex-comp, and posed the same question for Prefer-opposite. Both bounds hold for each cycle. In particular, the Prefer-opposite lower bound holds without the suffix assumption used in the original discussion. The proposed exact finite-order value for Prefer-opposite is a separate question. Gabrić–Sawada, §3, Conjecture 3.1, Prefer-same and Lex-comp, Gabrić–Sawada, §3, Conjecture 3.2 and following lower-bound discussion, Prefer-opposite. For \(n≥ 3\), put \(m=n-1\). The pure run-length register acts on an \(n\)-bit window by \[F(b_1⋯ b_n)=b_2⋯ b_n(b_1⊕ b_2⊕ b_n), \] where \(⊕\) is addition modulo two. The \(m\) adjacent-bit XORs rotate under \(F\). When they are nonzero, the positive circular gaps between the 1s form a composition of \(m\), an ordered list of positive integers summing to \(m\). Use its lexicographically greatest rotation for Prefer-same and Lex-comp, and its least rotation for Prefer-opposite. If the shortest repeating part block has \(p\) parts summing to \(d\), the transition vector returns after \(d\) shifts. These shifts flip the starting bit exactly when \(p\) is odd. Thus odd \(p\) gives one orbit of \(2d\) windows, and even \(p\) gives two orbits of \(d\) windows, labelled by their boundary starting bit. The preferred bit is 1 for Prefer-same and Lex-comp, and 0 for Prefer-opposite. The corresponding boundary windows have run lengths \((A,1)\) and \((1,A)\), respectively, for canonical composition \(A\). The constant windows \(0^n\) and \(1^n\) are singleton orbits. The discrepancy bounds quantify what survives when complementary orbit weights cancel. In Prefer-opposite, completed complementary sibling subtrees cancel apart from the separate contribution of the constant leaf \(1^n\). At an ordinary split of a parent's last part \(x+y\) into \(x,y\), the decrease \(x\) bounds the number of unmatched pairs charged at that stage of a prefix. These decreases telescope along the active path. The run-two orbit gives a quadratic witness: for \(m≥ 3\), cutting just after the children at phase \((m-1)/2\) leaves the signed contribution \[∑ₓ₌₁(m-1)/2(2x-m)=-(m-1)^2/4 \] from the first members of those pairs, with only \(O(n)\) additional weight. In Prefer-same, the corresponding charge is the drop in the number of terminal singleton runs. For a witness, take \(n=r+v\) with \(v\) odd and both \(r\) and \(v\) within a bounded distance of \(n/2\), with \(r≥ 5\) and \(v≥ 3\). The first \(m\) raw phases of the orbit with run-length encoding \((r,1^v)\), including the child blocks visited there, give weight at least \((v-2)(r-4)-2m\). Here \(1^v\) in a composition or run-length encoding denotes \(v\) parts of size 1. For Lex-comp, let \(W(A,s)\) expand the first \(p(A)\) parts of \(A\) as alternating runs, beginning with bit \(s\). Define \(ρ(A)\) by decreasing the last part greater than 1 by one and appending a part of size 1. The historical word starts with \(1^n0^n\). It then emits \(W(B,1)\) for the greatest-rotation compositions \(B≠(m)\) in descending lexicographic order. After a composition \(B\) of odd part period, it emits \(W(A,0)\) for all canonical even-period \(A\) with \(ρ(A)=B\), in descending order, and then \(W(B,0)\). The two starting bits give opposite weights. At most \(2m\) even-period compositions have had their first block emitted and still await their cancelling block at any block boundary. Each has weight of magnitude at most \(m\). A quadratic imbalance is attained in a consecutive group of bit-0 blocks: take \(B=(r,1^L)\), where \(L\) is even, \(r+L=m\), \(r≥ 5\), \(L≥ 2\), and both are within a bounded distance of \(m/2\). The group of inverse blocks has weight at most \(-(L-1)(r-4)\). Sala, Sawada and Alhakim asked whether their \(LC\)-representative successor gives the Fredricksen–Kessler word. With the inverse-shift rule described later in their §6 and implemented in Appendix A, seed \(0alt(m)\), and appended-bit output convention, it agrees bit for bit with the historical word beginning \(1^n0^n\). The earlier §6 representative bullet gives no selection in the orbit \(110→100→001→011→110\), where the implemented rule selects \(001\). Here \(alt(m)\) is the length-\(m\) alternating word ending in 0. At order two the word is \(1100\), and the order-one cycle is written \(10\). For a nonalternating composition \(B\), put \(a_B=1+#\{trailing unit parts of B\}\). The \(LC\) exit is at offset \(-a_B-1\) from the boundary of the chosen sign, and the orbit traversal starts one step later. A child \(C\) attaches in the alternating tail of its parent \(B=ρ(C)\). Moving the initial \(a_B\) bits of each recursive traversal to its end puts the preferred child words in descending composition order before \(W(B,1)\). For odd \(p(B)\), the complementary even-period child blocks then precede \(W(B,0)\). The alternating tails at the joins match exactly, so this rearrangement gives the historical block order with its original starting point. Sala–Sawada–Alhakim, §8, Conjecture 26, repeated as §12 P4. For generation by concatenation, Problem P1 asks for constant time per symbol in polynomial working space. The Lex-comp branch uses \(O(n)\) initialisation and \(O(n)\) working words. To find the blocks at an odd-period anchor \(B=u1^L\) with \(u\) ending in a nonunit part, either increment that final part of \(u\) and delete the final 1 of \(B\), or test the family \(u1^a2\,1L-2-a\) for \(0≤ a≤ L-2\). Keep canonical even-period candidates. The all-unit anchor has at most one inverse, and an anchor without a final 1 has none. In the indexed family the canonical indices form an interval, and only its endpoints can have a proper part period. Comparing rotations by pairing each nonunit part with the negative number of ones following it gives the interval in linear time using longest-common-extension queries on the fixed pairs. The extra increment candidate is tested separately. Consecutive primary compositions cannot both have a proper period, and each detour has only a bounded number of blocks shorter than \(m\). Consequently filling the next buffer of \(m\) bits takes \(O(m)\) work from any suspended output state. Two buffers allow that work to be done at a fixed rate while the previous buffer is emitted, giving worst-case \(O(1)\) operations per bit. Sala–Sawada–Alhakim, §12, Problem P1, Lex-comp branch named in §8. The Prefer-same and Prefer-opposite branches of P1 have \(O(n^3)\) initialisation and use \(O(n^3)\) working words, again with worst-case \(O(1)\) operations per subsequent bit. The construction cuts each orbit's primitive bit word at its children's attachment phases. In Prefer-same, the ordinary parent map is \(ρ\), the root is alternating, and both constant leaves attach to \((m)\). In Prefer-opposite, the ordinary parent map merges the last two parts, the root is \(0^n\), and \(1^n\) attaches to the root's sole child \((m)\). The ordinary parents use the preferred sign. An Opposite parent's last part \(L\) can be split into \(x,L-x\) for \(1≤ x<L\), and the canonical indices again form an interval. For either tree, take the official exit \(α\) of a child and change its first bit to obtain its attachment window in the parent. For ordinary exits, rotate the boundary window backwards by one plus its number of terminal singleton runs for Same, or by its last run length for Opposite. The published same-special and opp-special tests select the exceptional exits, for which the boundary window itself is the exit. A child starts at \(F(α)\). Emit each parent segment through its attachment window, the entire corresponding child traversal, and then the next parent segment. The first-bit traversal starts at \(alt(m)1\) or \(0^n\), respectively. Moving its first \(m\) bits to the end gives the conventional greedy word. Every stretch of \(\) emitted bits takes \(O(+n^3)\) private work, including boundary work after a pause. Two buffers of \(n^3\) bits turn this bound into constant delay by allotting a fixed number of private steps to each public bit. The streaming bounds use a word RAM with \(O(log(n+1))\)-bit words. The order-one and order-two outputs are \(10,1100\) for Same and \(01,0110\) for Opposite. Sala–Sawada–Alhakim, §§6–7 for the representatives and §12, Problem P1, Prefer-same and Prefer-opposite branches. Problem P3 asks for the zero-based cyclic starting position of any \(n\)-window and, conversely, for the entire window at any address \(0≤ r<2^n\), without generating the cycle. Both directions take \(O(n^4)\) word operations per query for the original Prefer-opposite cycle. Sala–Sawada–Alhakim, §12, Problem P3, Prefer-opposite branch. The original Prefer-sa
No takes yet. Share an insight, caveat, or question.
Zixuan He (2026) studied this question.
Synapse has enriched 8 closely related papers on similar clinical questions. Consider them for comparative context: