How to determine the distribution function of X and draw its graph? There is a question of statistics I am facing and I solved the first part, but the second part wants to determine the distribution function of X and draw its graph. What the function would be?
In a small hotel, there are three rooms: one of them is a first-class apartment and the two other are second-class apartments. The probability that the first-class apartment is booked is 30%. The probability that any second-class apartment is booked is 80%. Random variable X represents the number of booked rooms.
determine the distribution function of X and draw its graph
 A: Hint
$X$ can only take $4$ values: either $0$, $1$, $2$ or $3$ rooms are booked.
You need to find $p(X=i)$ for $i \in \{0, \dots, 3\}$.
Let's compute some values, you'll do the other ones.
$p(X=0)$: none of the room is booked!
Probability that 1st class is not booked: $1-0.3 = 0.7$.
Probability that none of 2nd class rooms are booked: $(1-0.8)^2 =0.04$.
Therefore $P(X=0) = 0.7 \times 0.04 = 0.028$.
$P(X=1)$: either the 1st class room is booked and none of the 2nd class one. Or one of the 2nd class only.
$P(X=1) = .3 \times (1 - 0.8)^2 + 2 \times (1-0.7) \times 0.8=0.492$
You need to find $P(X=2)$ and P$(X=3)$!
A: This is a discrete probability distribution. If you have calculated the probabilities of $0,1,2$ and $3$ booked rooms, you can easily make the graph of the distribution function $F$ by noting that $F(x)=P(X\le x)$. 
So for $x<0,F(x)=P(X\le x)=0$ since $X$ doesn't take negative values. 
$F(0)=P(X\le0)=P(X<0)+P(X=0)=0+p_0$. Also for $0<x<1,F(x)=p_0$ since all points less than $x$ except $x=0$ have $0$ probability. 
When $1\le x<2,F(x)=P(X\le x)=P(X=0)+P(X=1)=p_0+p_1$. Similarly find $F$ in $[2,3),[3,\infty)$. You should get$$F(x)=\begin{cases}0,&x<0\\p_0,&x\in[0,1)\\p_0+p_1,&x\in[1,2)\\p_0+p_1+p_2,&x\in[2,3)\\1,&x\ge3\end{cases}$$
since $p_0+p_1+p_2+p_3=1$. Essentially the value of $F$ jumps only at the discrete points of non-zero probability.
