I'm trying to find a probability using cumulative distribution function and then using pdf. Why it is giving different answers?
For example,
$$F(x)=\begin{cases}0,\quad x<0\\x^2,\quad0\le x\le \frac{1}{2}\\\frac{3}{4},\quad \frac{1}{2}\le x<1\\ 1,\quad x\ge 1\end{cases}$$
Now if I calculate $P(1/4 < x < 1)$. I get $15/16$ using this distributive function.
But if I find the pdf by differentiating $F(x)$ wrt $x$, then $f(x) = 2x$ between $0$ and $1/2$ and $0$ elsewhere.
To find $P(1/4 < x < 1)$, I will integrate $f(x)$ from $1/4$ to $1$ (i.e.$1/4$ to $1/2$ because $f(x)$ is $0$) when $x > 1/2$ which is giving $3/16$.
Kindly comment if I miss something here, I'm new to this platform. Thanks.
The distribution function is discontinuous so the derivative does not exist at $x=1/2$ and $x=1$. It must be supplemented by point probabilities at those points. $P(x=1/2)=1/2$ and $P(x=1)=1/4$.