Probability of Defective coins Among 100 coins one is defective: it has two heads. One chooses a coin (a good or bad one) and tosses it 10 
times. It turns out that the head comes out all 10 times. What is the probability that the head comes out again 
when the coin is tossed one more time? 
 A: We have two random variables which I will call
$C$ for nature of coin with possibilities: $n$ for normal and $d$ for defective
$H$ for number of heads in 10 throws.  
First we calculate what is the probability of the coin beeing defective given that we have 10 tosses all heads, which can be expressed $$P(C=d \vert H=10)= \frac{P(C=d,H=10)P(C=d)}{P(H=10)}$$
We know that $P(C=d)=\frac{1}{100}$, and $P(C=d,H=10)=1$
We compute $$P(H=10)=P(C=d,H=10)P(C=d)+P(C=n,H=10)P(C=n)=\frac{1123}{102400}\simeq 0.0109668$$
where $P(C=n,H=10)=\left(\frac{1}{2}\right)^{10}$, and $P(C=n)=\frac{99}{100}$
Thus
$$P(C=d \vert H=10)= \frac{P(C=d,H=10)P(C=d)}{P(H=10)}=\frac{1024
}{1123}\simeq 0.911843$$
Thus we can calculate the probability that in the next throw ($NH$) a heads will come out
$$P(NH=1\vert H=10)=P(NH=1,C=d\vert H=10)p(C=d\vert H=10)+P(NH=1,C=n\vert H=10)P(C=n\vert H=10)$$
which is
$$P(NH=1\vert H=10)=1\frac{1024
}{1123}+\frac{1}{2}\frac{99
}{1123} =\frac{2147}{2246}\simeq 0.955922$$
A: We first calculate the probability the coin is good (fair) given we got $10$ heads. Let $G$ be the event we used a good coin, and $T$ be the event $10$ consecutive heads. So we want $\Pr(G|T)$. By the defintion of conditional probability,
$$\Pr(G|T)=\frac{\Pr(G\cap T)}{\Pr(T)}.$$
The probability of $G\cap T$ is $\frac{99}{100}\cdot\frac{1}{2^{10}}$.
The probability of $T$ is $\frac{99}{100}\cdot\frac{1}{2^{10}}+\frac{1}{100}\cdot 1$.
Divide. We get $\Pr(G|T)=\frac{99}{99+2^{10}}$. Call this number $p$.
Then the probability next is a head is $p\cdot\frac{1}{2}+(1-p)\cdot 1$. 
A: Please note that Gambler's fallacy does not apply here, because not all coins are equal.
The formula for Bayes's theorem expresses the relationship between $\Pr(A\mid B)$ and $\Pr(B\mid A)$. In our context it can be written as
$$\Pr(\text{Defective}\mid 10H) = \frac{\Pr(10H\mid\text{Defective})\Pr(\text{Defective})}{\Pr(10H)}$$
We knew that


*

*$\Pr(\text{Defective}) = 1/100$

*$\Pr(10H\mid\text{Defective}) = 1^{10} = 1$

*$\Pr(10H) = 1 \cdot 1/100 + (1/2)^{10} \cdot 99/100 = 1123/102400$


So $\Pr(\text{Defective}\mid 10H) = 1024/1123$. This means the probability that you are holding a defective coin, given that 10 heads came up, is very high. This makes sense because it is unlikely that a good coin would give you 10 consecutive heads.
So, if it is indeed a defective coin, then the probability of getting a head again would be
$$1024/1123 \cdot 1 = 1024/1123$$
Or, if it is not a defective coin, then the probability is
$$99/1123 \cdot 1/2 = 99/2246$$
Therefore,
$$\Pr(\text{Head again}) = 1024/1123 + 99/2246 = 2147/2246$$
A: Try using Bayes's Theorem to get a result like 
$$\frac{P_0(A)P(H|A)^{11}+P_0(A^c)P(H|A^c)^{11}}{P_0(A)P(H|A)^{10}+P_0(A^c)P(H|A^c)^{10}}$$ where $P_0(A)$ is the prior probability of a good coin, $P_0(A^c)$ is the prior probability of a bad coin (its complement), $P(H|A)$ is the conditional probability of a head from a good coin, etc. 
