A balanced binary sequence of length has entries of each kind. Uniformly sample an -element subset of the positions and place the first kind there. If is a power of two, repeatedly draw uniform positions using fair random bits, reject previously selected positions, and stop after distinct positions. Each new position is uniform among those remaining, making every -element subset equally likely. The expected number of draws is , giving expected random bits.
Articles by others on the same topic
There are currently no matching articles.