Find the joint PMF of X and Y, are they independent? 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}$$

We use Baym's rule $$P(X=x, Y=y) = P(Y=y| X=x) \cdot P(X=x)$$
Since $P(X=x) = \frac{1}{6}$ and $Y\sim Bin(x, p)$ we obtain
$$P(X=x, Y=y) = \frac{1}{6}\; \binom{x}{y} p^y (1-p)^{x-y} $$
The two random variables $X$ and $Y$ are not (!) independent, because if $y=6$ we know that $x=6$.
