# How to calculate expected value for piecewise constant distribution function?

The distribution function of a discrete random variable X is given

$F_X(x)=\begin{cases} 0, &x<1\\ \frac{5}{13},& 1\leq x< 2 \\ \frac{10}{13}, & 2\leq x<3 \\ \frac{11}{13}, & 3\leq x<4 \\ 1, & 4\leq x \end{cases}$

$A=(X=2)\cup (X=4)$

Calculate: $P(A)$ and $E(X)$

I was thinking to solve $P(A)$ with formula: $P(a)=\begin{pmatrix} n \\ a \end{pmatrix} p^a (1-p)^{n-a}$, but I dont $p$ and $n$. Which formula I should use?

• Can you not try to apply random formulas and just find the values this variable takes and corresponding probabilities (and then use some general formula)? Commented Dec 25, 2016 at 18:35
• Is $X$ a discrete or a continuous random variable? To begin, can you find $P(X=2)?$ Commented Dec 25, 2016 at 18:36

the random variable $X$ can take four values, which are exactly the points of discontinuity of $F_X$: $$\mathbb P (X=1)= \frac 5 {13}, \quad \mathbb P (X=2)=\frac {10} {13}- \frac 5 {13}, \quad \mathbb P (X=3)=\frac {11} {13} -\frac {10} {13}, \quad \mathbb P (X=4)=1- \frac {11} {13}. \quad$$ Therefore $$\mathbb P(A)=\mathbb P(X=2)+\mathbb P(X=4) = \frac 7 {13},$$ and $$\mathbb E [X]= 1 \cdot \frac {5}{13}+2 \cdot \frac {5}{13}+3 \cdot \frac {1}{13}+4 \cdot \frac {2}{13}=2.$$

Hint:

$F_X(x) = P(X \leq x)$

$(X =2 ) = (X\geq2) \cap (X>2)^c$

For a discrete random variable $X$,

$$E[X] = \sum_{i=1}^n x_i P(X=x_i)$$

Note that $P[X=t] = P[X \le t] - \lim_{x \uparrow t} P[X \le x]= F(t) - \lim_{x \uparrow t} F(x)$.

The limits are particularly straightforward to compute since $F$ is piecewise constant.