Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This works and is very intuitive, but loses quite a bit of the coin flip's entropy in the process. There are more efficient algorithms, such as http://www.eecs.umich.edu/~qstout/abs/AnnProb84.html , which better use the entropy generated by the coin flip.


One solution I heard has a basic idea that's quick to explain, although the details are messy. It might be interesting to get some intution:

Flip the coin N times and count the number of heads, K. You got one of the C = {N \choose K} = N!/((N-K)!K!) ways of getting K heads, all of which have the same probability, no matter what the bias of the coin is. If you consider an ordering of the C choices, then you have an integer from 0 to C-1 drawn uniformly at random. You could represent that integer using binary and extract about log_2(C) random bits.

For large N, the number of bits extracted is nearly the optimal NH bits, where H is the binary entropy of the coin. To count how far through a list of combinations I am for large N, I might construct a lattice and, I'm guessing, start reproducing works referenced by the paper that the parent linked to. Whereas the paper itself seems to have, from my quick skim, the definitive answer. Nice.

As tucked away in another comment, related is: http://en.wikipedia.org/wiki/Randomness_extractor


...but in the context (a children's book, teaching simple concepts of logic and math and programming) something that is intuitive is what's needed.

(But thanks for the nice link!)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: