Conditional probability selecting a number and flipping a fair coin.

One of the numbers 1, 2 or 3 is selected at random. Then a fair coin is flipped that number of times. What is the probability that the number 3 was selected given:

• no heads on the coin flip(s)

I know for three heads, the probability is of course $1$ or $100\%$ but I can't wrap my head around finding it for the other 3 conditions.

• Just define some random varibles X,Y for the number out of $\{1,2,3\}$selected and the number of heads in X coin flippings resp. Note that $Y\tilde Bin(X,0.5)$. Then you can use the definition of conditional probability. – peer Oct 6 '16 at 20:17

I think I solved my own problem here:

For the first case of no heads:

• There is $\frac{1}{2}$ chance to get no heads if the number picked is 1.
• There is $\frac{1}{4}$ chance to get no heads if the number picked is 2.
• There is $\frac{1}{8}$ chance to get no heads if the number picked is 3.

So we can set this up: $\frac{\frac{1}{8}}{\frac{1}{2}+\frac{1}{4}+\frac{1}{8}}=\frac{1}{7}$

For the second case of one head:

• There is $\frac{1}{2}$ chance to get 1 head if the number picked is 1.
• There is $\frac{1}{2}$ chance to get 1 head if the number picked is 2.
• There is $\frac{3}{8}$ chance to get 1 head if the number picked is 3.

So we can set this up: $\frac{\frac{3}{8}}{\frac{1}{2}+\frac{1}{2}+\frac{3}{8}}=\frac{3}{11}$

For the third case of two heads:

• There is $\frac{0}{2}$ chance to get 2 heads if the number picked is 1.
• There is $\frac{1}{4}$ chance to get 2 heads if the number picked is 2.
• There is $\frac{3}{8}$ chance to get 2 heads if the number picked is 3.

So we can set this up: $\frac{\frac{3}{8}}{\frac{0}{2}+\frac{1}{4}+\frac{3}{8}}=\frac{3}{5}$

For the last case, its clear that the probability is 1.

There 14 possibilities of tosses. Suppose you are given that there is 1 head flipped. Out of the 14 possibilities, there are only 6 that have 1 head exactly. Out of those 6, 3 come from having 3 flips. Thus the probability is 1/2. P(A|B) = $\frac{P(A \bigcap B)}{P(B)}$ = $\frac{\frac{3}{14}}{\frac{6}{14}}$ = $\frac{3}{6}$.

The rest are done similarly.