1993 Paper 3 Q15

Year: 1993
Paper: 3
Question Number: 15

Course: LFM Stats And Pure
Section: Negative Binomial Distribution

Difficulty: 1700.0 Banger: 1501.5

Problem

The probability of throwing a head with a certain coin is \(p\) and the probability of throwing a tail is \(q=1-p\). The coin is thrown until at least two heads and at least two tails have been thrown; this happens when the coin has been thrown \(N\) times. Write down an expression for the probability that \(N=n\). Show that the expectation of \(N\) is $$ 2\bigg({1\over pq} -1-pq\bigg). $$

Solution

This can either occur via \(N-2\) heads and \(1\) tail in the first \(N-1\) flips, followed by a tail, or \(N-2\) tails and \(1\) head in the first \(N-1\) flips, followed by another head, ie \begin{align*} \mathbb{P}(N = n) &= \underbrace{\binom{n-1}{1}}_{\text{ways to choose when the first tail occurs}}p^{n-2}q^2 + \underbrace{\binom{n-1}{1}}_{\text{ways to choose when the first head occurs}}q^{n-2}p^2 \\ &= (n-1)p^2q^2(p^{n-4}+q^{n-4}) \\ \\ \mathbb{E}(N) &= \sum_{n=4}^{\infty} n \cdot \mathbb{P}(N = n) \\ &= \sum_{n=4}^{\infty} n \cdot (n-1)p^2q^2(p^{n-4}+q^{n-4}) \\ &= \sum_{n=4}^{\infty} n \cdot (n-1)(p^{n-2}q^2+q^{n-2}p^2) \\ &= q^2\sum_{n=4}^{\infty} n(n-1)p^{n-2}+p^2\sum_{n=4}^{\infty} n(n-1)q^{n-2} \\ &= q^2\left ( \sum_{n=2}^{\infty} n(n-1)p^{n-2} -2 \cdot 1 - 3 \cdot 2 \cdot p\right)+p^2\left ( \sum_{n=2}^{\infty} n(n-1)q^{n-2} - 2-6q\right) \\ &= q^2\left ( 2(1-p)^{-3} -2 - 6 p\right)+p^2\left ( 2(1-q)^{-3} - 2-6q\right) \\ &= q^2\left ( 2q^{-3} -2 - 6 p\right)+p^2\left ( 2p^{-3} - 2-6q\right) \\ &= \frac{2}{q} - 2q^2 - 6pq^2+\frac{2}{p} -2p^2-6p^2q \\ &= \frac{2}{q}+\frac2p - 2(p^2+q^2) - 6pq \\ &= \frac{2}{pq} - 2((p+q)^2-2pq) - 6pq \\ &= \frac{2}{pq} - 2 -2pq \\ &= 2 \left (\frac1{pq} - 1 - pq \right) \end{align*}
Rating Information

Difficulty Rating: 1700.0

Difficulty Comparisons: 0

Banger Rating: 1501.5

Banger Comparisons: 2

Show LaTeX source
Problem source
The probability of throwing a head with a certain coin is $p$ and
the probability of throwing a tail is $q=1-p$. 
The coin is thrown until at least two heads and at least two tails have
been thrown; this happens when the coin has been thrown $N$ times.
Write down an expression for the probability that $N=n$.
                                                  
Show that the expectation of $N$ is 
$$
2\bigg({1\over pq} -1-pq\bigg).
$$
Solution source
This can either occur via $N-2$ heads and $1$ tail in the first $N-1$ flips, followed by a tail, or $N-2$ tails and $1$ head in the first $N-1$ flips, followed by another head, ie

\begin{align*}
\mathbb{P}(N = n) &= \underbrace{\binom{n-1}{1}}_{\text{ways to choose when the first tail occurs}}p^{n-2}q^2 + \underbrace{\binom{n-1}{1}}_{\text{ways to choose when the first head occurs}}q^{n-2}p^2 \\
&= (n-1)p^2q^2(p^{n-4}+q^{n-4}) \\
\\
\mathbb{E}(N) &= \sum_{n=4}^{\infty} n \cdot \mathbb{P}(N = n) \\
&= \sum_{n=4}^{\infty} n \cdot (n-1)p^2q^2(p^{n-4}+q^{n-4}) \\
&= \sum_{n=4}^{\infty} n \cdot (n-1)(p^{n-2}q^2+q^{n-2}p^2) \\
&= q^2\sum_{n=4}^{\infty} n(n-1)p^{n-2}+p^2\sum_{n=4}^{\infty} n(n-1)q^{n-2} \\
&= q^2\left ( \sum_{n=2}^{\infty} n(n-1)p^{n-2} -2 \cdot 1 - 3 \cdot 2 \cdot p\right)+p^2\left ( \sum_{n=2}^{\infty} n(n-1)q^{n-2} -  2-6q\right) \\
&= q^2\left ( 2(1-p)^{-3} -2 - 6 p\right)+p^2\left ( 2(1-q)^{-3} -  2-6q\right) \\
&= q^2\left ( 2q^{-3} -2 - 6 p\right)+p^2\left ( 2p^{-3} -  2-6q\right) \\
&= \frac{2}{q} - 2q^2 - 6pq^2+\frac{2}{p} -2p^2-6p^2q \\
&= \frac{2}{q}+\frac2p - 2(p^2+q^2) - 6pq \\
&= \frac{2}{pq} - 2((p+q)^2-2pq) - 6pq \\
&= \frac{2}{pq} - 2 -2pq \\
&= 2 \left (\frac1{pq} - 1 - pq \right)
\end{align*}