# Mean of probability distribution function.

The current chapter I am working on is continuous random variables. I know that the mean value of a continuous random variable is:

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

That being said, my question is to find $E[X]$ of the following table:

$$X |\hspace{4 mm} -3 \hspace{4 mm}|\hspace{4 mm} 6 \hspace{4 mm} |\hspace{4 mm} 9 \\ f(x) |\hspace{4 mm} 1/6 \hspace{4 mm}|\hspace{2 mm} 1/2\hspace{1 mm} | 1/3$$

I want to confirm that this is in fact a DISCRETE question simply included in my continuous problem set and thus $E[X]$ will equal the following:

$$E[X] = (-3 * 1/6) + (6 * 1/2) + (9 * 1/3) = 5.5$$

Additionally, I have solved $E[X^2]$ to equal the following:

$$E[X^2] = (-3^2 * 1/6) + (6^2 * 1/2) + (9^2 * 1/3) = 43.5$$

In summary, my concern is that this seemingly discrete variable has been placed in my continuous problem set and I would like to confirm both that conclusion and my methodology for calculating my means. Thanks to all!

-
Your second calculation is incorrect as it should read $(-3)^2$ which is $9$ and not $-9$ as your calculation suggests. Thus your answer for $E(X^2)$ is lower than the true answer. Also this is a discrete distribution since the number of outcomes is countable. I'm guessing this was thrown in the continuous distribution section of your textbook to test how you retained previous knowledge. –  Patrick Sep 19 '13 at 1:42

Yes, they snuck in a simple discrete problem. You found $E(X)$ correctly.

Please note that the calculation of $E(X^2)$ is not quite right. For the first summand you needed $(-3)^2 \cdot\dfrac{1}{6}$.

-
Thanks for catching that, it was certainly intended. $E[X^2] = 46.5$ –  Ryde91s Sep 19 '13 at 1:42

Yes, it is right. However, and just for fun, there is an alternative definition of $E[X]$:

$$\mu_X=E[X]=\int\limits_{0}^{+\infty}{1-F_x(x)dx} -\int\limits_{-\infty}^{0}{F_x(x)dx}$$

and one can prove that is equivalent to other definition (good exercise). This definition is general for any random variable, discrete or continuous or neither. All what you need is calculate $F(x)$ with $f(x)$ and all done.

-