Number of times a coin needs to be tossed to get $r$ heads. (Is this a geometric distribution?)

220 Views Asked by At

I'm faced with the following problem:

Let $X$ be the number of times that we need to toss a coin until $r$ heads are obtained. Find the distribution and the expectation of $X$, if the probability of the coin landing heads is $p$.

I tried doing it this way:

If we require $n$ tosses to get $r$ heads, then in the first $n-1$ tosses we had $r-1$ heads and $n-r$ tails and the $n$th toss was heads. $$P(X=n) = \binom{n-1}{r-1} \cdot(1-p)^{n-r} \cdot p^{r-1} \cdot p$$

Is this a geometric distribution or some extension? I am sure I can wrangle that formula to give me the expectation after a lot of manipulation, but I was wondering if there was a way to massage it into a known expectation.

2

There are 2 best solutions below

2
On

Your formula looks right. This is the negative binomial distribution (shifted by adding $r$, since you are counting the total number of tosses rather than the number of tails).

An easy way to get the expectation is that you are tossing coins until you get one head, and repeating $r$ times, so the expectation is just $r$ times that for one head (which is a geometric distribution).

0
On

Geometric distribution usually applies to the first successful outcome. How many coin tosses before getting a tails for instance.

If you apply this to multiple outcomes, say the probability of getting 5 heads in 5 tosses of a coin, then 6 tosses, then 7 etc, that distribution isn't geometric (a probability isn't generated by a common ratio of the previous).

As expectation is a factor of probability, I don't see how that would work as a geometric distribution either.