Calculate the probability such that out of the $10$ coin flips at least $M$ flips were tails, given that there were at least $M$ identical results Say I toss $10$ unfair coins where $P(\text{tails}) = p$ and $p > 0.5$.
I want to calculate the probability such that out of the $10$ coin flips at least $M$ flips were tails, given that there were at least $M$ identical results.
My solution was as follows :
Let $X$ be the number of tails results and $Y$ be the number of heads results.
I tried to calculate 
$$P(X\geq M \mid (X\geq M)\cup(Y\geq M)) = \frac{P(X\geq M)}{ P((X\geq M)\cup (Y\geq M))}$$ where $P(X\geq M) = \binom{10}{M} p^M (1-p)^{10-M}$ and $P(Y\geq M)$ can be calculated in the same way.
Is $P((X\geq M)\cup (Y\geq M)) = P(X\geq M) + P(Y\geq M))$? 
Is this solution is correct? am I missing anything?
Thanks
 A: Let $X$ be the number of tails results, $Y$ be the number of identical results. 
$$P(X = 0, Y >= 8) = P(X = 0)$$
$$P(X = 1, Y >= 8) = P(X = 1)$$
$$P(X = 2, Y >= 8) = P(X = 2)$$
$$P(X = 3, Y >= 8) = 0$$
$$...$$
$$P(X = 7, Y >= 8) = 0$$
$$P(X = 8, Y >= 8) = P(X = 8)$$
$$P(X = 9, Y >= 8) = P(X = 9)$$
$$P(X = 10, Y >= 8) = P(X = 10)$$
You want to calculate $P_M=P(X >= M, Y >= 8)$.
For $M >= 8$ the result is:
$$P_M = \sum_{k=M}^{10} P(X=k)$$ 
For $M > 2$ and $M<8$ the result is:
$$P_M = \sum_{k=8}^{10} P(X=k)$$
For $M <= 2$ the result is:
$$P_M = \sum_{k=M}^{2} P(X=k) + \sum_{k=8}^{10} P(X=k)$$
where:
$$P(X=k) = {{10}\choose{k}} p^k (1-p)^{10-k}$$
If you introduce constant $a_k$ so that:
$a_k=1$ for $k=0,1,2,8,9,10$ and 
$a_k=0$ for $k=3,4,5,6,7$ 
...you can write all three results in a simple form:
$$P_M = \sum_{k=M}^{10} a_k{{10}\choose{k}} p^k (1-p)^{10-k}$$
A: Hints:
   $$\Pr(A|B)=\frac{\Pr(A\cap B)}{\Pr(B)} $$
where 

  
*
  
*Event $A$ is at least M flips are tails.
  
*Event $B$ is there are at least M identical results.
  

$$\Pr(B) = \Pr(\text{at least M tails})+ \Pr(\text{at least M heads})-\Pr(\text{at least M tails and at least M heads})$$
and
$$\begin{align}\\
\Pr(\text{at least M tails})&=\Pr(\text{M tails})+\Pr(\text{M+1 tails})+\cdots+\Pr(\text{10 tails})\\
&=\binom{10}{M}p^M(1-p)^{10-M}+\binom{10}{M+1}p^{M+1}(1-p)^{9-M}+\cdots+\binom{10}{10}p^{10}(1-p)^0\end{align}$$
Notice that since here $A\subset B$, then $\Pr(A\cap B)=\Pr(A)$ and the final result becomes $\frac{\Pr(A)}{\Pr(B)}$.
