How to determine the number of coin tosses to identify one biased coin from another? 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.
 A: Some factors to think about:


*

*How different are the probabilities? 

*How sure do we want to be?


If the probabilities of heads are close together, like $p=.501$ and $q=.500$, it will take many trials to really see any difference, but if the probability of heads are drastically different, like $p=.9$ and $q=.4$, fewer trials are needed.
All we need is to tell if our statistical significance overlaps at all.
Doing the math:
Mean number of heads for X->$n*p$ | Standard Deviation X$=\sqrt{n*p*(1-p)}$
Mean number of heads for Y->$n*q$ | Standard Deviation Y$=\sqrt{n*q*(1-q)}$
In order to determine if we have one coin, we need to be sure we DON'T have the other coin. If we do enough trials and our head success count is outside of our allowed parameters, we decide it is the other coin.
For example, X has probability $.3$, Y has probability $.6$. We will use an $a=.05$ significance value. Therefore,
Mean X$=.3n$
Standard Deviation X$=\sqrt{.3n*(1-.3)}\approx.46\sqrt{n}$
We run $n$ trials and get a proportion $g$.
test$=$normalpdf$(.3*n,.46*\sqrt{n},g*n)$
If this test probability is more than $.05$, we can determine with an $a=.05$ significance that the coin's bias is not different enough from coin X's bias to prove that the coin is not coin X.
But if the test probability is more than $.05$, we fail to prove with an $a=.05$ significance that the coin's bias is different enough from coin X's bias to not be coin X.
Does this help?
A: 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.
A: We should find the percentage of heads that is equally probable for both coins, let that be $m\in(0,1)$ Let say $p<m<q$. So we have:
$$p^m(1-p)^{1-m}=q^m(1-q)^{1-m}\\
(\frac p q)^m(\frac {1-p}{1-q})^{1-m}=1\\
(\frac {p(1-q)} {q(1-p)})^m=\frac {1-q}{1-p}\\
m=\log_{\frac {p(1-q)} {q(1-p)}}\frac {1-q}{1-p}$$
We are looking for such $n$ that probability that number of heads is bellow $mn$ when you picked X, is for $P$ larger than same probability if you picked Y. Where $P$ is the wanted accuracy for claiming which coin it is.
$p_n(k<mn|X)-p_n(k<mn|Y)>P$ Which also implies $p_n(k>mn|Y)-p_n(k>mn|X)>P$
For finding $p_n(k<mn|X)$ we can use approximation to standard Normal distribution, it will be 
$$\Phi(\sqrt n\frac{m-p}{\sqrt{p(1-p)}})-\Phi(\sqrt n\frac{m-q}{\sqrt{q(1-q)}})>P$$
So problem becomes: find $x$ such that $\Phi(ax)-\Phi(bx)>P$ where $a,b,P$ are known
