# Extremely ($90$%) biased coins. What information can we derive/assume based on results of only $10$ coin flips?

Let's suppose there are $2$ heavily biased coins such that coin A has a bias of coming up $90$% heads and coin B has a bias of coming up $90$% tails. Both coins are placed in a bag and one is randomly chosen in a way that either coin is equally likely to be chosen and cannot be identified as either A or B. The coin is tossed fairly $10$ times and it is observed that $10$ heads came up.

Then if someone were to ask that if that same coin is tossed $10$ more times, what is the number of heads expected, can we assume at the point that it is coin A or can we not assume that and just say we would expect $5$ heads on average? That is, since the $10$ "given" heads is not a $100$% definitive indication of what coin we have, must we say that it could be either coin A or coin B or can we "bias" our answer towards coin A and say that we expect something like $9$ out of $10$ heads instead of just $5$? However, if we do that and we "guess" wrongly, (that is it was actually coin B), then our estimate will likely be WAY off! Should we assume that it is more likely that coin A was chosen than coin B and thus our answer will be affected? If so, then how do we compute the number of expected heads?

The "problem" is that in the shortrun, even a heavy bias may not "pan out" to the expected outcome. For example, maybe this experiment was tried millions of times and this short (relative to millions) observed outcome just happened to be $10$ heads in a row but it was actually coin B that did this.

• You are asking if you should input a hypothesis test into computations for the expected value. This is not really it. You can compute $P(10H | A) = 0.9^{10}$ and $P(10H | B) = 0.1^{10}$ but you want $P(A | 10H)$ or $P(B | 10H) = 1 - P(A | 10H)$. – AlexR Oct 16 '14 at 22:14
• I am asking how do we accurately compute the number of expected heads on the 2nd group of $10$ coin tosses given that the first group of $10$ were all heads but the coin selected in unknown. – David Oct 16 '14 at 22:20
• That's the same as $$E(X | 10H) = \underbrace{E(X | 10H \cap B)}_{=E(X|B)=1} \cdot P(B | 10H) + \underbrace{E(X | 10H \cap A)}_{=E(X|A)=9} \cdot P(A | 10H)\\=1+8 P(A|10H)$$ or am I missing something? – AlexR Oct 16 '14 at 22:22
• Oh my. That means that one SHOULD assume that based on the results that it IS coin A and thus report a high number of expected heads on the next $10$ coin flips. So generalizing, if there is ANY bias in the $2$ coins then a similar thing should be done, even if the coins are say $51$% and $49$% biased towards heads. – David Oct 16 '14 at 22:40
• Not quite. "should" is always a question of taste. If you want to incorporate the event $10H$ in your calculations, you'll be more or less forced to or just forget that it all happened and assume $A$ and $B$ equally likely. What changes is that $P(A|10H) \approx 0.5$ the slighter the bias is. And thus $E(X|10H) \approx 1 + 8\cdot 0.5 = 5$ as expected. – AlexR Oct 16 '14 at 22:43

\begin{align} \text{From the given:} &\quad C\, (\text{coin identity}), E\, (\text{evidence}) \\ \mathsf P(E=10H\mid C=A) & = 0.9^{10} \\ & = 0.3486784401 \\[1ex] \mathsf P(E=10H\mid C=B) & = 0.1^{10} \\ & = 0.0000000001 \\[2ex] \text{We can find:} \\[1ex] \mathsf P(C=A\mid E=10H) & = \frac{\mathsf P(E=10H\mid C=A)\mathsf P(C=A)}{\mathsf P(E=10H\mid A)\mathsf P(C=A)+\mathsf P(E=10H\mid B)\mathsf P(C=B)} \\[1ex] & = \frac{0.9^{10}0.5}{0.9^{10}0.5+0.1^{10}0.5} \\[1ex] & \approx 0.9{\small 9999999971320280100300850204388...} \end{align}

So we can say that, given the evidence, it's quite highly probable that the coin is A.   We cannot assume that it is certainly so, but we can be fairly confident about it.

However, we then use the Law of Iterated Expectation to find the expected number of heads on subsequent tosses.

\begin{align}\mathsf E(X\mid E=10H) & =\mathsf E_C[\mathsf E[X\mid E=10H, C]] \\[1ex] & = \mathsf E[X\mid C=A] \mathsf P(C=A\mid E=10H) + \mathsf E[X\mid C=B]\mathsf P(C=B\mid E=10H) \\[2ex] & = \frac{0.9^{10}\mathsf E[X\mid C=A]+ 0.1^{10}\mathsf E[X\mid C=B]}{0.9^{10}+0.1^{10}} \\[2ex] & = \frac{0.9^{10}\cdot 10\cdot 0.9+ 0.1^{10}\cdot 10\cdot 0.1}{0.9^{10}+0.1^{10}} \\[2ex] & = \frac{0.9^{11}\cdot 10+ 0.1^{11}\cdot 10}{0.9^{10}+0.1^{10}} \\ & \approx 8.9{\small 999999977056224080240680163511...} \end{align}

To use the information $10H$ (abbr. $H$) we compute $$E(X|H) = 1+8P(A|H) = 1 + 8 \underbrace{P(H|A)}_{=0.9^{10}} \frac{P(A)}{P(H)} = 1 + 8 \cdot 0.9^{10} \cdot 0.5 \cdot \frac1{0.9^{10} + 0.1^{10}}\\ =4.999999998852811204012034008175536171278306641914362905882931\ldots$$

You can see it's extremely close to $5$, I don't know why the expected value comes out $<5$, but maybe I got a term wrong there.

I have used Bayes' theorem there and $P(H) = P(H|A) + P(H|B) = 0.9^{10} + 0.1^{10}$

$$P(\text{10 heads initially}|A)=0.9^{10}$$ $$P(\text{10 heads initially}|B)=0.1^{10}$$ $$P(A|\text{10 heads initially})=\frac{\frac12\times 0.9^{10}}{\frac12\times 0.9^{10}+\frac12\times 0.1^{10}}=\frac{9^{10}}{9^{10}+1} \approx 0.99999999971$$ $$P(B|\text{10 heads initially})=\frac{1}{9^{10}+1} \approx 0.00000000029$$ $$E[\text{number of heads in second 10}|A]=10\times 0.9 = 9$$ $$E[\text{number of heads in second 10}|B]=10\times 0.1 = 1$$ $$E[\text{number of heads in second 10}|\text{10 heads initially}] = 9 \times \frac{9^{10}}{9^{10}+1} + 1 \times \frac{1}{9^{10}+1}$$ $$= \frac{9^{11}+1}{9^{10}+1} \approx 8.9999999977$$ so given the $10$ heads initially, it is much more likely that the coin chosen was $A$, and the expected number of heads in the second $10$ is almost, but not quite, the same as the expectation with coin $A$.