# A generalization of the Von Neumann extractor

An iterative randomness extraction algorithm which generalized the Von Neumann's extraction algorithm is detailed, analyzed and implemented in standard C++. Given a sequence of independently and identically distributed biased Bernoulli random variables, to extract randomness from the aforementioned sequence pertains to produce a new sequence of independently and identically distributed unbiased Bernoulli random variables. The iterative construction here is inspired from the work of Stout and Warren 1984 who modified appropriately the tree of probabilities produced by recursively repeating the Von Neumann's extraction algorithm. The correctness of the iterative algorithm is proven. The number of biased Bernoulli random variables needed to produce one unbiased instance is the complexity of interest. The complexity depends on the bias of the source. The expected complexity converges toward 3.10220648... when the bias tends to 0 and diverges when the bias tends to 1/2. In addition to the expected complexity, some other results that concern the limiting asymptotic construction, and that seem unnoticed in the literature so far, are proven.

READ FULL TEXT