# Problem: find the cumulative distribution function (c.d.f.) of X, given its probability distribution

This question is an end-of-chapter problem from Probability & Statistics for Engineers & Scientists, 9th Edition:

Where the cumulative distribution function is defined as $F(x) = P(X \leq x)$.

Here is how I proceeded with a solution:

$P(X \leq 0) = F(0) = f(0) = 0.41$

$P(X \leq 1) = F(1) = f(0) + f(1) = 0.78$

$P(X \leq 2) = F(2) = f(0) + f(1) + f(2) = F(1) + f(2) = 0.94$

$P(X \leq 3) = F(3) = F(2) + f(3) = 0.99$

$P(X \leq 4) = F(4) = F(3) + f(4) = 1.00$

Now, the solutions to these problems are typically given in the form of a piecewise function. And here's the book's solution:

I'm having a hard time understanding how they arrived at those intervals. The chapter did give an example problem like this, but it did not explain the logic behind how they arrived at the piecewise breakdown.

If someone could please guide me through those steps, I would really appreciate the help. Thank you!

• The two expressions of $F$ describe exactly the same thing. Why not graph them both to compare?
– whuber
Jan 29 '18 at 21:14
• Sorry, what do you mean by two expressions of $F$? Mine and theirs? Jan 29 '18 at 21:20
• One thing in particular that confuses me is why $F(x) = 0$ for $x < 0$, given that $F(0) = 0.41$, meaning $P(X \leq 0) = 0.41$. Jan 29 '18 at 21:21
• What is $F(-1)$, for example, or $F(1.7)$? Apply the definition. And, once again, plot the function.
– whuber
Jan 29 '18 at 21:21
• Hmm, $F(-1) = P(X \leq -1)$. So if $P(X \leq 0)$ is $0.41$, why shouldn't $P(X \leq -1)$ be the same? Sorry, I don't quite understand. Jan 29 '18 at 21:23

You have a discrete RV $X$ that can only take five values : $0 \ 1 \ 2 \ 3 \ 4$ with respective probabilities $$P(X=0) = 0.41$$ $$P(X=1) = 0.37$$ $$P(X=2) = 0.16$$ $$P(X=3) = 0.05$$ $$P(X=4) = 0.01$$ Suppose that those values are written of the faces of a very strange dice. You throw that dice and ask yourself:

1. What is the probability of obtaining an outcome that is less than $0$? Of course this probability is $0$ because throwing the dice can never give that result (remember the outcome can only be one among $0 \ 1 \ 2 \ 3 \ 4$) . Hence $P(X<0) = 0$. And what does that mean? It means that whenever you throw in your $P(X<x)$ a value $x < 0$ you get that the resulting probability is $0$. For instance $P(X<-0.5) = 0$ or $P(X<-2) = 0$ and so on. Hence the first part of the step-wise function is:

$$P(X \le x) = F(x) = 0 \ for \ x< 0$$

1. Think always of the dice. What is the probability of obtaining an outcome that is $\le 0$, i.e. $P(X \le 0)$? Since you can never get something $<0$ then this probability is the same as the probability of obtaining exactly $0$, hence $P(X \le 0) = P(X = 0) = 0.41$. And what about $P(X = 0.2)$? When you throw your dice could you ever get $0.2$ as an outcome? I think you know you can't. And if I tell you $P(X = 0.5)$ or $P(X = 0.8)$ ... same story. So $P(X \le 0.8)$ is the same as $P(X \le 0) = 0.41$ and this is true up until $1$. Hence the second part of your step function is: $$P(X \le x) = F(x) = 0.41 \ for \ 0\le x< 1$$

I could go on until $4$ but I think you got it.

• Why is this a discrete case, though? Jan 30 '18 at 12:36
• It is discrete because you X can assume only a countable number of values. This is the definition of discrete RV. Jan 30 '18 at 14:46
• Just re-read your problem, and it makes perfect sense now. This is only true for the discrete case, I assume? Since we otherwise could not draw any conclusions as to the probabilities of P(X <= 0.5), for instance. Jan 30 '18 at 20:40