Minimum number of bit-flips to enumerate all bit-strings

218 Views Asked by At

If you have an $n$-bit binary string initialised in $000...000$, and at each step you are allowed to flip a single bit, what is the minimum number of flips required to have arrived at every possible $n$-bit binary string?

1

There are 1 best solutions below

0
On BEST ANSWER

The Gray code enumerates all possible strings with single flips, so $2^n$.