[Math] Conditional Probability of two random variables

conditional probabilityprobability

A fair coin is tossed with the outcome mapped into $X = 1$ for a head and $X = 0$ for a tail. If it comes up heads, then a fair die is tossed. The outcome of the die is denoted by $Y$ and is set equal to the number of dots observed. If the coin comes up tails, then we set $Y = 0$. Find the conditional PMF $p_{Y|X}[i, j]$ $\forall i, j$. Next, compute $P[Y = 1]$.


Let $X$ be a discrete random variable describing the outcome of the coin toss
$$
X =
\begin{cases}
0, & \text{if tails}\\
1, & \text{if heads}
\end{cases}
$$
For a fair coin coin and that $S_X = \{0, 1\}$, the PMF of $X$ is
$$
p_X[i] =
\begin{cases}
0.5, & i = 0\\
0.5, & i = 1
\end{cases}
$$
Let $Y$ be the discrete random variable describing the outcome of either the dice is rolled or $Y = 0$. Then $S_Y = \{0,\ldots, 6\}$
$$
Y =
\begin{cases}
0, & \text{if tails}\\
\text{number observed}, & \text{if heads}
\end{cases}
$$
Then $p_{Y|X}[j, i] = P[Y|X]p_X[i] = P[Y = j\cap X = i]$.
$$
p_{Y|X}[j, i] =
\begin{cases}
\frac{1}{7}, & i, j = 0\\
\frac{1}{7}, & i = 1, j = 1, 2, \ldots, 6\\
\end{cases}
$$
Then $P[Y = 1] = p_{X, Y}[1, 1] = \frac{1}{7}$.


The book says $P[Y = 0, X = 0] = 1$ and $P[Y = j, X = 1] = 1/6$ for all $j$. This would mean the sum of the joint PMF is 2 though. Finally, it has that $P[Y = 1] = 1/12$.

Is this correct? If so, how is it obtained?

Best Answer

It is a mistake to confuse the random variables $Y|X=0$ and $Y|X=1$. They are two different "objects". Given that $X=0$ then $Y=0$ with probability $1$, thus $$p_{Y|X=0}(i|x)=\begin{cases} 1, & i=1 \\ 0, & \text{else }\end{cases}$$ On the other hand, given that $X=1$ then $Y$ is the result of a fair dice, thus $Y|X=1$ is uniformly distributed on the set $\{1,2, \ldots, 6\}$, i.e. $$p_{Y|X=1}(i|x)=\begin{cases} 1/6, & i\in\{1,2\ldots,6\} \\ 0, & \text{else }\end{cases}$$

For the last part of your question $$P(Y=1)=P(Y=1|X=0)P(X=0)+P(Y=1|X=1)P(X=1)=0\cdot\dfrac{1}{2}+\dfrac{1}{6}\cdot\frac{1}{2}=\dfrac{1}{12}$$

Note that $P(Y=1)$ refers to a calculation before the result of $X$ has become known, so you must condition on it's result. Therefore it is not the same as $P(Y=1|X=1)$.