[Math] Find the joint PMF of X and Y, are they independent

binomial distributiondiceindependenceprobabilityprobability distributions

A fair die is rolled, and then a coin with probability $p$ of Heads is flipped as many times as the die roll says, e.g., if the result of the die roll is a 3, then the coin is flipped 3 times. Let $X$ be the result of the die roll and $Y$ be the number of times the coin lands Heads.

Find the joint PMF of $X$ and $Y$. Are they independent?

My issue is with finding the joint PMF. I started by finding the supports of both variables. The support of X is {1,2,3,4,5,6} and the support of Y is {0,1,2,3,4,5,6}. Since the value of the roll dictates how many heads can be flipped, the joint support is of size 27. I am trying to construct a table of all the different probabilities but I can't seem to figure out what the specific probabilities are. Once I find the joint PMF and marginals I can figure out if the variables are independent or not.

Here is my work so far…

$$\begin{array}{c|c|c|c|c|c|c|}
& \text{1} & \text{2} & \text{3} & \text{4} & \text{5} & \text{6} & f_Y(y) \\ \hline
\text{0} & p & p & p & p & p & p & 6p \\ \hline
\text{1} & p & p & p & p & p & p & 6p \\ \hline
\text{2} & 0 & p & p & p & p & p & 5p \\ \hline
\text{3} & 0 & 0 & p & p & p & p & 4p \\ \hline
\text{4} & 0 & 0 & 0 & p & p & p & 3p \\ \hline
\text{5} & 0 & 0 & 0 & 0 & p & p & 2p \\ \hline
\text{6} & 0 & 0 & 0 & 0 & 0 & p & 1p \\ \hline
f_X(x) & 0 & 0 & 0 & 0 & 0 & p & 1p \\ \hline
\end{array}$$

Best Answer

$\newcommand{\rchi}{\raise{0.5ex}\chi}$ You have been given (effectively) that: $X\sim \mathcal U\{1,2,3,4,5,6\}$ and $Y\mid X\sim \mathcal{Bin}(X, p)$.

That is that $X$ is discrete uniformly distributed (the roll of an unbiased die), and $Y$ when conditioned on $X$ is binomially distributed (the count of successes in $X$ iid Bernoulli events).

So you know the marginal pmf of $X$ is $\mathsf P_X(k) = \frac 1 6 \;\rchi_{k\in\{1;6\}}$ and the conditional pmf of $Y$ is $\mathsf P_{Y\mid X}(h\mid k) = \binom{k}{h} p^h(1-p)^{k-h} \;\rchi_{h\in\{0;k\}} $

From this you can determine the joint pmf of $X,Y$, and from that the marginal pmf of $Y$.


$$\begin{array}{|c|c:c:c:c:c|c|} \hline & \text{1} & \text{2} & \text{3} & \text{4} & \text{5} & \text{6} & f_Y(y) \\ \hline \text{0} & (1-p)/6 & (1-p)^2/6 & (1-p)^3/6 & (1-p)^4/6 & (1-p)^5/6 & (1-p)^6/6 & \tfrac 1 6 \sum\limits_{k=1}^6 (1-p)^k \\ \hdashline \text{1} & p/6 & p(1-p)/3 & & & & & \\ \hdashline \text{2} & 0 & p^2/6 & & & & & \\ \hdashline \text{3} & 0 & 0 & & & & & \\ \hdashline \text{4} & 0 & 0 & 0 & & & & \\ \hdashline \text{5} & 0 & 0 & 0 & 0 & & & \\ \hdashline \text{6} & 0 & 0 & 0 & 0 & 0 & & \\ \hline f_X(x) & 1/6 & 1/6 & 1/6 & 1/6 & 1/6 & 1/6 & 1 \\ \hline \end{array}$$

Related Question