Expectation of X squared plus Y from joint PMF chart

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

YX12
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:

YX12
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)dy0238y3dy3/2

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

E[Y]=0202y316xy2dydx0234xdx3/2

(b) Directly, via two-variable formula:

E[XY]=0202xy316xy2dydx0234x2dx2