Simulate dice with honest coin transfer

Given a fair coin (0/1), how do you simulate honest bones (from 0 to 5) The obvious answer that I know throws 3 times, treats each throw as a bit to create (2 ^ 3 = 0 to 7) If the result == 7, drop and retry.

Well, theoretically the worst case of big-O of this is really bad (another question in itself is to do something with monte-carlo algos). Allows you to keep this soln on a shelf.

So, now my question is: Is there / may there be n number of coin rolls that can guarantee imitation of dice? Of course, if there is a desire to know the minimum number of shots. :)

In the absence of a number that is divisible by three and 2 ^ n, I could not think of any way to solve this. :(

+4
source share

All Articles