Problem: Let's say you have a coin that might be (you don't know how biased, or even whether biased in the first place) biased, and you want to come up with a way to simulate an unbiased flip.
My reasoning (took me a few steps to get here but I'll spare you the struggle) is that no matter how biased the coin is, the probability of observing HT is the same as the probability of observing TH (assuming P(H) and P(T) are independent).
So we can assign for example H to HT and T to TH, and just wait for either sequence to take place.
I think that makes sense, but my intuition has been proven wrong so many times in the past that I really want to make sure my reasoning here is correct.
I'm also very interested to hear other ways to think about this and other kinds of intuition for this idea.
EDIT: Based on @Mariuslp's answer, I'd like to understand why we can't use a "sliding window", meaning why we have to toss away the first two flips if neither HT nor TH happens.
From my comment to his answer: The way I think about it, the probability of the entire sequence that happens before either HT or TH is the same for either HT or TH since P(H) and P(T) are independent, so it shouldn't matter. What's the problem with my thinking?