If I was given a probability density function:

$$f(y) = \left\{\begin{array}{ll}\frac{3y^2(4-y)}{64} & \textrm{for } 0 \leq y \leq 4\\ 0 & \textrm{elsewhere} \end{array}\right.$$

for expected value would that just be the following integral? $$\int_{0}^{4} yf(y)\,\textrm{d}y$$

I do not know how I would calculate the variance though. Any tips?


  • 1
    $\begingroup$ Yes, that is fine for the expected value. Then find the expected value of $Y^2$ in similar fashion. Use the two expectations to get the variance. $\endgroup$ – soakley Mar 10 '14 at 16:52
  • $\begingroup$ @soakley would I have to change the y every time? so I would that formula 4 times because I have 1,2,3,4? $\endgroup$ – user125627 Mar 10 '14 at 16:54
  • $\begingroup$ @user125627 You are evaluating a definite integral, so the probability distribution is continuous, not discrete (i.e. values can be 1.5, 2.78 etc) $\endgroup$ – user130512 Mar 10 '14 at 16:59
  • $\begingroup$ @user130512 I am getting a little confusing because shouldn't the expected value be the sum of all the values, but wouldn't that mean I will have to change y multiple times? $\endgroup$ – user125627 Mar 10 '14 at 17:01
  • $\begingroup$ The summation formula is only used for discrete random variables. You need to use integration. Look at the given answer. $\endgroup$ – soakley Mar 10 '14 at 17:02

For the expected value, you need to evaluate the integral $$\int_0^4 yf(y) dy =\int_0^4 {3y^3(4-y) \over 64} dy $$

| cite | improve this answer | |

You can either find the variance directly by applying the law of the unconscious statistician with $g(y)=(y-{\rm E}[Y])^2$, that is, $$ \mathrm{Var}(Y)={\rm E}[(Y-{\rm E}[Y])^2]=\int_0^4g(y)f(y)\,\mathrm dy, $$ or you could find ${\rm E}[Y^2]$ by the same formula with $g(y)=y^2$ and then use that $$ \mathrm{Var}(Y)={\rm E}[Y^2]-{\rm E}[Y]^2. $$

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.