4.4 Random Variables, Density Functions

Dice And Coin Game


A fair die is tossed and its outcome is denoted by \(X\). After that, we toss an independent fair coin \(X\) times and count the number of heads. Let \(Y\) denote the number of heads. Please answer as a fraciton in the form of x/y.

  1. What is \(\Pr[Y=4]\)?

    Exercise 1

    Conditioning on \(X = k\) for \(k = 1, \ldots, 6\), \(Y\) has a binomial distribution with parameters \((k, \frac{1}{2})\). By the Law of Total Probability, \(\Pr[Y=4]=\sum_{k=1}^6\Pr[Y=4|X=k]\Pr[X=k]=\frac{1}{6}\left(\frac{1}{2^4}+\binom{5}{4}\frac{1}{2^5}+\binom{6}{4}\frac{1}{2^6}\right)=\frac{29}{384}\).

  2. What is \(\Pr[X=5\;|\;Y=4]\)?

    Exercise 2

    By Bayes Rule, \(\Pr[X=5\;|\;Y=4]=\frac{\Pr[Y=4\;|\;X=5]\Pr[X=5]}{\Pr[Y=4]}\). Since \(\Pr[Y=4\;|\;X=5]=\binom{5}{4}\frac{1}{2^5}\), it follows that \(\Pr[X=5\;|\;Y=4]=\frac{\binom{5}{4}\frac{1}{2^5}\cdot\frac{1}{6}}{\frac{29}{384}}=\frac{10}{29}\).