1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Expectation of a random variable

  1. Jun 28, 2011 #1
    1. The problem statement, all variables and given/known data

    I'm wondering how I go about calculating the expectation of a random variable?
    Is it a different process for a discrete and a continuous?

    Can you show me an example? Say Poisson and expoential?

    Also, in the formula
    Var(X) = E[X^2] - (E[X])^2

    how does one calculate E[X^2] ?

  2. jcsd
  3. Jun 29, 2011 #2

    I like Serena

    User Avatar
    Homework Helper

    Hi Maybe_Memorie! :smile:

    To calculate an expectation you need to multiply the chance of each outcome with the value of each outcome and add everything up.

    The difference between discrete and continuous is that the first uses a summation while the second uses an integral.

    [tex]E[X] = \sum P(x) \cdot x[/tex]
    [tex]E[X^2] = \sum P(x) \cdot x^2[/tex]

    So for a six sided dice you would get:
    [tex]E[X] = \sum_{k=1}^6 P(k) \cdot k = \frac 1 6 \cdot 1 + \frac 1 6 \cdot 2 + \frac 1 6 \cdot 3 + \frac 1 6 \cdot 4 + \frac 1 6 \cdot 5 + \frac 1 6 \cdot 6 = 3 \frac 1 2[/tex]
  4. Jul 2, 2011 #3

    I like Serena

    User Avatar
    Homework Helper

    I see you didn't respond.

    Do you already know what you wanted to know?
    Is perhaps the strange wiggly symbol (sigma) putting you off?
    Or is there something else that you don't understand but don't want to ask about?
  5. Jul 3, 2011 #4
    I think I understand.

    Suppose I wanted the expectation of the exponential random variable.

    f(x) = the probability density function.

    A = lambda

    E[X] = integral of xf(x) dx

    E[X] = integral of (xAe^(-Ax)) dx between + and - infinity.

    Do I have to use integration by parts? In none of my classes have I come across integration with infinity as a limit
    Last edited: Jul 3, 2011
  6. Jul 3, 2011 #5

    I like Serena

    User Avatar
    Homework Helper

    Ah, there you are! :)

    You certainly seem to understand.
    Your boundaries are slightly off though.
    The exponential distribution only has non-zero values for positive x, so the bottom boundary should be zero (and not - infinity).

    And yes, you have to use integration by parts.
    So you are already aware of that. Good.

    As for infinity as a boundary, you have not come across it ... yet!
    It means you have to integrate to an arbitrary boundary, and then take the limit of that boundary to infinity.

    So in your case, you'll get:
    E[X] &=& \int_0^{\infty} \lambda e^{-\lambda x} \cdot x dx \\
    &=& \left[ - e^{-\lambda x} \cdot x \right]_0^{\infty}
    - \int_0^{\infty} - e^{-\lambda x} \cdot 1 dx \\
    &=& (\lim_{x \to \infty} - e^{-\lambda x} \cdot x) - (- e^{-\lambda \cdot 0} \cdot 0)
    - \int_0^{\infty} - e^{-\lambda x} \cdot 1 dx \\
    &=& 0 - 0 - \int_0^{\infty} - e^{-\lambda x} \cdot 1 dx \\
    &=& ... \\
    &=& \frac 1 {\lambda}
  7. Jul 3, 2011 #6
    Ah! Thank you very much!

    I have another question. A related application.

    The system S is composed of two components, C1 and C2, in parallel (S works provided at least 1 of the components works). The two components have lifetimes T1 and T2 and are exponentially distributed with the same parameter A=0.01

    (i) What is the probability that T1 is greater than 100?
    P(x>100) = 1 - e^(-100(0.01))

    (ii) What is the probability that Ts, the lifetime of the system, is greater than 100?
    Do I just add the probabilities that T1 and T2 are greater than 100?

    (iii) What is the probability density function of Ts?
    I'm lost here

    (iv) Derive the expectation of Ts.
    When I find the PDF, multiply by x and integrate between 0 and infinity with respect to x.
  8. Jul 3, 2011 #7

    I like Serena

    User Avatar
    Homework Helper

    You're welcome! :smile:

    You have calculated P(x<100)....

    Do you know the rule about the probability of independent events occurring simultaneously?
    That is P(A and B) where events A and B are independent?

    For that you first need to answer (ii), which would show what the cumulative probability function of Ts is.

    Yep! :)
    (But perhaps it will turn out to be easier. :wink:)
  9. Jul 3, 2011 #8
    Isn't it P(A and B) = P(A).P(B) ?
  10. Jul 3, 2011 #9

    I like Serena

    User Avatar
    Homework Helper

    Yes! So you should not add up the probabilities for T1 and T2, but multiply them! :smile:
  11. Jul 3, 2011 #10

    I still need to find the PDF.

    Is it the same as multiplying the PDF of T1 and T2?
  12. Jul 3, 2011 #11

    I like Serena

    User Avatar
    Homework Helper

    No, to find the PDF you need to find the CDF first, and deduce from that the PDF.

    Actually, the PDF is the derivative of the CDF.

    For reference did you properly solve (i) and (ii)?
    Because you need them, and you'd be making it easier for me if I know that you got those and understood those.
  13. Jul 3, 2011 #12
    For (i), the probability is 1/e, whatever that works out at...

    For (ii), I'm slightly confused. The system doesn't need T1 and T2 to be greater than 100 for Ts to be > 100. It needs only one of them to be greater than 100.
    So I'm not sure why I'm using P(A and B)
  14. Jul 3, 2011 #13

    I like Serena

    User Avatar
    Homework Helper

    Good! :smile:
    And more in general: [itex]P(X > x) = e^{-\lambda x}[/tex]

    Yes, only one needs to be greater than 100.
    But this means there are 3 cases that overlap: either T1 can be greater than 100, or T2 can be greater than 100, or both can be greater than 100.
    I guess I was a little sloppy with this before.

    A little sharper is, that they cannot both be less than 100.

    Do you know how to calculate the corresponding probability?
  15. Jul 3, 2011 #14
    Is it P(A) + P(B) + P(A and B)
    where A = T1 > 100
    B = T2 > 100
  16. Jul 3, 2011 #15

    I like Serena

    User Avatar
    Homework Helper

    Almost. ;)
    The proper formula is (sum rule): P(A or B) = P(A) + P(B) - P(A and B)
  17. Jul 3, 2011 #16
    So the probability is (2e-1)/e^2

    Is this correct?

    How does this relate to the cdf?
  18. Jul 3, 2011 #17

    I like Serena

    User Avatar
    Homework Helper

    Yes, this is correct.
    You just found the probability for Ts to be greater than 100.

    Can you generalize for Ts greater than some x?

    And then the cdf(x) for Ts is the probability that Ts is less than x.
    Can you calculate that?
  19. Jul 3, 2011 #18
    P(Ts>x) = 2e^(-Ax) - e^(-2Ax)

    so CDF = 1 - 2e^(-Ax) + e^(-2Ax)

    PDF = -2Ae^(-2Ax) + 2Ae^(-Ax)

    E[X] = 3/2A

    Is this correct?
  20. Jul 3, 2011 #19

    I like Serena

    User Avatar
    Homework Helper

    I believe so! :smile:

    Did you really have to do this for high school?
    It seems to be a bit out of its scope.
  21. Jul 3, 2011 #20
    Thank you so much! :smile:

    I'm not in high school, I'm in university in Ireland.
    Due to various personal reasons I was unable to attend lectures, failed the statistics exam and now have to sit another stats exam in August to be allowed to progress to second year. so I'm going through all the exam papers and coming here with the ones I'm having difficulty with.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook