# Given $5$ heads in $17$ coin flips of a biased coin, what is the probability at least $3$ of those heads occured in the first $10$ flips?

Fix 0 < p < 1 and suppose there is a coin that obtains a head with probability p. We flip the coin 17 times and get a total of 5 heads. Given this information, what is the chance that 3 of those heads occurred in the first 10 flips?

P (3 heads in first 10 flips /5 heads in 17 flips) = P (3 heads in first 10 flips and 5 heads in 17 flips) / P (5 heads in 17 flips) ? I am confused, is this how I am supposed to approach this model?

• Exactly $3$ or at least $3$? – joriki Jul 21 '15 at 3:38
• exactly 3 heads – Dee Chantelle Jul 21 '15 at 3:39

## 2 Answers

Given the information that you got exactly $5$ heads, binomial is not really needed anymore. The $5$ heads are equally likely to be any $5$ of the $17$ flips. You can use the hypergeometric distribution: think of the first $10$ flips as a sample (without replacement) from the $17$ flips, of which $5$ are heads and $12$ are tails.

• Then would the answer be 5 C 3 * 12 C 2 / 17 C 10 ? – Dee Chantelle Jul 21 '15 at 3:43

As Robert said, you don't need the binomial distribution since you are given the condition.   But anyways... here's what happens when you use it.

Let $X_{10}$ be the count of successes in the first 10, and $X_7$ be the count in the last seven.   These will be independently binomially distributed, $\mathcal{Bin}(10,p)$ and $\mathcal{Bin}(7,p)$ respectively.   Of course, their sum will also have a binomial distribution, $\mathcal{Bin}(17,p)$; though not independently.

So thus, we want:

\begin{align} \mathsf P(X_{10}=3 \cap X_7=2 \mid X_{10}+X_7=5) & = \dfrac{\mathsf P(X_{10}=3)\mathsf P(X_7=2)}{\mathsf P(X_{10}+X_7=5)} \\[2ex] & = \dfrac{\dbinom{10}{3}p^3(1-p)^{7}\;\dbinom{7}{2}p^2(1-p)^5}{\dbinom{17}{5}p^5(1-p)^{12}} \\[2ex] & = \dfrac{\dbinom{10}{3}\dbinom{7}{2}}{\dbinom{17}{5}} \end{align}

Notice how the success/failure probability terms ($p$, $(1-p)$) so nicely cancel out to give us, not very surprisingly: the probability that a sample of size $10$ will contain $3$ successes when sampled without replacement from a population of size $17$ containing $5$ successes.   (Reference: Hypergeometric distribution).

That is all.