Generalized Gray codes with prescribed ends

Abstract

An n-bit Gray code is a sequence of all n-bit strings such that consecutive strings differ in a single bit. It is well-known that given α,β∈\0,1\n, an n-bit Gray code between α and β exists iff the Hamming distance d(α,β) of α and β is odd. We generalize this classical result to k pairwise disjoint pairs αi, βi∈\0,1\n: if d(αi,βi) is odd for all i and k<n, then the set of all n-bit strings can be partitioned into k sequences such that the i-th sequence leads from αi to βi and consecutive strings differ in a single bit. This holds for every n>1 with one exception in the case when n = k + 1 = 4. Our result is optimal in the sense that for every n>2 there are n pairwise disjoint pairs αi,βi∈\0,1\n with d(αi,βi) odd for which such sequences do not exist.

0

Turn this paper into a lesson

ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…