Generating key points…
Answers are grounded in this paper and cite their sources.
For every integer \(n≥ 1\), the binary Grandpa de Bruijn sequence can be streamed in its exact published RCL order using \(O(2^n)\) total word operations and \(O(n)\) auxiliary words, excluding the output. A binary de Bruijn cycle of order \(n\) has \(2^n\) bits and contains each binary word of length \(n\) exactly once as a cyclic window. Sawada, Sears, Trautrim and Williams identified the Grandpa cycle with the RCL traversal of the PCR4 concatenation tree and left open whether this cycle could be generated in constant amortised time. The algorithm gives a deterministic answer with a time constant independent of \(n\) and preserves the starting point specified by that traversal. Concatenation trees, §5.1, immediately before Corollary 19, p. 18 · Journal article, §5.1 To generate the sequence, start with the length-\(n\) word \(u=1^n\) and change index \(c=n-1\), using zero-based positions. At each node, keep the orientation of \(u\) inherited from its parent. Let \(p\) be the least positive shift that leaves \(u\) unchanged under cyclic rotation. The eligible positions form the block of length \(p\) containing \(c\) in the partition into consecutive blocks starting at position \(0\). An eligible position \(i\) is a child precisely when \(u_i=1\) and rotating \(u\) to start at \(i\), then changing that first bit to \(0\), gives a lexicographically least rotation of the edited word, with \(0<1\). To visit the child, flip \(u_i\) in place, pass \(i\) as its change index and restore the bit on return. Visit the children with \(i>c\) in increasing order, emit the first \(p\) bits of \(u\), then visit the children with \(i≤ c\) in increasing order. Corollary 19 supplies the identification of this traversal with Grandpa. The new screening rule reduces the number of least-rotation tests. In a word containing both symbols and at least two \(1\)s, let \(M\) be the length of the longest cyclic run of zeros and let \(r_i\) count the zeros immediately following a \(1\) at position \(i\). Apply the exact child test only at eligible \(1\)s satisfying \[uᵢ₋₁=1, r_i+1≥ M, \] with indices taken modulo \(n\). A least rotation of the edited word must start at the first zero of one of its longest zero-runs. The predecessor condition puts the edited bit at the beginning of its run, and the length condition ensures that this run can compete with the existing longest runs. The all-one root tests its sole eligible position, the all-zero node has no children, and a mixed word with a single \(1\) tests that position if eligible. Use Booth's linear-time least-rotation algorithm with its optional early-return shortcut disabled for each exact test. Booth's correction and shortcut-free variant The number of tests is controlled across the whole tree. For a uniformly chosen binary word \(W\) of length \(n\), let \(B(W)\) be the number of positive cyclic zero-runs of length at least \(M(W)-1\), where \(M(W)\) is the longest such run in a mixed word. Set \(B(W)=0\) on the two constant words. The mean \(2⁻ⁿ∑_{w∈\{0,1\}^n}B(w)\) is bounded by an absolute constant. For \(n≥4\), runs of lengths up to \(n/2\) contribute at most \[∑k≥1 n2⁻ᵏexp\!(-{(ln 2/64)n}{2^k}), \] where \(k\) is an integer run length and \(ln\) is the natural logarithm. Longer runs contribute at most another absolute constant. When \(M≥2\), each surviving position precedes a distinct run counted by \(B\). Each rotation class of full period has \(n\) distinct words with the same \(B\), so the mean controls the deterministic total of tests on those classes. Mixed words with \(M=1\) avoid adjacent zeros and contribute at most \(O(3n/2)\) tests on full-period classes. Classes of smaller period can be charged \(O(n^2)\) operations each, since their words repeat blocks of length at most \( n/2\) and there are at most \(∑q=1n/22^q\) such classes, with \(q\) the block length. The period and run scans take \(O(n)\) time per node, and each exact test takes \(O(n)\) time. Shared work arrays and a constant number of indices and flags per recursion frame suffice. After returning from a child, restore the bit and recompute the run data before resuming the scan. Each descent removes one \(1\), so at most \(n+1\) frames are live. If the written cycle must start at \(0^n\), a preliminary scan with an \(n\)-bit rolling buffer can locate that unique cyclic window. Two further traversals then emit the suffix followed by the prefix within the same asymptotic bounds. The preliminary scan can delay the first bit of this rotated output.
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: