Loading [MathJax]/jax/output/HTML-CSS/jax.js

Sunday, November 8, 2020

Von Neumann's fair coin simulator

For any p(0,1), von Neumann showed that an unfair coin which shows heads with probability p can be used to simulate a fair coin by flipping twice, ignoring/redrawing for HH or TT and associating HT with T and TH with H. The issue is that depending on the value of p, one might need to ignore/redraw for HH and TT outcomes for a very large number of tries before getting either TH or HT and exiting.

For what values of p(0,1) is it possible to simulate a fair coin in at most N flips?

While the phrasing on the question is a bit vague, I will assume two main frameworks for what "possible" means:

1) For what values of p(0,1) is the expected number of flips needed to exit less than or equal to N?; or

2) Given some value of q(0,1), for what values of p(0,1) does the probability that the simulation exists in less than or equal to N exceed q?

Let T be the number of flips of the van Neumann simulator needed to exit. The probability that the van Neumann simulator exits after in one flip is P{T=1}=2p(1p). The probability for k>1 that it exits in k flips is P{T=k}=2p(1p)(12p(1p))k1. So the average is E[T]=k=1kP{T=k}=k=1k2p(1p)(12p(1p))k1=2p(1p)1(1(12p(1p)))2=12p(1p).

So under framework 1, the question becomes solving for p(0,1) such that Ep[T]=12p(1p)N. Thus the solution is p[112/N2,1+12/N2].

Under framework 2, the question becomes for some q(0,1), solving for p(0,1) such that Pp{TN}=Nk=12p(1p)(12p(1p))k1=1(12p(1p))Nq. Since 2p(1p)[0,0.5] for all p(0,1), if q>12N, then Pp{TN}<q, for all p(0,1). But for any q[0,12N], then Pp{TN}q for p[12N1q12,1+2N1q12].

No comments:

Post a Comment