GATE Computer ScienceVery hardGATE CSE · UGC NET

A 3-bit Gray-code sequence lists all 8 codes exactly once, with consecutive codes differing in exactly one bit (the last need not be adjacent to the first). How many such sequences start with 000?

  1. A. 12
  2. B. 9
  3. C. 18
  4. D. 36

Correct answer: C. 18

These are the Hamiltonian paths of the 3-cube starting at 000; depth-first counting gives 18 (only 12 of them also close into a cycle).

More Digital Logic questions

Exams that ask this topic