Simpler problem: how do you take a biased coin and convert it into a perfect source of random bits?
You flip the coin twice. If it comes up differently, you pick the first one. Otherwise you repeat. That will produce 50/50 random bits, no matter what the probability of the coin is.
I always had it in my head that the way to do this with a random noise source was to do what is done with radiation. Because radiation is emitted randomly, but time dependent, you can measure the time differences between three (four?) events. If the time between A-B is greater than the time between B-C, the random bit is a one otherwise, it’s a zero. I think it works with just three events, but I’m not sure.
You could do the same with audio noise by looking for peaks above a certain value and using a similar time function.
I don’t know if that is really how it is done, so I might be misremembering.
You flip the coin twice. If it comes up differently, you pick the first one. Otherwise you repeat. That will produce 50/50 random bits, no matter what the probability of the coin is.