Bayes Theorem to find probability of getting a sum given a coin toss

bayes-theoremconditional probabilitydiceprobabilitystatistics

Suppose you flip a fair coin, and if the result is heads you will roll a pair of fair dice, and if the result is tails you will roll the biased dice. Using
Bayes’ Theorem:

  • a. derive the probability that you flipped heads given that the sum
    of pips on the dice you rolled is 12.

The probability of getting a sum of 12 is 1/36. The probability of the sum of pips equaling 7 is 6/36. Am I right to calculate it this way?
H = Getting head, S = Getting the sum of 12

  • P(H|S) = (P(S|H) P(H)) / P(H).
  • P(S|H) = P(H n S) / P(H) = (0.5 X 0.278) /0.5 = 0.0278

Am I right? I feel like I did P(S|H) wrong. Any guidance would be greatly appreciated

Best Answer

This is not correct.

Let $S_7$ denote obtaining a sum of $7$, $S_{12}$ denote obtaining a sum of $12$, and $H$ denote obtaining heads.

Note that what you have is saying that $$\mathsf P(H\mid S_{12})=\mathsf P(S_{12}\mid H)$$

Instead we have

$$\mathsf P(H\mid S_{12})=\frac{\mathsf P(H\cap S_{12})}{\mathsf P(S_{12})}=\frac{\mathsf P(S_{12}\mid H)\cdot \mathsf P(H)}{\mathsf P(S_{12})}$$

Hence we have

$$\begin{align*} \mathsf P(H\mid S_{12}) &=\frac{\mathsf P(S_{12}\mid H)\cdot \mathsf P(H)}{\mathsf P(S_{12})}\\\\ &=\frac{\frac{1}{2}\cdot\left(\frac{1}{6}\right)^2}{\frac{1}{2}\left(0.05^2+\left(\frac{1}{6}\right)^2\right)}\\\\ &\approx 0.917 \end{align*}$$

and similarly for finding $\mathsf P(H\mid S_7)$