The largest minimum run length of an 8-bit cyclic Gray code is 6
Description
An n-bit cyclic Gray code arranges all 2ⁿ binary strings of length n in a cycle so that adjacent strings differ in a single bit. As one traverses the cycle, each coordinate alternates between runs of 0s and runs of 1s; write r(n) for the largest possible minimum run length across all n-bit cyclic Gray codes. Prior work determined r(n) for all n ≤ 7, while Perezhogin (2007) constructed an 8-bit code showing r(8) ≥ 6, leaving r(8) ∈ {6,7} open. Here we rule out minimum run length 7 by an exhaustive computer search, independently replicated in full by a standalone C verifier, proving r(8) = 6 and settling the open problem of Knuth and Perezhogin–Bykov. Encoding cycles of minimum run length n−1 as cyclic binary words, quotienting out cube symmetries, shifts, and reversals under a tuned position-dependent order, and adding degree lookahead shrink direct coordinate backtracking from roughly 1.55 × 10¹⁵ nodes to 2.43 × 10¹² nodes. We formalize the reduction and r(8) ≥ 6 in Lean 4 (with no external libraries), and classify all n ≤ 7 cycles of minimum run length at least n−1 as well as which order-8 cube symmetries admit optimal 8-bit codes.
Files
gray_code_r8.pdf
Additional details
Related works
- Is supplemented by
- Dataset: 10.5281/zenodo.24513427 (DOI)