Probability of head given that heads already appeared in the first N+M tosses

38 Views Asked by At

I have the following problem

An honest coin is tossed. What is the conditional probability that it appears head for the first time on the $N$ th toss, knowing that it has come up at least one head appears on the first $N+M$ tosses.

I think it can be solved in the following way \begin{align*} A & = \text{appears heads for the first time on the $N$ th toss} \\ B & = \text{at least one head appears on the first $N+M$ tosses} \end{align*} then \begin{align*} P(A|B) & = \frac{P(B|A) P(A)}{P(B)} \\ & = \frac{P(B|A) \frac{1}{2} (1-1/2)^{N-1} }{\sum_{i = 1}^{N+M} \binom{N+M}{i} \frac{1}{2} (1-\frac{1}{2 })^{N+M-i}} \end{align*}

how can it be calculated $P(B|A)$? could be $\frac{1}{2} (1-1/2)^{N-1} + \frac{1}{2} (1-1/2)^{N-1} \cdot \sum_{i = 1}^{M} \binom{M}{i} \frac{1}{2^i} (1-1/2)^{M-i} $? because we want at least one head to appear, but the first coin appears in the $N$th position, so the others can only come out in $M$ positions

Greetings