I want to find Cumulative distribution function (CDF) of the following density function:
$ f(x)= \begin{cases} 3/20 & \text{for } 2 \leq x \leq 4 \\[8pt] 4/20 & \text{for }4 < x \leq 6 \\[8pt] 1/20 & \text{for }6 < x \leq 12 \\[8pt] 0 & otherwise \end{cases}$
I first found the corresponding areas by drawing the functions.
from CDF formula $F(X) = \frac{x-a}{b-a}$, I tried as follow:
$ F(x)= \begin{cases} 0 & \text{for }x <2 \\[8pt] \frac{x-2}{4-2} & \text{for }2 \leq x \leq 4 \\[8pt] \frac{x-4}{6-4} + 0.3 & \text{for }4 < x \leq 6 \\[8pt] \frac{x-6}{12-6} + 0.7 & \text{for }6 < x \leq 12 \\[8pt] 1 & \text{for } x > 12 \end{cases}$
I am not sure, whether it is true or not? please correct me if it is not true.