# Finding CDF, standard deviation and expected balue of a random variable

Let the function $$f(x) = \begin{cases} ax^2 & \text{for } x\in [ 0, 1], \\0 & \text{for } x\notin [0,1].\end{cases}$$ Find $a$, such that the function can describe a probability density function. Calculate the expected value, standard deviation and CDF of a random variable X of such distribution.

So thanks to the community, I now can solve the former part of such excercises, in this case by $\int_0^1 ax^2 \, dx = \left.\frac{ax^3}{3}\right|_0^1 = \frac a 3$ so that the function I'm looking for is $f(x)=3x^2$. Still, I'm struggling with finding the descriptive properties of this. Again, it's not specifically about this problem - I'm trying to learn to solve such class of problems so the whole former part may be different and we may end up with different function to work with.

So as for the standard deviation, I believe I should find a mean value $m$ and then a definite integral (at least that's what the notes suggest?) so that I end up with $$\int_{- \infty}^\infty (x-m) \cdot 3x^2 \,\mathrm{d}x$$

As for the CDF and expected value, I'm clueless though. In the example I have in the notes, the function was $\frac{3}{2}x^2$ and for the expected value there is simply some $E(X)=n\cdot m = 0$ written while the CDF here is put as $D^2 X = n \cdot 0.6 = 6 \leftrightarrow D(X) = \sqrt{6}$ and I can't make head or tail from this. Could you please help?

-
No, to find the standard deviation, you need to first compute the variance $\mathrm{Var}(X) = \mathrm{E}(X^2) - (\mathrm{E}(X))^2$. Then, take the square root of the variance to obtain the standard deviation. – NasuSama Jan 12 '14 at 19:08

Expected Value

In general, the expected value is determined by this following expression

$$\mathrm{E}(X) = \int_{-\infty}^{\infty} xf(x)\,dx$$

where $f(x)$ is the probability density function. For your problem, the expected value is

\begin{aligned} \mathrm{E}(X) &= \int_0^1 x\cdot 3x^2\,dx\\ &= \int_0^1 3x^3\,dx\\ &= \left.\dfrac{3}{4}x^4\right\vert_{x = 0}^{x = 1}\\ &= \dfrac{3}{4} \end{aligned}

Variance

Recall that the variance is

$$\mathrm{Var}(X) = \mathrm{E}(X^2) - (\mathrm{E}(X))^2$$

We already know $\mathrm{E}(X)$. We then need to compute $\mathrm{E}(X^2)$, which is

\begin{aligned} \mathrm{E}(X^2) &= \int_0^1 x^2\cdot 3x^2\,dx\\ &= \int_0^1 3x^4\,dx\\ &= \left.\dfrac{3}{5}x^5\right\vert_{x = 0}^1\\ &= \dfrac{3}{5} \end{aligned}

So

$$\mathrm{Var}(X) = \dfrac{3}{5} - \left(\dfrac{3}{4} \right)^2 = \dfrac{3}{80}$$

Standard Deviation

Thus, the standard deviation is

$$\sigma = \sqrt{\mathrm{Var}(X)} = \sqrt{\dfrac{3}{80}}$$

-
That's a great answer, thanks a lot! – Straightfw Jan 12 '14 at 20:14

First notice the PDF is $3x^2$ only in the interval [0,1] it is zero outside. To get the CDF you just have to use $F(x)=\int_{-\infty}^{x}f(z)dz$ and for the expected value: $E[X]=\int_{-\infty}^{+\infty}z\cdot f(z)dz$.

-
Thank you. What does the z stand for in your answer, though? – Straightfw Jan 12 '14 at 19:22
the variable of integration, it could be any letter. – Sergio Parreiras Jan 12 '14 at 19:37
Oh, I see, thought it had some specific meaning here, thank you. So to find the CDF, I just do $F(x)=\int_{0}^{x} 3x^2 dx = x^3$ and that's it or should I do some further calculations on it? – Straightfw Jan 12 '14 at 19:52
@Straightfw $F(x)$ does not equal $x^3$ for all $x$; you will obtain different "formulas" for $F(x)$ depending on whether $x < 0$, $x> 1$, or $0\leq x \leq 1$. – Dilip Sarwate Jan 12 '14 at 20:29
@Straightfw : As Dilip pointed, it is $x^3$ only for $x$ in $[0,1]$. Also you can not use $x$ for the limit of integration and also for the variable of integration, it does not make sense. It should be $F(x)=\int_0^x 3z^2 dz = z^3\left.\right|_{z=0}^{x}=x^3-0^3=x^3$ for $x$ in $[0,1]$. – Sergio Parreiras Jan 12 '14 at 22:53