If a coin comes up heads, it is tossed exactly two more times. Find $f_Z$ where $Z$ is the number of heads minus the number of tails. There are three questions for this problem. 

Please help me explain the answer for number 3.



*

*Find $f_X$ where $X$ is the total number of heads. 
 Yep I got this. Ans:
\begin{align}f_X (0)&=P(X =0)=P(T)=\frac12\\
f_X(1)&=P(X =1)=P(HTT)=\frac18 \\f_X (2)&=P(X =2)=P(HHT)+P(HTH)=\frac14\\ f_X (3)&=P(X=3)=P(HHH)=1/8\end{align}

*Find $f_Y$ where $Y$ is the total number of tails.
 Yep I got this. Ans:
\begin{align}f_Y (0)&=P(Y =0)=P(HHH)=\frac18\\
f_Y (1)&=P(Y =1)=P(T)+P(HHT)+P(HTH)=\frac68=\frac34 \\
f_Y (2)&=P(Y =2)=P(HTT)=\frac18 \end{align}

*Find $f_Z$ where $Z$ is the number of heads minus the number of tails.
 I got the answer for this one but don't fully get it. Could anyone please help me explain. Thank you. Ans: 
\begin{align}f_Z(−1)&=P(Z =−1)=P(T)+P(HTT)=\frac58\\ 
f_Z(1)&=P(Z =1)=P(HHT)+P(HTH)=\frac28=\frac14\\ 
f_Z(3)&=P(Z =3)=P(HHH)=\frac18\end{align}
 A: The sample space $Ω$ or in other words the set of possible outcomes of this experiment is $$Ω=\{T, HTT, HTH, HHT, HHH\}$$ and the probabilities of these elementary events are 


*

*$P(T)=\dfrac12$

*$P(HTT)=P(HTH)=P(HHT)=P(HHH)=\dfrac{\frac12}{4}=\dfrac18$


which of course sum up to $1$ as they should. Concerning now question 3 specifically: The random variable $Z$ takes following values $Z\in\{-1,1,3\}$. Take each elementary event separately:


*

*If $T$ occurs, then $Z=$Heads$-$Tails$=0-1=-1$.

*If $HTT$ occurs, then $Z=$Heads$-$Tails$=1-2=-1$.

*If $HTH$ occurs, then $Z=$Heads$-$Tails$=2-1=1$.

*If $HHT$ occurs, then $Z=$Heads$-$Tails$=2-1=1$.

*If $HHH$ occurs, then $Z=$Heads$-$Tails$=3-0=0$.


So, $P(Z=-1)=P(T)+P(HTT)=\frac12+\frac18=\frac58$ as you have it. And the rest similarly.
A: I drew a picture.

Recal, that the process ends if we get a tail on the first try, or we flip twice if we get a head.
Notice that the only possible values of $Z$ are $\{-1, 1, 3\}$.
So we can compute these by following the branches;
\begin{align*}
P(Z = 1)  &=P(HHT\cup HTH) \\
&= P(HHT)+P(HTH) \\
&= \left(\frac{1}{2}\right)^3+\left(\frac{1}{2}\right)^3 \\
&= \frac 18+\frac 18= \frac{1}{4}
\end{align*}
where the second equality is true since the events are disjoint.
Similarly,
$$P(Z = -1) = P(T)+P(HTT) = \frac{1}{2}+\left(\frac{1}{2}\right)^3 = \frac{5}{8}$$
and
$$P(Z = 3) = P(HHH) = \left(\frac12\right)^3 = \frac{1}{8}.$$
A: You’ve already worked out that the possible outcomes are $T$ (with probability $\frac12$), and $HTT,HTH,HHT$, and $HHH$, each with probability $\frac18$. Which outcomes give you which values of $Z$? Here’s a table:
$$\begin{array}{c|c}
\text{Outcome(s)}&Z&\text{Probability}&\text{Total prob.}\\ \hline
T&0-1=-1&\frac12&\frac12+\frac18=\\
HTT&1-2=-1&\frac18&\color{red}{\frac58}\\ \hline
HTH&2-1=1&\frac18&\frac18+\frac18=\\
HHT&2-1=1&\frac18&\color{red}{\frac14}\\ \hline
HHH&3-0=3&\frac18&\color{red}{\frac18}
\end{array}$$
The first two rows show the outcomes resulting in $Z=-1$; their total probability if $\frac12+\frac18=\frac58$. The rest of the calculation is similar.
