[Math] Probability that flipping a coin that comes out head with probability p

combinatoricsprobabilityprobability theory

I'm reading Ross's A First Course in Probability Theory.

In an example it states that: Independent trials consisting of the flipping of a coin having probability p of coming
up heads are continually performed until either a head occurs or a total of n flips is
made. If we let X denote the number of times the coin is flipped, then X is a random
variable taking on one of the values 1, 2, 3, . . . , n with respective probabilities.

Given the example: $P\{X=2\} = P\{(T,H)\} = (1-p)p$
I figured that for if X = n, then $P\{X=n\} = (1-p)^{n-1} p$ since, if the coin was flipped n times, then it failed to come out 'heads' $n-1$ times, thus the $(1-p)^{n-1}$ and succeeds once with probability $p$ (only once, always, since we stop flipping the coin once the outcome is 'head'), thus the times $p$ at the end. The book appears to agree with this because of the given example:$P\{X = 3\} = P\{(T, T,H)\} = (1 − p)^2p$, and similarly with X = 2.

But at the end of the example, the book has: $P\{X = n\} = P\{(T, T,.. . , T,T), (T, T,.. . , T,
H)\} = (1 − p)^{n−1}$. Not $P\{X = n\} = P\{(T, T,.. . , T,
H)\} = (1 − p)^{n−1}*p$ as I expected, for the one time that it does succeed. Are those two expressions equivalent, the book mistaken, or am I not thinking clearly?

Thanks!

Best Answer

Community wiki answer so the question can be marked as answered:

As remarked by carmichael561, the example states that the experiment is stopped after $n$ flips if no head has occurred. This accounts for the discrepancy between your answer and the book's answer.

Related Question