Matthew A. answered 05/04/20
Ivy League STEM Tutoring and Test Prep Skills (MCAT 100th percentile)
Our goal is to calculate the conditional expectation of Y given X = 1. The definition of expectation of a random variable for a discrete distribution is...
E[X] = ∑i xi • f(xi)
or (the probability of getting a value) x (the value itself). Expanding this to a conditional expectation...
E[Y| X=1] = ∑i yi • f(yi | x = x)
Note that the only thing that changed was that we use the conditional probability of getting a yi given x = 1. We'll use Bayes' theorem to calculate that probability.
Bayes Theorem:
P(Y = y| X = x) = P(X =x | Y = y)P(Y = y)/ P(X = x)
To put this into words, the probability of seeing y given x, is equal to the probability of seeing y and x divided by the probability of seeing x. Replace "x" with "1" and we have our given problem. Solving the right hand side...
P(X = 1 and Y = y) = (1 + 1)(y + 2)/54 <- note this is for an individual yi so we don't need to sum it
P(X = 1) = ∑{i = 0,1,2} (1 + 1)(yi + 2)/54 <- different from above as it's P(x=1) for all yi which is why we sum
P(X = 1) = (1+1)(0+2)/54 + (1+1)(1+2)/54 + (1+1)(2+2)/54
P(X = 1) = 4/54 + 6/54 + 8/54 = 18/54
P(X = 1 and Y = y | X = 1) = [(1 + 1)(y + 2)/54] / [18/54] = (y + 2)/9
We're all set to find the expected value now
E[Y| X=1] = ∑{i=0,1,2} yi • f(yi | x = x)
E[Y| X=1] = ∑{i=0,1,2}yi • (yi + 2)/9
E[Y| X=1] = 0 • (0+2)/9 + 1 • (1+2)/9 + 2 • (2+2)/9
E[Y| X=1] = 0 + 3/9 + 8/9 = 12/9 or 1.333
Hope this all helps :) feel free to ask any followups