<s>[INST] Taking the PMF to find the CDF, probability. Question:We toss a fair coin three times. Let X be the number of heads minus the number of tails obtained.
Write the cumulative distribution function of X.
What I already know: I know how to get the pmf from this problem.
$$
\ P(X=x) = \left\{ 
  \begin{array}{l l}
   \ {3 \choose 0} (1/2)^3 & \quad \text{for $k = -3$}\\
   {3 \choose 1} (1/2)^3 & \quad \text{for $k = -1$}\\
   {3 \choose 2} (1/2)^3 & \quad \text{for $k = 1$}\\
   {3 \choose 3} (1/2)^3 & \quad \text{for $k = 3$}\\
  \end{array} \right.
$$
I'm not sure how my professor got this cdf:
$$
\ P(X \le x) = \left\{ 
  \begin{array}{l l}
   \ 0 & \quad \text{for $x \lt -3$}\\
   (1/2)^3 & \quad \text{for $-3 \le x \lt -1$}\\
   (1+3) (1/2)^3 & \quad \text{for $-1 \le x \lt 1$}\\
   (1+3+3) (1/2)^3 & \quad \text{for $1 \le x \lt 3$}\\
   (1+3+3+1)(1/2)^3 & \quad \text{for $3 \le x$}\\
  \end{array} \right.
$$
 [/INST] The c.d.f. is not $x\mapsto \Pr(X=x)$; it is $x\mapsto\Pr(X\le x)$.  So, for example, its value at $x=2$ is $\Pr(X\le 2) = \Pr(X=-3) + \Pr(X=-1) + \Pr(X=1)$.
</s>