Joint Probability Mass Function/ Marginal Probability Mass Function Q. A coin is biased so that heads appears with probability 2/3 and tails with probability 1/3.
This coin is tossed three times. If X denotes the number of heads occurring and Y denotes
the number of tails that occur up to the first head, if any, that appears, then determine
i) the joint probability mass function of X and Y.
ii) marginal probability mass functions of the random variables
iii) P[X<=1| Y<=1]
What does Y " the number of tails that occur up to the first head" mean ?
I understand X= {0,1}
But I am not able to understand Y
Can someone help me in these 3 questions please
Thanks
 A: The first step is to determine what sample space we are working with. Since we have three coin flips we can have outcomes on the form $HHT$, $THH$, $TTT$, $\dots$ and so on, where $H=heads$ and $T=tails$. The total number of outcomes is $2^3 = 8$ and we can compute the probability of outcomes using independence. For instance
$$P(THT) = \frac{1}{3}\cdot\frac{2}{3} \cdot\frac{1}{3} = \frac{2}{27}$$
Now let's suppose we want to calculate the joint probability of $X=2$ and $Y=0$. The only possible ways this can happen is $HTH$ and $HHT$, so
$$P(X=2,Y=0) = P(HTH)+P(HHT) = \frac{2}{3}\cdot \frac{1}{3} \cdot \frac{2}{3} +  \frac{2}{3}\cdot \frac{2}{3} \cdot \frac{1}{3}= \frac{8}{27}$$
And you can do the same for all other possible cases. The most convenient way would be to make a table of all possibilities:
\begin{array}{l|llll}
X \quad \text{\\} \quad Y     & 0            & 1            & 2            & 3            \\ \hline
0 & \text{Not Possible} & \text{Not Possible} & \text{Not Possible} & TTT          \\
1 & HTT                 & THT                 & TTH          & \text{Not Possible} \\
2 & HHT \text{ or } HTH & THH                 & \text{Not Possible} & \text{Not Possible}\\
3 & HHH                 & \text{Not Possible} & \text{Not Possible} & \text{Not Possible}
\end{array}
Now see if you can make a similar table where you compute all the probabilities. Note that events that are not possible will of course have probability 0. 
ii)
From here you can find the marginal distribution of $X$ by summing over the rows and the marginal distribution of $Y$ by summing columns. 
iii)
The last part of the question can be computed using the definition of conditional probability:
$$P(X\leq 1 \: | \: Y\leq 1) = \frac{P(X\leq 1,Y\leq 1)}{P(Y\leq 1)}$$
A: \begin{array}{l|llll}
X \quad \text{\\} \quad Y     & 0            & 1            & 2            & 3            \\ \hline
0 & \text{Not Possible} & \text{Not Possible} & \text{Not Possible} & \text{Not Possible}          \\
1 & HTT                 & THT                 & TTH          & \text{Not Possible} \\
2 & HHT \text{ or } HTH & THH                 & \text{Not Possible} & \text{Not Possible}\\
3 & HHH                 & \text{Not Possible} & \text{Not Possible} & \text{Not Possible}
\end{array}
And 
P(X≤1|Y≤1)= P[X=0|Y=0]+P[X=0|Y=1]+P[X=1|Y=0]+P[X=1|Y=1]
