0

Say, I have a coin and the up-face is two times heavy than the down-face. If I flip the coin as usual, the probability of face-down is two times of that of face-up. Now, if I make the following agreement: only if two successive face-down occurs, I output "face-down"; otherwise, I always output "face-up". By doing so, is the output sequence balanced?

More in general, say I have a sampling algorithm that output i from the space S with probaibility p(i). Now, if I want a new sampling algorithm that sample i from S in a random and uniform manner, i.e., selecting i from S with exact probability 1/|S|, how can I do?

Gerry Myerson
  • 185,413
  • Are you willing to specify a tolerance $\epsilon$ and accept a solution where the probability of selecting $i$ is within $\epsilon$ of $1/|S|$? – Brian Borchers Jan 20 '17 at 04:53
  • It is ok! But I want to tolerance is negligible. – Licheng Wang Jan 20 '17 at 05:22
  • is $p(i)$ unknown to you or do you know it? Momo's answer below deals with the case where $p(i)$ is unknown and you want to produce 0-1 outputs that have probability 1/2. – Brian Borchers Jan 20 '17 at 05:49
  • See also this question, which deals with a different problem in which the random inputs 0 or 1 with probability 1/2, but the output has $|S|=3$. http://math.stackexchange.com/questions/2356/is-it-possible-to-split-coin-flipping-3-ways – Brian Borchers Jan 20 '17 at 05:50
  • In my question, p(i) is known. – Licheng Wang Jan 20 '17 at 06:09
  • The question that I linked to shows how this can be done exactly with an acceptance/rejection method. If you want to use a fixed number of random inputs, then you can approximate the desired output, but it may not be possible to get it exactly. – Brian Borchers Jan 20 '17 at 06:12
  • See also http://math.stackexchange.com/questions/146605/improving-von-neumanns-unfair-coin-solution – Gerry Myerson Jan 20 '17 at 06:22

1 Answers1

3

The way you do for the coin is that you flip twice, and reject the flips if outputs are identical ($HH$ or $TT$). When you get two different outputs ($HT$ or $TH $), then you output for example: $h$ if you have $HT$ and $t$ if you have $TH$. It is easy to see that the probability for outputting $h$ and $t$ are both equal to $1/2$

To generalize this, you have to use some information theory (calculate the bits of entropy of your biased die, generate a mapping and calculate its efficiency). You may take a look at this paper if you want the details.

Momo
  • 16,300