1
$\begingroup$

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?

$\endgroup$
5
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.