Results 1 to 3 of 3
Like Tree1Thanks
  • 1 Post By chiro

Math Help - Variance of Y - X

  1. #1
    Junior Member
    Joined
    Sep 2012
    From
    Due North
    Posts
    26

    Variance of Y - X

    Let X and Y be discrete random variables with joint probability function p(x,y) given by the following table:

    X\Y | 0 _ 1___ p(x)
    0 __| 0 _0.2__ 0.2
    1 __| 0.4 0.2 __0.6
    2 __| 0.2 0 ___0.2
    p(y)| 0.6 0.4 ___1

    Find the Variance of Y - X.
    ******
    Hi ! I've been staring at this for a over an hour. It shouldn't be hard but I don't see my mistake...These are my calculations:
    E(X) = 1(0.6) + 2(0.4) = 1
    E(X^2) = 1.4
    Var(X) = 0.2

    E[Y] = 0.4
    E[Y^2] = 0.4
    Var[Y] = 0.24

    E[XY] = 1(1)(0.2) = 0.2
    Cov(X,Y) = 0.152

    So Var(X-Y) = Var(X) + Var(Y) - 2Cov(X,Y) = 0.136
    Where did I go wrong? Thanks !!!
    (ps: sry for the poor table formatting)
    *****
    Answer is 1.04
    Last edited by TheCountador; September 12th 2012 at 08:36 PM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    3,801
    Thanks
    656

    Re: Variance of Y - X

    Hey TheCountador.

    For the expectation, you need to consider that when you are finding the expectation of one variable, you need to exhaust the possibilities for the other variable.

    So for E[X] you have three options: 0,1,2. So E[X] = p(x=0)*0 + p(x=1)*1 + p(x=2)*2.

    Now because you have two values of y, you need to consider p(x=a|y=0) + p(x=a|y=1) for some p(x=a). When you merge these two together you get p(x=0) = 0.2, p(x=1) = 0.6 and p(x=2) = 0.2 which gives you a different value to what you have obtained above.

    Similarly for E[Y] we consider for p(y=a) = p(y=a|x=0) + p(y=a|x=1) + p(y=a|x=2) to calculate a value for p(y=a) in our expectation, so this gives us E[Y] = 0*p(y=0) + 1*p(y=1) = 0.4 (which is what you had anyway).

    So E[X] = 1*0.6 + 2*0.2 = 1. E[X^2] = 1*0.6 + 4*0.2 = 1.4. E[Y] = 0.4, Var[Y] = 0.4 - 0.16 = 0.24.

    E[XY] = p(x=0 and y=0)*0*0 + p(x=0 and y=1)*0*1 + p(x = 1 and y=0)*1*0 + p(x = 1 and y = 1)*1*1 + p(x = 2 and y = 0)*2*0 + p(x = 2 and y = 1)*2*1
    = p(x = 1 and y = 1) + 2*p(x = 2 and y = 1) = 0.2 + 2*0 = 0.2

    Cov(X,Y) = E[XY] - E[X]E[Y] = 0.2 - 1*0.4 = -0.2

    Var[X-Y] = Var[X] + Var[Y] - 2Cov(X,Y) = 0.4 + 0.24 - 2*0.2 = 1.04 which is what the answer is.

    Your mistake was in the covariance calculation which is Cov(X,Y) = E[XY] - E[X]E[Y]

    Calculate E[XY] means you need to expand out all possibilities for X and Y (given this is discrete) and then multiply ab*p(x=a and y=b).

    This is just a result of calculating g(z) where z = xy (standard expectation formulae).
    Thanks from TheCountador
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    Sep 2012
    From
    Due North
    Posts
    26

    Re: Variance of Y - X

    Thanks for the excellent clarification
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. variance of the sample variance
    Posted in the Advanced Statistics Forum
    Replies: 3
    Last Post: February 8th 2011, 08:35 PM
  2. How to get new variance given old variance and average
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: November 23rd 2010, 05:39 AM
  3. pdf and variance
    Posted in the Statistics Forum
    Replies: 3
    Last Post: March 16th 2010, 05:42 PM
  4. Variance of the population variance.
    Posted in the Advanced Statistics Forum
    Replies: 2
    Last Post: November 10th 2008, 09:07 AM
  5. variance
    Posted in the Statistics Forum
    Replies: 4
    Last Post: April 14th 2008, 06:31 AM

Search Tags


/mathhelpforum @mathhelpforum