English

Generalized Gray codes with prescribed ends

Discrete Mathematics 2017-03-07 v1

Abstract

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

Keywords

Cite

@article{arxiv.1603.08827,
  title  = {Generalized Gray codes with prescribed ends},
  author = {Tomáš Dvořák and Petr Gregor and Václav Koubek},
  journal= {arXiv preprint arXiv:1603.08827},
  year   = {2017}
}

Comments

30 pages, 2 figures

R2 v1 2026-06-22T13:20:40.724Z