0
$\begingroup$

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?

  • 0
    Are you willing to specify a tolerance $\epsilon$ and accept a solution where the probability of selecting $i$ is within $\epsilon$ of $1/|S|$?2017-01-20
  • 0
    It is ok! But I want to tolerance is negligible.2017-01-20
  • 0
    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.2017-01-20
  • 0
    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-ways2017-01-20
  • 0
    In my question, p(i) is known.2017-01-20
  • 0
    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.2017-01-20
  • 0
    See also http://math.stackexchange.com/questions/146605/improving-von-neumanns-unfair-coin-solution2017-01-20

1 Answers 1

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.

  • 0
    It is a great suggestion! Thanks a lot!2017-01-20
  • 0
    This is a clever bit of von Neumannery, as so many things are.2017-01-20
  • 0
    According to the paper suggested by Momo, p(i) is unknown but constant for all n. What if p(i) is known but variable according to different i?2017-01-20