Expectation of X squared plus Y from joint PMF chart

Suppose the joint PMF of X and Y is given by this chart:

Y↓X→12
−10.20.2
00.350.1
10.050.1

Define W=X2+Y. Find the expectation E[W].

Solution

First compute the values of W for each pair (X,Y) in the chart:

Y↓X→12
−103
014
125

Now take the sum, weighted by probabilities:

0⋅(0.2)+3⋅(0.2)+1⋅(0.35)+4⋅(0.1)+2⋅(0.05)+5⋅(0.1)≫≫1.95=E[W]

Expectation of Y two ways and Expectation of XY from joint density

Suppose X and Y are random variables with the following joint density:

fX,Y(x,y)={316xy2x,y∈[0,2]0 otherwise 

(a) Compute E[Y] using two methods.

(b) Compute E[XY].

Solution

(a)

(1) Method One: via marginal PDF fY(y):

fY(y)=∫02316xy2dx≫≫{38y2y∈[0,2]0otherwise

Then expectation:

E[Y]=∫02yfY(y)dy≫≫∫0238y3dy≫≫3/2

(2) Method Two: directly, via two-variable formula:

E[Y]=∫02∫02y⋅316xy2dydx≫≫∫0234xdx≫≫3/2

(b) Directly, via two-variable formula:

E[XY]=∫02∫02xy⋅316xy2dydx≫≫∫0234x2dx≫≫2