TITLE: How to determine the number of coin tosses to identify one biased coin from another?
QUESTION [6 upvotes]: If coin $X$ and coin $Y$ are biased, and have the probability of turning up heads at $p$ and $q$ respectively, then given one of these coins at random, how many times must coin A be flipped in order to identify whether we're dealing with coin $X$ or $Y$? We assume a 0.5 chance that we can get either coin.

REPLY [2 votes]: If you know beforehand that $p=1$ and $q=0$ or vice versa then one flip is enough.
If you know beforehand that $p=1$ and $0<q<1$ you will almost certainly find out, but it may take an "infinitely" long time (i.e., for any given $n$, the probability that it takes at least $n$ flips is non-zero).
In the general case where $0<p<1$ and $0<q<1$ you will never know for sure, as both coins may produce any possible series of flips. As others have mentioned, you can achieve some degree of (bayesian) certainty, but you can never be certain.