# Finding the probability of a random variable from its cumulative distribution function

How would I go about finding the probability of a random variable based on its piece-wise CDF?

For example, I'm trying to find $P(X > 0.5)$ and $P(0.2 < X < 0.8)$ of

$$F_X(x) = \begin{cases} 0 & x \leq 0 \\ x^3 & 0 \leq x \leq 1 \\ 1 & x \geq 1 \end{cases}$$

-
In general F(x)=P(X<=x). To use this for piecewise defined F one has to distinguish between < and > versus <= or >=. But since your F is continuous you can just subtract values of F at endpoints. In the noncontinuous case one often needs limits from left or right at an endpoint of an event. –  coffeemath Oct 17 '12 at 22:51

In general $F_{X}(x)=P(X \le x)$ and one uses this fact to compute probabilities of intervals. In the case of an interval $x>c$ we can use the fact that $P(X>c)=1-P(X \le c)$, which is $1-F(c)$ by definition. (I dropped the subscript $X$ on the function F.)

Also in general to find $P(a<X<b)$ one applies the formula $F(b-)-F(a).$ The extra tag of $-$ after the $b$ indicate limit from the left. The left limit at $b$ is necessary only if $F$ is discontinuous at $b$.

There are plenty of other possible forms of intervals, all treated in a similar way. But if you notice that your cumulative is continuous, as in your example, you can safely just plug in endpoints and subtract.

-

Hints:

1. $P(X \le 0.5) = F_X(0.5) =0.5^3$ so $P(X \gt 0.5)=?$

2. $P(X \le 0.2) = F_X(0.2) =0.2^3$ and $P(X \le 0.8) = F_X(0.8) =0.8^3$ so $P(0.2 \lt X \le 0.8) = ?$

3. And $P(X=0.8)=0$ since $F_X(x)$ is continuous so $P(0.2 \lt X \lt 0.8) = ?$

-

There is one other way of doing it, if you notice that pdf of X if $$f(x)=F'(x)= \Bigg\{ \begin{array}{rl} 0& if \ x<0, x>1\\ 3 x^2& if \ 0<x<1 \end{array}$$ Therefore

1)$P(X>0.5)=\int_{0.5}^{1}3x^2 dx=\frac{7}{8}$

2)$P(0.2<x<0.8)=\int_{0.2}^{0.8}3x^2 dx=0.504$

-
Surely this is overkill since you take the derivative of $F(x)$ and then integrate right back to get numerical values? –  Dilip Sarwate Oct 18 '12 at 2:39