# Two coins tossed $5$ times with different probabilites for heads on each coin. What's the probability of getting at least $3$ heads?

Given two coins with $P_1(H) = \frac{1}{2}$ and $P_2(H) = \frac{1}{3}$, one is chosen at random and tossed $5$ times, what's the probability of tossing at least $3$ heads?

If $A$ is the probability of getting at least three heads, then $P(A) = P(3) + P(4) + P(5)$ where $P(i)$ is the probability of getting $3, 4,$ and $5$ heads exactly respectively.

I know see that $P(3) = C_3^5P(H)^3(1-P(H))^{5-3}$, but this depends on the coin being tossed.

I also know that $P(3) = P(3 | B_1)P(B_1) + P(3 | B_2)P(B_2)$ for some partition ${B_1, B_2}$. But what would be an appropriate partition here?

• the most remarkable thing is that the probability to get 3 and more with a fair coin is of 1/2. Intuitively , one may think that 1/2 is for some mean of 2.5 and then expect less probability for the 3 heads. – user354674 Sep 7 '16 at 0:54

Rather than determining the probability of getting $n$ heads as a function of the probability of heads, and then conditioning the probability of heads on which coin you chose, swap the order.

In other words, assume the probability of choosing coin $1$ or coin $2$ is $1/2$ either way. Then, given you choose coin $1$, the probability of getting at least $3$ heads is trivially $1/2$ (do you see why?). Given you choose coin $2$, the probability of getting at least $3$ heads is smaller, but (as you point out) can be obtained as

$$P(\text{at least 3 heads \mid coin 2}) = \sum_{k=3}^5 \binom{5}{k} \left(\frac{1}{3}\right)^k \left(\frac{2}{3}\right)^{5-k}$$

This should be straightforward to compute. Then we can compute

\begin{align} P(\text{at least $3$ heads}) & = P(\text{at least $3$ heads $\mid$ coin $1$}) P(\text{coin $1$}) \\ & + \, P(\text{at least $3$ heads $\mid$ coin $2$}) P(\text{coin $2$}) \end{align}

• Buy why does coin $1$ and coin $2$ satisfy a partition? Doesn't the event coin $1 =$ the event coin $2$ since they are both the set of all combinations of $5$ flips of their respective coin? $P(A | B)P(B) = P(A \cap B)$ where $A$ is "at least..." and $B$ is coin $1$. – Oliver G Sep 6 '16 at 23:32
• @OliverG: I'm not sure what you're getting at, quite. Why would the event coin $1$ (seen as an event) be equal to the event coin $2$? You never choose both coins at the same time. Choosing coin $1$ is completely disjoint from choosing coin $2$; hence, they can be used as a partition for this problem. – Brian Tung Sep 6 '16 at 23:37
• The book I'm reading defines an event as a subset of the sample space, so if coin $1$ is an event then it must be a subset of the sample space. This subset must be all combinations of coin tosses given coin $1$, which is the same as the amount of coin tosses using coin $2$. What exactly is in the events (subsets of the sample space) coin $1$ and coin $2$ that makes them a partition is what I'm confused about. coin $1$ = $\{ x,y,z, ...\}$ and coin $2 = \{w, r, t, ... \}$ such that coin $1 \cap$ coin $2 = \emptyset$ and their union is the entire space of coin tosses. – Oliver G Sep 6 '16 at 23:43
• @OliverG: I would characterize the space of events (that you're interested in) as $\{\text{choose coin$1$and toss$0$heads}, \text{choose coin$1$and toss$1$head}, \text{choose coin$1$and toss$2$heads}, \ldots, \text{choose coin$1$and toss$5$heads}, \text{choose coin$2$and toss$0$heads}, \text{choose coin$2$and toss$1$head}, \ldots, \text{choose coin$2$and toss$5$heads}\}$. This space has $12$ events, of which the first six correspond to the coin $1$ partition, and the last six correspond to the coin $2$ partition. – Brian Tung Sep 6 '16 at 23:45
• (a) Please pretend you chose Coin 1, find the prob of at least 3 Heads.(2) Do the same pretending you chose Coin 2 using the first displayed eq'n above. (3) Average the two answers [because $P(B_1) = P(B_2) = 1/2$]. // I think you may have skipped to this problem before reading the part of the text that leads up to it. Not usually a good strategy with probability problems. – BruceET Sep 6 '16 at 23:46

Here are results from simulating this experiment a million times, using R statistical software. The approximate probability for exactly three Heads from simulation should be accurate to 2 or 3 places is shown. The exact probability of exactly three Heads is given for comparison; it is based on partitioning on which coin is chosen. In R, dbinom is the binomial PDF and rbinom simulates the binomial random variable described by parameters.

You can use the same method to find the probability of at least three Heads.

 m = 10^6;  x = numeric(m)         # x is nr of H's in 5 tosses
for (i in 1:m) {
p = sample(c(1/2, 1/3), 1)      # pick which coin: 50-50 chance
x[i] = sum(rbinom(1, 5, p)) }   # simulate 5 tosses with that coin
mean(x == 3)
## 0.238784                       # aprx P(X = 3) from simulation
(dbinom(3, 5, 1/2) + dbinom(3, 5, 1/3))/2
## 0.2385545                      # exact P(X = 3)


This problem illustrates the 'Law of Total Probability' in a form often used to prove 'Bayes' Theorem'.

The plot below shows the probabilities of the required mixture distribution (heavy purple bars), along with the binomial distributions from tossing each of the two coins (thin red and blue lines adjacent). • I'm unfamiliar with R statistical software, but you're saying partitioning the total set of outcomes into which coin is chosen? How exactly does this apply as a partition? Since $P(A_3 | C_1)P(C_1)$ ($C_1$ is coin 1) $= P(A_3 \cap C_1) = \frac{|A_3 \cap C_1|}{|S|}$ where $S$ is the set of all combinations of $6$ coin tosses and $C_1$ is the set of all coin tosses as well? Wouldn't this just reduce to $\frac{|A_3|}{|S|}$? – Oliver G Sep 6 '16 at 23:02
• In your notation from the Problem: $P(3|B_1)$ is based on $Binom(5, 1/2),$ where $B_1$ is the event that the first coin is selected; $P(B_1) = 1/2.$ My purpose is to show you how to solve the problem, not to give you a numerical answer. (I have no idea what $C_1$ stands for.) See @BrianTung's Answer (+1) for a mathematical formula. – BruceET Sep 6 '16 at 23:21
• The binomial distribution with $n = 5$ tosses and $P(H) = 1.2$ on each toss. You are using either Coin 1 ($B_1$) or Coin 2 ($B_2 = B_1^c$). The partition consists of two events $B_1$ and $B_2.$ Look carefully at the definition of 'partition'. // Another run of the program ending with mean(x >= 3) gives about 0.35 or 0.36. – BruceET Sep 6 '16 at 23:34
• @BruceET : yes, I got $0.3549$ by a script computation ( not a simulation ) – user354674 Sep 7 '16 at 0:48
• It is $0.35\dot{\overline{493827160}}$ to be precise. – Graham Kemp Sep 7 '16 at 4:53

The book I'm reading defines an event as a subset of the sample space, so if coin $1$ is an event then it must be a subset of the sample space. This subset must be all combinations of coin tosses given coin $1$, which is the same as the amount of coin tosses using coin $2$. What exactly is in the events (subsets of the sample space) coin $1$ and coin $2$ that makes them a partition is what I'm confused about. coin $1 = {x,y,z,...}$ and coin $2={w,r,t,...}$ such that coin $1 ∩$ coin $2=∅$ and their union is the entire space of coin tosses.

An appropriate sample space to describe this system is $\{\tfrac 1 2,\tfrac 1 3\}{\times}\{{\rm T,H}\}^5$, that is the Cartesian product of outcomes for selecting a coin (denoted by its bias), and tossing that coin five times.   Your random variable is the count of heads obtained.   Let us call it $X$.

$X=0$ denotes the event of $\rm \{(\tfrac 12, T,T,T,T,T),(\tfrac 13, T, T, T, T, T)\}$ .   That is the outcome of selecting the unbiased coin and then tossing five tails, or of selecting the biased coin and then tossing five tails.   And so forth.   The probability of this event is calculated as: $$\mathsf P(X=0)~=~ \tfrac 12(\tfrac 12)^5+\tfrac 12(\tfrac 23)^5$$

As you can see, we can partition the space as $\{\tfrac 12\}{\times}\{{\rm T,H}\}^5~\cup~\{\tfrac 13\}{\times}\{{\rm T,H}\}^5$, that is on the event of selecting which coin.   Let $Y$ be the bias of the coin.

$Y=\tfrac 12$ describes the event $\rm \{(\tfrac 12, T, T, T, T, T), (\tfrac 12, T, T, T, T, H), \ldots, (\tfrac 12, H, H, H, H, H)\}$, etcetera.   Thirty two outcomes of various probabilities. $\mathsf P(Y=\tfrac 12)=\tfrac 12=\mathsf P(Y=\tfrac 13)$ because selecting the coin itself is made without bias.

That's the meat.   The crunch of it is that:

\begin{align}\mathsf P(X\geq 3) ~=~& \mathsf P(Y=\tfrac 12\cap X\geq 3)+\mathsf P(Y=\tfrac 13\cap X\geq 3) \\[1ex] =~& \tfrac 12 \Big(\sum_{x=3}^5 \binom 5 x (\tfrac 12)^x(\tfrac 12)^{5-x}\Big)+\tfrac 12\Big(\sum_{x=3}^5 \binom 5 x (\tfrac 13)^x(\tfrac 23)^{5-x}\Big) \\[1ex] =~& \tfrac 14+\tfrac 1 2 \Big(\binom 5 3\tfrac{2^2}{3^5}+ \binom 5 4\tfrac{2}{3^5}+\binom 5 5\tfrac 1{3^5} \Big) \\[1ex] =~& \tfrac 14+\tfrac{40+10+1}{2\cdot 3^5} \\[1ex] =~& \tfrac {115}{324} \\[1ex] =~& 0.35\dot{\overline{493827160}} \end{align}

• This Answ best at basic level. But consider similar problem: 50-50 choice btw 2 devices, exponential times to failure averaging 3 and 5 days, respectively. What is probability chosen device survives at least 3.5 days? Impossible to list (even a little messy to specify) sample space, but my methods and @BrianTung's still valid. – BruceET Sep 7 '16 at 15:37