# Connexions

You are here: Home » Content » Problems on Variance, Covariance, Linear Regression

### Lenses

What is a lens?

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

#### Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
• Rice Digital Scholarship

This module is included in aLens by: Digital Scholarship at Rice UniversityAs a part of collection: "Applied Probability"

Click the "Rice Digital Scholarship" link to see all content affiliated with them.

#### Also in these lenses

• UniqU content

This module is included inLens: UniqU's lens
By: UniqU, LLCAs a part of collection: "Applied Probability"

Click the "UniqU content" link to see all content selected in this lens.

### Recently Viewed

This feature requires Javascript to be enabled.

# Problems on Variance, Covariance, Linear Regression

Module by: Paul E Pfeiffer. E-mail the author

## Exercise 1

(See Exercise 1 from "Problems on Distribution and Density Functions ", and Exercise 1 from "Problems on Mathematical Expectation", m-file npr07_01.m). The class {Cj:1j10}{Cj:1j10} is a partition. Random variable X has values {1,3,2,3,4,2,1,3,5,2}{1,3,2,3,4,2,1,3,5,2} on C1 through C10, respectively, with probabilities 0.08, 0.13, 0.06, 0.09, 0.14, 0.11, 0.12, 0.07, 0.11, 0.09. Determine Var [X] Var [X].

### Solution

npr07_01
Data are in T and pc
EX = T*pc'
EX =  2.7000
VX = (T.^2)*pc' - EX^2
VX =  1.5500
[X,PX] = csort(T,pc);    % Alternate
Ex = X*PX'
Ex =  2.7000
Vx = (X.^2)*PX' - EX^2
Vx =  1.5500


## Exercise 2

(See Exercise 2 from "Problems on Distribution and Density Functions ", and Exercise 2 from "Problems on Mathematical Expectation", m-file npr07_02.m). A store has eight items for sale. The prices are $3.50,$5.00, $3.50,$7.50, $5.00,$5.00, $3.50, and$7.50, respectively. A customer comes in. She purchases one of the items with probabilities 0.10, 0.15, 0.15, 0.20, 0.10 0.05, 0.10 0.15. The random variable expressing the amount of her purchase may be written

X = 3 . 5 I C 1 + 5 . 0 I C 2 + 3 . 5 I C 3 + 7 . 5 I C 4 + 5 . 0 I C 5 + 5 . 0 I C 6 + 3 . 5 I C 7 + 7 . 5 I C 8 X = 3 . 5 I C 1 + 5 . 0 I C 2 + 3 . 5 I C 3 + 7 . 5 I C 4 + 5 . 0 I C 5 + 5 . 0 I C 6 + 3 . 5 I C 7 + 7 . 5 I C 8
(1)

Determine Var [X] Var [X].

### Solution

npr07_02
Data are in T, pc
EX = T*pc';
VX = (T.^2)*pc' - EX^2
VX =  2.8525


## Exercise 3

(See Exercise 12 from "Problems on Random Variables and Probabilities", Exercise 3 from "Problems on Mathematical Expectation", m-file npr06_12.m). The class {A,B,C,D}{A,B,C,D} has minterm probabilities

p m = 0 . 001 * [ 5 7 6 8 9 14 22 33 21 32 50 75 86 129 201 302 ] p m = 0 . 001 * [ 5 7 6 8 9 14 22 33 21 32 50 75 86 129 201 302 ]
(2)

Consider X=IA+IB+IC+IDX=IA+IB+IC+ID, which counts the number of these events which occur on a trial. Determine Var [X] Var [X].

### Solution

npr06_12
Minterm probabilities in pm, coefficients in c
canonic
Enter row vector of coefficients  c
Enter row vector of minterm probabilities  pm
Use row matrices X and PX for calculations
Call for XDBN to view the distribution
VX = (X.^2)*PX' - (X*PX')^2
VX =  0.7309


## Exercise 4

(See Exercise 4 from "Problems on Mathematical Expectation"). In a thunderstorm in a national park there are 127 lightning strikes. Experience shows that the probability of each lightning strike starting a fire is about 0.0083. Determine Var [X] Var [X].

### Solution

XX binomial (127,0.0083). Var [X]=127·0.0083·(1-0.0083)=1.0454 Var [X]=127·0.0083·(1-0.0083)=1.0454.

## Exercise 5

(See Exercise 5 from "Problems on Mathematical Expectation"). Two coins are flipped twenty times. Let X be the number of matches (both heads or both tails). Determine Var [X] Var [X].

### Solution

XX binomial (20,1/2). Var [X]=20·(1/2)2=5 Var [X]=20·(1/2)2=5.

## Exercise 6

(See Exercise 6 from "Problems on Mathematical Expectation"). A residential College plans to raise money by selling “chances” on a board. Fifty chances are sold. A player pays $10 to play; he or she wins$30 with probability p=0.2p=0.2. The profit to the College is

X = 50 · 10 - 30 N , where N is the number of winners X = 50 · 10 - 30 N , where N is the number of winners
(3)

Determine Var [X] Var [X].

### Solution

NN binomial (50,0.2). Var [N]=50·0.2·0.8=8 Var [N]=50·0.2·0.8=8. Var [X]=302 Var [N]=7200 Var [X]=302 Var [N]=7200.

## Exercise 7

(See Exercise 7 from "Problems on Mathematical Expectation"). The number of noise pulses arriving on a power circuit in an hour is a random quantity X having Poisson (7) distribution. Determine Var [X] Var [X].

### Solution

XX Poisson (7). Var [X]=μ=7 Var [X]=μ=7.

## Exercise 8

(See Exercise 24 from "Problems on Distribution and Density Functions", and Exercise 8 from "Problems on Mathematical Expectation"). The total operating time for the units in Exercise 24 from "Problems on Distribution and Density Functions" is a random variable TT gamma (20, 0.0002). Determine Var [T] Var [T].

### Solution

TT gamma (20,0.0002). Var [T]=20/0.00022=500,000,000 Var [T]=20/0.00022=500,000,000.

## Exercise 9

The class {A,B,C,D,E,F}{A,B,C,D,E,F} is independent, with respective probabilities

0.43, 0.53, 0.46, 0.37, 0.45, 0.39. Let

X = 6 I A + 13 I B - 8 I C , Y = - 3 I D + 4 I E + I F - 7 X = 6 I A + 13 I B - 8 I C , Y = - 3 I D + 4 I E + I F - 7
(4)
1. Use properties of expectation and variance to obtain E[X]E[X], Var [X] Var [X], E[Y]E[Y], and Var [Y] Var [Y]. Note that it is not necessary to obtain the distributions for X or Y.
2. Let Z=3Y-2XZ=3Y-2X.
Determine E[Z]E[Z], and Var [Z] Var [Z].

### Solution

cx = [6 13 -8 0];
cy = [-3 4 1 -7];
px = 0.01*[43 53 46 100];
py = 0.01*[37 45 39 100];
EX = dot(cx,px)
EX =   5.7900
EY = dot(cy,py)
EY =  -5.9200
VX = sum(cx.^2.*px.*(1-px))
VX =  66.8191
VY = sum(cy.^2.*py.*(1-py))
VY =   6.2958
EZ = 3*EY - 2*EX
EZ = -29.3400
VZ = 9*VY + 4*VX
VZ = 323.9386


## Exercise 10

Consider X=-3.3IA-1.7IB+2.3IC+7.6ID-3.4X=-3.3IA-1.7IB+2.3IC+7.6ID-3.4. The class {A,B,C,D}{A,B,C,D} has minterm

probabilities (data are in m-file npr12_10.m)

pmx = [ 0 . 0475 0 . 0725 0 . 0120 0 . 0180 0 . 1125 0 . 1675 0 . 0280 0 . 0420 pmx = [ 0 . 0475 0 . 0725 0 . 0120 0 . 0180 0 . 1125 0 . 1675 0 . 0280 0 . 0420
(5)
0 . 0480 0 . 0720 0 . 0130 0 . 0170 0 . 1120 0 . 1680 0 . 0270 0 . 0430 ] 0 . 0480 0 . 0720 0 . 0130 0 . 0170 0 . 1120 0 . 1680 0 . 0270 0 . 0430 ]
(6)
1. Calculate E[X]E[X] and Var [X] Var [X].
2. Let W=2X2-3X+2W=2X2-3X+2.
Calculate E[W]E[W] and Var [W] Var [W].

### Solution

npr12_10
Data are in cx, cy, pmx and pmy
canonic
Enter row vector of coefficients  cx
Enter row vector of minterm probabilities  pmx
Use row matrices X and PX for calculations
Call for XDBN to view the distribution
EX = dot(X,PX)
EX =  -1.2200
VX = dot(X.^2,PX) - EX^2
VX =  18.0253
G = 2*X.^2 - 3*X + 2;
[W,PW] = csort(G,PX);
EW = dot(W,PW)
EW =  44.6874
VW = dot(W.^2,PW) - EW^2
VW =  2.8659e+03


## Exercise 11

Consider a second random variable Y=10IE+17IF+20IG-10Y=10IE+17IF+20IG-10 in addition to that in Exercise 10. The class {E,F,G}{E,F,G} has minterm probabilities (in mfile npr12_10.m)

pmy = [ 0 . 06 0 . 14 0 . 09 0 . 21 0 . 06 0 . 14 0 . 09 0 . 21 ] pmy = [ 0 . 06 0 . 14 0 . 09 0 . 21 0 . 06 0 . 14 0 . 09 0 . 21 ]
(7)

The pair {X,Y}{X,Y} is independent.

1. Calculate E[Y]E[Y] and Var [Y] Var [Y].
2. Let Z=X2+2XY-YZ=X2+2XY-Y.
Calculate E[Z]E[Z] and Var [Z] Var [Z].

### Solution

(Continuation of Exercise 10)

[Y,PY] = canonicf(cy,pmy);
EY = dot(Y,PY)
EY =  19.2000
VY = dot(Y.^2,PY) - EY^2
VY = 178.3600
icalc
Enter row matrix of X-values  X
Enter row matrix of Y-values  Y
Enter X probabilities  PX
Enter Y probabilities  PY
Use array operations on matrices X, Y, PX, PY, t, u, and P
H = t.^2 + 2*t.*u - u;
[Z,PZ] = csort(H,P);
EZ = dot(Z,PZ)
EZ = -46.5343
VZ = dot(Z.^2,PZ) - EZ^2
VZ =  3.7165e+04


## Exercise 12

Suppose the pair {X,Y}{X,Y} is independent, with XX gamma (3,0.1) and

YY Poisson (13). Let Z=2X-5YZ=2X-5Y. Determine E[Z]E[Z] and Var [Z] Var [Z].

### Solution

XX gamma (3, 0.1) implies E[X]=30E[X]=30 and Var [X]=300 Var [X]=300. YY Poisson (13) implies E[Y]= Var [Y]=13E[Y]= Var [Y]=13. Then

E [ Z ] = 2 · 30 - 5 · 13 = - 5 , Var [ Z ] = 4 · 300 + 25 · 13 = 1525 E [ Z ] = 2 · 30 - 5 · 13 = - 5 , Var [ Z ] = 4 · 300 + 25 · 13 = 1525
(8)

## Exercise 13

The pair {X,Y}{X,Y} is jointly distributed with the following parameters:

E [ X ] = 3 , E [ Y ] = 4 , E [ X Y ] = 15 , E [ X 2 ] = 11 , Var [ Y ] = 5 E [ X ] = 3 , E [ Y ] = 4 , E [ X Y ] = 15 , E [ X 2 ] = 11 , Var [ Y ] = 5
(9)

Determine Var [3X-2Y] Var [3X-2Y].

### Solution

EX = 3;
EY = 4;
EXY = 15;
EX2 = 11;
VY = 5;
VX = EX2 - EX^2
VX =  2
CV = EXY - EX*EY
CV =  3
VZ = 9*VX + 4*VY - 6*2*CV
VZ =  2


## Exercise 14

The class {A,B,C,D,E,F}{A,B,C,D,E,F} is independent, with respective probabilities

0 . 47 , 0 . 33 , 0 . 46 , 0 . 27 , 0 . 41 , 0 . 37 0 . 47 , 0 . 33 , 0 . 46 , 0 . 27 , 0 . 41 , 0 . 37
(10)

Let

X = 8 I A + 11 I B - 7 I C , Y = - 3 I D + 5 I E + I F - 3 , and Z = 3 Y - 2 X X = 8 I A + 11 I B - 7 I C , Y = - 3 I D + 5 I E + I F - 3 , and Z = 3 Y - 2 X
(11)
1. Use properties of expectation and variance to obtain E[X]E[X], Var [X] Var [X], E[Y]E[Y], and Var [Y] Var [Y].
2. Determine E[Z]E[Z], and Var [Z] Var [Z].
3. Use appropriate m-programs to obtain E[X]E[X], Var [X] Var [X], E[Y]E[Y], Var [Y] Var [Y], E[Z]E[Z], and Var [Z] Var [Z]. Compare with results of parts (a) and (b).

### Solution

px = 0.01*[47 33 46 100];
py = 0.01*[27 41 37 100];
cx = [8 11 -7 0];
cy = [-3 5 1 -3];
ex = dot(cx,px)
ex =   4.1700
ey = dot(cy,py)
ey =  -1.3900
vx = sum(cx.^2.*px.*(1 - px))
vx =  54.8671
vy = sum(cy.^2.*py.*(1-py))
vy =   8.0545
[X,PX] = canonicf(cx,minprob(px(1:3)));
[Y,PY] = canonicf(cy,minprob(py(1:3)));
icalc
Enter row matrix of X-values  X
Enter row matrix of Y-values  Y
Enter X probabilities  PX
Enter Y probabilities  PY
Use array operations on matrices X, Y, PX, PY, t, u, and P
EX = dot(X,PX)
EX =   4.1700
EY = dot(Y,PY)
EY =  -1.3900
VX = dot(X.^2,PX) - EX^2
VX =  54.8671
VY = dot(Y.^2,PY) - EY^2
VY =   8.0545
EZ = 3*EY - 2*EX
EZ = -12.5100
VZ = 9*VY + 4*VX
VZ = 291.9589


## Exercise 15

For the Beta (r,s)(r,s) distribution,

1. Determine E[Xn]E[Xn], where n is a positive integer.
2. Use the result of part (a) to determine E[X]E[X] and Var [X] Var [X].

### Solution

E [ X n ] = Γ ( r + s ) Γ ( r ) Γ ( s ) 0 1 t r + n - 1 ( 1 - t ) s - 1 d t = Γ ( r + s ) Γ ( r ) Γ ( s ) · Γ ( r + n ) Γ ( s ) Γ ( r + s + n ) = E [ X n ] = Γ ( r + s ) Γ ( r ) Γ ( s ) 0 1 t r + n - 1 ( 1 - t ) s - 1 d t = Γ ( r + s ) Γ ( r ) Γ ( s ) · Γ ( r + n ) Γ ( s ) Γ ( r + s + n ) =
(12)
Γ ( r + n ) Γ ( r + s ) Γ ( r + s + n ) Γ ( r ) Γ ( r + n ) Γ ( r + s ) Γ ( r + s + n ) Γ ( r )
(13)

Using Γ(x+1)=xΓ(x)Γ(x+1)=xΓ(x) we have

E [ X ] = r r + s , E [ X 2 ] = r ( r + 1 ) ( r + s ) ( r + s + 1 ) E [ X ] = r r + s , E [ X 2 ] = r ( r + 1 ) ( r + s ) ( r + s + 1 )
(14)

Some algebraic manipulations show that

Var [ X ] = E [ X 2 ] - E 2 [ X ] = r s ( r + s ) 2 ( r + s + 1 ) Var [ X ] = E [ X 2 ] - E 2 [ X ] = r s ( r + s ) 2 ( r + s + 1 )
(15)

## Exercise 16

The pair {X,Y}{X,Y} has joint distribution. Suppose

E [ X ] = 3 , E [ X 2 ] = 11 , E [ Y ] = 10 , E [ Y 2 ] = 101 , E [ X Y ] = 30 E [ X ] = 3 , E [ X 2 ] = 11 , E [ Y ] = 10 , E [ Y 2 ] = 101 , E [ X Y ] = 30
(16)

Determine Var [15X-2Y] Var [15X-2Y].

### Solution

EX = 3;
EX2 = 11;
EY = 10;
EY2 = 101;
EXY = 30;
VX = EX2 - EX^2
VX =    2
VY = EY2 - EY^2
VY =    1
CV = EXY - EX*EY
CV =    0
VZ = 15^2*VX + 2^2*VY
VZ =  454


## Exercise 17

The pair {X,Y}{X,Y} has joint distribution. Suppose

E [ X ] = 2 , E [ X 2 ] = 5 , E [ Y ] = 1 , E [ Y 2 ] = 2 , E [ X Y ] = 1 E [ X ] = 2 , E [ X 2 ] = 5 , E [ Y ] = 1 , E [ Y 2 ] = 2 , E [ X Y ] = 1
(17)

Determine Var [3X+2Y] Var [3X+2Y].

### Solution

EX = 2;
EX2 = 5;
EY = 1;
EY2 = 2;
EXY = 1;
VX = EX2 - EX^2
VX =    1
VY = EY2 - EY^2
VY =    1
CV = EXY - EX*EY
CV =   -1
VZ = 9*VX + 4*VY + 2*6*CV
VZ =    1


## Exercise 18

The pair {X,Y}{X,Y} is independent, with

E [ X ] = 2 , E [ Y ] = 1 , Var [ X ] = 6 , Var [ Y ] = 4 E [ X ] = 2 , E [ Y ] = 1 , Var [ X ] = 6 , Var [ Y ] = 4
(18)

Let Z=2X2+XY2-3Y+4.Z=2X2+XY2-3Y+4..
Determine E[Z].E[Z].

### Solution

EX = 2;
EY = 1;
VX = 6;
VY = 4;
EX2 = VX + EX^2
EX2 =  10
EY2 = VY + EY^2
EY2 =   5
EZ = 2*EX2 + EX*EY2 - 3*EY + 4
EZ =   31


## Exercise 19

(See Exercise 9 from "Problems on Mathematical Expectation"). Random variable X has density function

f X ( t ) = ( 6 / 5 ) t 2 for 0 t 1 ( 6 / 5 ) ( 2 - t ) for 1 < t 2 = I [ 0 , 1 ] ( t ) 6 5 t 2 + I ( 1 , 2 ] ( t ) 6 5 ( 2 - t ) f X ( t ) = ( 6 / 5 ) t 2 for 0 t 1 ( 6 / 5 ) ( 2 - t ) for 1 < t 2 = I [ 0 , 1 ] ( t ) 6 5 t 2 + I ( 1 , 2 ] ( t ) 6 5 ( 2 - t )
(19)

E[X]=11/10E[X]=11/10. Determine Var [X] Var [X].

### Solution

E [ X 2 ] = t 2 f X ( t ) d t = 6 5 0 1 t 4 d t + 6 5 1 2 ( 2 t 2 - t 3 ) d t = 67 50 E [ X 2 ] = t 2 f X ( t ) d t = 6 5 0 1 t 4 d t + 6 5 1 2 ( 2 t 2 - t 3 ) d t = 67 50
(20)
Var [ X ] = E [ X 2 ] - E 2 [ X ] = 13 100 Var [ X ] = E [ X 2 ] - E 2 [ X ] = 13 100
(21)

For the distributions in Exercises 20-22

Determine Var [X] Var [X], Cov [X,Y] Cov [X,Y], and the regression line of Y on X.

## Exercise 20

(See Exercise 7 from "Problems On Random Vectors and Joint Distributions", and Exercise 17 from "Problems on Mathematical Expectation"). The pair {X,Y}{X,Y} has the joint distribution (in file npr08_07.m):

P ( X = t , Y = u ) P ( X = t , Y = u )
(22)
 t = -3.1 -0.5 1.2 2.4 3.7 4.9 u = 7.5 0.009 0.0396 0.0594 0.0216 0.044 0.0203 4.1 0.0495 0 0.1089 0.0528 0.0363 0.0231 -2.0 0.0405 0.132 0.0891 0.0324 0.0297 0.0189 -3.8 0.051 0.0484 0.0726 0.0132 0 0.0077

### Solution

npr08_07
Data are in X, Y, P
jcalc
- - - - - - - - - - -
EX = dot(X,PX);
EY = dot(Y,PY);
VX = dot(X.^2,PX) - EX^2
VX =   5.1116
CV = total(t.*u.*P) - EX*EY
CV =   2.6963
a = CV/VX
a =    0.5275
b = EY - a*EX
b =    0.6924       % Regression line: u = at + b


## Exercise 21

(See Exercise 8 from "Problems On Random Vectors and Joint Distributions", and Exercise 18 from "Problems on Mathematical Expectation"). The pair {X,Y}{X,Y} has the joint distribution (in file npr08_08.m):

P ( X = t , Y = u ) P ( X = t , Y = u )
(23)
 t = 1 3 5 7 9 11 13 15 17 19 u = 12 0.0156 0.0191 0.0081 0.0035 0.0091 0.007 0.0098 0.0056 0.0091 0.0049 10 0.0064 0.0204 0.0108 0.004 0.0054 0.008 0.0112 0.0064 0.0104 0.0056 9 0.0196 0.0256 0.0126 0.006 0.0156 0.012 0.0168 0.0096 0.0056 0.0084 5 0.0112 0.0182 0.0108 0.007 0.0182 0.014 0.0196 0.0012 0.0182 0.0038 3 0.006 0.026 0.0162 0.005 0.016 0.02 0.028 0.006 0.016 0.004 -1 0.0096 0.0056 0.0072 0.006 0.0256 0.012 0.0268 0.0096 0.0256 0.0084 -3 0.0044 0.0134 0.018 0.014 0.0234 0.018 0.0252 0.0244 0.0234 0.0126 -5 0.0072 0.0017 0.0063 0.0045 0.0167 0.009 0.0026 0.0172 0.0217 0.0223

### Solution

npr08_08
Data are in X, Y, P
jcalc
- - - - - - - - - - - -
EX = dot(X,PX);
EY = dot(Y,PY);
VX = dot(X.^2,PX) - EX^2
VX =  31.0700
CV = total(t.*u.*P) - EX*EY
CV =  -8.0272
a  = CV/VX
a  =  -0.2584
b = EY - a*EX
b  =   5.6110       % Regression line: u = at + b


## Exercise 22

(See Exercise 9 from "Problems On Random Vectors and Joint Distributions", and Exercise 19 from "Problems on Mathematical Expectation"). Data were kept on the effect of training time on the time to perform a job on a production line. X is the amount of training, in hours, and Y is the time to perform the task, in minutes. The data are as follows (in file npr08_09.m):

P ( X = t , Y = u ) P ( X = t , Y = u )
(24)
 t = 1 1.5 2 2.5 3 u = 5 0.039 0.011 0.005 0.001 0.001 4 0.065 0.07 0.05 0.015 0.01 3 0.031 0.061 0.137 0.051 0.033 2 0.012 0.049 0.163 0.058 0.039 1 0.003 0.009 0.045 0.025 0.017

### Solution

npr08_09
Data are in X, Y, P
jcalc
- - - - - - - - - - - -
EX = dot(X,PX);
EY = dot(Y,PY);
VX = dot(X.^2,PX) - EX^2
VX =   0.3319
CV = total(t.*u.*P) - EX*EY
CV =  -0.2586
a  = CV/VX
a  =  -0.77937/6;
b = EY - a*EX
b  =   4.3051       % Regression line: u = at + b


For the joint densities in Exercises 23-30 below

1. Determine analytically Var [X] Var [X], Cov [X,Y] Cov [X,Y], and the regression line of Y on X.
2. Check these with a discrete approximation.

## Exercise 23

(See Exercise 10 from "Problems On Random Vectors and Joint Distributions", and Exercise 20 from "Problems on Mathematical Expectation"). fXY(t,u)=1fXY(t,u)=1 for 0t10t1, 0u2(1-t)0u2(1-t).

E [ X ] = 1 3 , E [ X 2 ] = 1 6 , E [ Y ] = 2 3 E [ X ] = 1 3 , E [ X 2 ] = 1 6 , E [ Y ] = 2 3
(25)

### Solution

E [ X Y ] = 0 1 0 2 ( 1 - t ) t u d u d t = 1 / 6 E [ X Y ] = 0 1 0 2 ( 1 - t ) t u d u d t = 1 / 6
(26)
Cov [ X , Y ] = 1 6 - 1 3 · 2 3 = - 1 / 18 Var [ X ] = 1 / 6 - ( 1 / 3 ) 2 = 1 / 18 Cov [ X , Y ] = 1 6 - 1 3 · 2 3 = - 1 / 18 Var [ X ] = 1 / 6 - ( 1 / 3 ) 2 = 1 / 18
(27)
a = Cov [ X , Y ] / Var [ X ] = - 1 b = E [ Y ] - a E [ X ] = 1 a = Cov [ X , Y ] / Var [ X ] = - 1 b = E [ Y ] - a E [ X ] = 1
(28)
tuappr: [0 1] [0 2] 200 400  u<=2*(1-t)
EX = dot(X,PX);
EY = dot(Y,PY);
VX = dot(X.^2,PX) - EX^2
VX =   0.0556
CV = total(t.*u.*P) - EX*EY
CV =  -0.0556
a = CV/VX
a =   -1.0000
b = EY - a*EX
b =    1.0000


## Exercise 24

(See Exercise 13 from "Problems On Random Vectors and Joint Distributions", and Exercise 23 from "Problems on Mathematical Expectation"). fXY(t,u)=18(t+u)fXY(t,u)=18(t+u) for 0t20t2, 0u20u2.

E [ X ] = E [ Y ] = 7 6 , E [ X 2 ] = 5 3 E [ X ] = E [ Y ] = 7 6 , E [ X 2 ] = 5 3
(29)

### Solution

E [ X Y ] = 1 8 0 2 0 2 t u ( t + u ) d u d t = 4 / 3 , Cov [ X , Y ] = - 1 / 36 , Var [ X ] = 11 / 36 E [ X Y ] = 1 8 0 2 0 2 t u ( t + u ) d u d t = 4 / 3 , Cov [ X , Y ] = - 1 / 36 , Var [ X ] = 11 / 36
(30)
a = Cov [ X , Y ] / Var [ X ] = - 1 / 11 , b = E [ Y ] - a E [ X ] = 14 / 11 a = Cov [ X , Y ] / Var [ X ] = - 1 / 11 , b = E [ Y ] - a E [ X ] = 14 / 11
(31)
tuappr:  [0 2] [0 2] 200 200 (1/8)*(t+u)
VX =  0.3055  CV = -0.0278  a = -0.0909  b =  1.2727


## Exercise 25

(See Exercise 15 from "Problems On Random Vectors and Joint Distributions", and Exercise 25 from "Problems on Mathematical Expectation"). fXY(t,u)=388(2t+3u2)fXY(t,u)=388(2t+3u2) for 0t20t2, 0u1+t0u1+t.

E [ X ] = 313 220 , E [ Y ] = 1429 880 , E [ X 2 ] = 49 22 E [ X ] = 313 220 , E [ Y ] = 1429 880 , E [ X 2 ] = 49 22
(32)

### Solution

E [ X Y ] = 3 88 0 2 0 1 + t t u ( 2 t + 3 u 2 ) d u d t = 2153 880 Cov [ X , Y ] = 26383 1933600 , Var [ X ] = 9831 48400 E [ X Y ] = 3 88 0 2 0 1 + t t u ( 2 t + 3 u 2 ) d u d t = 2153 880 Cov [ X , Y ] = 26383 1933600 , Var [ X ] = 9831 48400
(33)
a = Cov [ X , Y ] / Var [ X ] = 26383 39324 b = E [ Y ] - a E [ X ] = 26321 39324 a = Cov [ X , Y ] / Var [ X ] = 26383 39324 b = E [ Y ] - a E [ X ] = 26321 39324
(34)
tuappr:  [0 2] [0 3] 200 300  (3/88)*(2*t + 3*u.^2).*(u<=1+t)
VX =  0.2036  CV = 0.1364 a = 0.6700  b = 0.6736


## Exercise 26

(See Exercise 16 from "Problems On Random Vectors and Joint Distributions", and Exercise 26 from "Problems on Mathematical Expectation"). fXY(t,u)=12t2ufXY(t,u)=12t2u on the parallelogram with vertices

( - 1 , 0 ) , ( 0 , 0 ) , ( 1 , 1 ) , ( 0 , 1 ) ( - 1 , 0 ) , ( 0 , 0 ) , ( 1 , 1 ) , ( 0 , 1 )
(35)
E [ X ] = 2 5 , E [ Y ] = 11 15 , E [ X 2 ] = 2 5 E [ X ] = 2 5 , E [ Y ] = 11 15 , E [ X 2 ] = 2 5
(36)

### Solution

E [ X Y ] = 12 - 1 0 0 t + 1 t 3 u 2 d u d t + 12 0 1 t 1 t 3 u 2 d u d t = 2 5 E [ X Y ] = 12 - 1 0 0 t + 1 t 3 u 2 d u d t + 12 0 1 t 1 t 3 u 2 d u d t = 2 5
(37)
Cov [ X , Y ] = 8 75 , Var [ X ] = 6 25 Cov [ X , Y ] = 8 75 , Var [ X ] = 6 25
(38)
a = Cov [ X , Y ] / Var [ X ] = 4 / 9 b = E [ Y ] - a E [ X ] = 5 / 9 a = Cov [ X , Y ] / Var [ X ] = 4 / 9 b = E [ Y ] - a E [ X ] = 5 / 9
(39)
tuappr: [-1 1] [0 1] 400 200  12*t.^2.*u.*(u>= max(0,t)).*(u<= min(1+t,1))
VX = 0.2383  CV = 0.1056  a = 0.4432  b = 0.5553


## Exercise 27

(See Exercise 17 from "Problems On Random Vectors and Joint Distributions", and Exercise 27 from "Problems on Mathematical Expectation"). fXY(t,u)=2411tufXY(t,u)=2411tu for 0t20t2, 0umin{1,2-t}0umin{1,2-t}.

E [ X ] = 52 55 , E [ Y ] = 32 55 , E [ X 2 ] = 627 605 E [ X ] = 52 55 , E [ Y ] = 32 55 , E [ X 2 ] = 627 605
(40)

### Solution

E [ X Y ] = 24 11 0 1 0 1 t 2 u 2 d u d t + 24 11 1 2 0 2 - t t 2 u 2 d u d t = 28 55 E [ X Y ] = 24 11 0 1 0 1 t 2 u 2 d u d t + 24 11 1 2 0 2 - t t 2 u 2 d u d t = 28 55
(41)
Cov [ X Y ] = - 124 3025 , Var [ X ] = 431 3025 Cov [ X Y ] = - 124 3025 , Var [ X ] = 431 3025
(42)
a = Cov [ X , Y ] / Var [ X ] = - 124 431 b = E [ Y ] - a E [ X ] = 368 431 a = Cov [ X , Y ] / Var [ X ] = - 124 431 b = E [ Y ] - a E [ X ] = 368 431
(43)
tuappr: [0 2] [0 1] 400 200 (24/11)*t.*u.*(u<=min(1,2-t))
VX = 0.1425  CV =-0.0409  a = -0.2867 b = 0.8535


## Exercise 28

(See Exercise 18 from "Problems On Random Vectors and Joint Distributions", and Exercise 28 from "Problems on Mathematical Expectation"). fXY(t,u)=323(t+2u)fXY(t,u)=323(t+2u) for 0t20t2, 0umax{2-t,t}0umax{2-t,t}.

E [ X ] = 53 46 , E [ Y ] = 22 23 , E [ X 2 ] = 9131 5290 E [ X ] = 53 46 , E [ Y ] = 22 23 , E [ X 2 ] = 9131 5290
(44)

### Solution

E [ X Y ] = 3 23 0 1 0 2 - t t u ( t + 2 u ) d u d t + 3 23 1 2 0 t t u ( t + 2 u ) d u d t = 251 230 E [ X Y ] = 3 23 0 1 0 2 - t t u ( t + 2 u ) d u d t + 3 23 1 2 0 t t u ( t + 2 u ) d u d t = 251 230
(45)
Cov [ X , Y ] = - 57 5290 , Var [ X ] = 4217 10580 Cov [ X , Y ] = - 57 5290 , Var [ X ] = 4217 10580
(46)
a = Cov [ X , Y ] / Var [ X ] = - 114 4217 b = E [ Y ] - a E [ X ] = 4165 4217 a = Cov [ X , Y ] / Var [ X ] = - 114 4217 b = E [ Y ] - a E [ X ] = 4165 4217
(47)
tuappr: [0 2] [0 2] 200 200 (3/23)*(t + 2*u).*(u<=max(2-t,t))
VX = 0.3984 CV = -0.0108  a = -0.0272  b = 0.9909


## Exercise 29

(See Exercise 21 from "Problems On Random Vectors and Joint Distributions", and Exercise 31 from "Problems on Mathematical Expectation"). fXY(t,u)=213(t+2u)fXY(t,u)=213(t+2u), for 0t20t2, 0umin{2t,3-t}0umin{2t,3-t}.

E [ X ] = 16 13 , E [ Y ] = 11 12 , E [ X 2 ] = 2847 1690 E [ X ] = 16 13 , E [ Y ] = 11 12 , E [ X 2 ] = 2847 1690
(48)

### Solution

E [ X Y ] = 2 13 0 1 0 3 - t t u ( t + 2 u ) d u d t + 2 13 1 2 0 2 t t u ( t + 2 u ) d u d t = 431 390 E [ X Y ] = 2 13 0 1 0 3 - t t u ( t + 2 u ) d u d t + 2 13 1 2 0 2 t t u ( t + 2 u ) d u d t = 431 390
(49)
Cov [ X , Y ] = - 3 130 Var [ X ] = 287 1690 Cov [ X , Y ] = - 3 130 Var [ X ] = 287 1690
(50)
a = Cov [ X , Y ] / Var [ X ] = - 39 297 b = E [ Y ] - a E [ X ] = 3733 3444 a = Cov [ X , Y ] / Var [ X ] = - 39 297 b = E [ Y ] - a E [ X ] = 3733 3444
(51)
tuappr: [0 2] [0 2] 400 400 (2/13)*(t + 2*u).*(u<=min(2*t,3-t))
VX = 0.1698  CV = -0.0229  a = -0.1350  b = 1.0839


## Exercise 30

(See Exercise 22 from "Problems On Random Vectors and Joint Distributions", and Exercise 32 from "Problems on Mathematical Expectation"). fXY(t,u)=I[0,1](t)38(t2+2u)+I(1,2](t)914t2u2fXY(t,u)=I[0,1](t)38(t2+2u)+I(1,2](t)914t2u2, for 0u10u1.

E [ X ] = 243 224 , E [ Y ] = 11 16 , E [ X 2 ] = 107 70 E [ X ] = 243 224 , E [ Y ] = 11 16 , E [ X 2 ] = 107 70
(52)

### Solution

E [ X Y ] = 3 8 0 1 0 1 t u ( t 2 + 2 u ) d u d t + 9 14 1 2 0 1 t 3 u 3 d u d t = 347 448 E [ X Y ] = 3 8 0 1 0 1 t u ( t 2 + 2 u ) d u d t + 9 14 1 2 0 1 t 3 u 3 d u d t = 347 448
(53)
Cov [ X , Y ] = 103 3584 , Var [ X ] = 88243 250880 Cov [ X , Y ] = 103 3584 , Var [ X ] = 88243 250880
(54)
a = Cov [ X , Y ] / Var [ X ] = 7210 88243 b = E [ Y ] - a E [ X ] = 105691 176486 a = Cov [ X , Y ] / Var [ X ] = 7210 88243 b = E [ Y ] - a E [ X ] = 105691 176486
(55)
tuappr: [0 2] [0 1] 400 200 (3/8)*(t.^2 + 2*u).*(t<=1) + (9/14)*t.^2.*u.^2.*(t>1)
VX = 0.3517  CV = 0.0287 a = 0.0817  b = 0.5989


## Exercise 31

The class {X,Y,Z}{X,Y,Z} of random variables is iid (independent, identically distributed) with common distribution

X = [ - 5 - 1 3 4 7 ] P X = 0 . 01 * [ 15 20 30 25 10 ] X = [ - 5 - 1 3 4 7 ] P X = 0 . 01 * [ 15 20 30 25 10 ]
(56)

Let W=3X-4Y+2ZW=3X-4Y+2Z. Determine E[W]E[W] and Var [W] Var [W]. Do this using icalc, then repeat with icalc3 and compare results.

### Solution

x = [-5 -1 3 4 7];
px = 0.01*[15 20 30 25 10];
EX = dot(x,px)                % Use of properties
EX =   1.6500
VX = dot(x.^2,px) - EX^2
VX =  12.8275
EW = (3 - 4+ 2)*EX
EW =   1.6500
VW = (3^2 + 4^2 + 2^2)*VX
VW = 371.9975
icalc                         % Iterated use of icalc
Enter row matrix of X-values  x
Enter row matrix of Y-values  x
Enter X probabilities  px
Enter Y probabilities  px
Use array operations on matrices X, Y, PX, PY, t, u, and P
G = 3*t - 4*u;
[R,PR] = csort(G,P);
icalc
Enter row matrix of X-values  R
Enter row matrix of Y-values  x
Enter X probabilities  PR
Enter Y probabilities  px
Use array operations on matrices X, Y, PX, PY, t, u, and P
H = t + 2*u;
[W,PW] = csort(H,P);
EW = dot(W,PW)
EW =   1.6500
VW = dot(W.^2,PW) - EW^2
VW = 371.9975
icalc3                        % Use of icalc3
Enter row matrix of X-values  x
Enter row matrix of Y-values  x
Enter row matrix of Z-values  x
Enter X probabilities  px
Enter Y probabilities  px
Enter Z probabilities  px
Use array operations on matrices X, Y, Z,
PX, PY, PZ, t, u, v, and P
S = 3*t - 4*u + 2*v;
[w,pw] = csort(S,P);
Ew = dot(w,pw)
Ew =   1.6500
Vw = dot(w.^2,pw) - Ew^2
Vw = 371.9975


## Exercise 32

fXY(t,u)=388(2t+3u2)fXY(t,u)=388(2t+3u2) for 0t20t2, 0u1+t0u1+t (see Exercise 25 and Exercise 37 from "Problems on Mathematical Expectation").

Z = I [ 0 , 1 ] ( X ) 4 X + I ( 1 , 2 ] ( X ) ( X + Y ) Z = I [ 0 , 1 ] ( X ) 4 X + I ( 1 , 2 ] ( X ) ( X + Y )
(57)
E [ X ] = 313 220 , E [ Z ] = 5649 1760 , E [ Z 2 ] = 4881 440 E [ X ] = 313 220 , E [ Z ] = 5649 1760 , E [ Z 2 ] = 4881 440
(58)

Determine Var [Z] Var [Z] and Cov [X,Z] Cov [X,Z]. Check with discrete approximation.

### Solution

E [ X Z ] = 3 88 0 1 0 1 + t 4 t 2 ( 2 t + 3 u 2 ) d u d t + 3 88 1 2 0 1 + t t ( t + u ) ( 2 t + 3 u 2 ) d u d t = 16931 3520 E [ X Z ] = 3 88 0 1 0 1 + t 4 t 2 ( 2 t + 3 u 2 ) d u d t + 3 88 1 2 0 1 + t t ( t + u ) ( 2 t + 3 u 2 ) d u d t = 16931 3520
(59)
Var [ Z ] = E [ Z 2 ] - E 2 [ Z ] = 2451039 3097600 Cov [ X , Z ] = E [ X Z ] - E [ X ] E [ Z ] = 94273 387200 Var [ Z ] = E [ Z 2 ] - E 2 [ Z ] = 2451039 3097600 Cov [ X , Z ] = E [ X Z ] - E [ X ] E [ Z ] = 94273 387200
(60)
tuappr: [0 2] [0 3] 200 300 (3/88)*(2*t+3*u.^2).*(u<=1+t)
G = 4*t.*(t<=1) + (t+u).*(t>1);
EZ = total(G.*P)
EZ = 3.2110
EX = dot(X,PX)
EX = 1.4220
CV = total(G.*t.*P) - EX*EZ
CV = 0.2445                       % Theoretical 0.2435
VZ = total(G.^2.*P) - EZ^2
VZ = 0.7934                       % Theoretical 0.7913


## Exercise 33

fXY(t,u)=2411tufXY(t,u)=2411tu for 0t20t2, 0umin{1,2-t}0umin{1,2-t} (see Exercise 27 and Exercise 38 from "Problems on Mathematical Expectation").

Z = I M ( X , Y ) 1 2 X + I M c ( X , Y ) Y 2 , M = { ( t , u ) : u > t } Z = I M ( X , Y ) 1 2 X + I M c ( X , Y ) Y 2 , M = { ( t , u ) : u > t }
(61)
E [ X ] = 52 55 , E [ Z ] = 16 55 , E [ Z 2 ] = 39 308 E [ X ] = 52 55 , E [ Z ] = 16 55 , E [ Z 2 ] = 39 308
(62)

Determine Var [Z] Var [Z] and Cov [X,Z] Cov [X,Z]. Check with discrete approximation.

### Solution

E [ X Z ] = 24 11 0 1 t 1 t ( t / 2 ) t u d u d t + 24 11 0 1 0 t t u 2 t u d u d t + 24 11 1 2 0 2 - t t t u 2 t u d u d t = 211 770 E [ X Z ] = 24 11 0 1 t 1 t ( t / 2 ) t u d u d t + 24 11 0 1 0 t t u 2 t u d u d t + 24 11 1 2 0 2 - t t t u 2 t u d u d t = 211 770
(63)
Var [ Z ] = E [ Z 2 ] - E 2 [ Z ] = 3557 84700 Cov [ Z , X ] = E [ X Z ] - E [ X ] E [ Z ] = - 43 42350 Var [ Z ] = E [ Z 2 ] - E 2 [ Z ] = 3557 84700 Cov [ Z , X ] = E [ X Z ] - E [ X ] E [ Z ] = - 43 42350
(64)
tuappr:  [0 2] [0 1] 400 200 (24/11)*t.*u.*(u<=min(1,2-t))
G = (t/2).*(u>t) + u.^2.*(u<=t);
VZ = total(G.^2.*P) - EZ^2
VZ =   0.0425
CV = total(t.*G.*P) - EZ*dot(X,PX)
CV = -9.2940e-04


## Exercise 34

fXY(t,u)=323(t+2u)fXY(t,u)=323(t+2u) for 0t20t2, 0umax{2-t,t}0umax{2-t,t} (see Exercise 28 and Exercise 39 from "Problems on Mathematical Expectation").

Z = I M ( X , Y ) ( X + Y ) + I M c ( X , Y ) 2 Y , M = { ( t , u ) : max ( t , u ) 1 } Z = I M ( X , Y ) ( X + Y ) + I M c ( X , Y ) 2 Y , M = { ( t , u ) : max ( t , u ) 1 }
(65)
E [ X ] = 53 46 , E [ Z ] = 175 92 , E [ Z 2 ] = 2063 460 E [ X ] = 53 46 , E [ Z ] = 175 92 , E [ Z 2 ] = 2063 460
(66)

Determine Var [Z] Var [Z] and Cov [Z] Cov [Z]. Check with discrete approximation.

### Solution

E [ Z X ] = 3 23 0 1 0 1 t ( t + u ) ( t + 2 u ) d u d t + 3 23 0 1 1 2 - t 2 t u ( t + 2 u ) d u d t + E [ Z X ] = 3 23 0 1 0 1 t ( t + u ) ( t + 2 u ) d u d t + 3 23 0 1 1 2 - t 2 t u ( t + 2 u ) d u d t +
(67)
3 23 1 2 1 t 2 t u ( t + 2 u ) d u d t = 1009 460 3 23 1 2 1 t 2 t u ( t + 2 u ) d u d t = 1009 460
(68)
Var [ Z ] = E [ Z 2 ] - E 2 [ Z ] = 36671 42320 Cov [ Z , X ] = E [ Z X ] - E [ Z ] E [ X ] = 39 21160 Var [ Z ] = E [ Z 2 ] - E 2 [ Z ] = 36671 42320 Cov [ Z , X ] = E [ Z X ] - E [ Z ] E [ X ] = 39 21160
(69)
tuappr:  [0 2] [0 2] 400 400 (3/23)*(t+2*u).*(u<=max(2-t,t))
M = max(t,u)<=1;
G = (t+u).*M + 2*u.*(1-M);
EZ = total(G.*P);
EX = dot(X,PX);
CV = total(t.*G.*P) - EX*EZ
CV =  0.0017


## Exercise 35

fXY(t,u)=12179(3t2+u)fXY(t,u)=12179(3t2+u), for 0t20t2, 0umin{2,3-t}0umin{2,3-t} (see Exercise 29 and Exercise 40 from "Problems on Mathematical Expectation").

Z = I M ( X , Y ) ( X + Y ) + I M c ( X , Y ) 2 Y 2 , M = { ( t , u ) : t 1 , u 1 } Z = I M ( X , Y ) ( X + Y ) + I M c ( X , Y ) 2 Y 2 , M = { ( t , u ) : t 1 , u 1 }
(70)
E [ X ] = 2313 1790 , E [ Z ] = 1422 895 , E [ Z 2 ] = 28296 6265 E [ X ] = 2313 1790 , E [ Z ] = 1422 895 , E [ Z 2 ] = 28296 6265
(71)

Determine Var [Z] Var [Z] and Cov [X,Z] Cov [X,Z]. Check with discrete approximation.

### Solution

E [ Z X ] = 12 179 0 1 1 2 t ( t + u ) ( 3 t 2 + u ) d u d t + 12 179 0 1 0 1 2 t u 2 ( 3 t 2 + u ) d u d t + E [ Z X ] = 12 179 0 1 1 2 t ( t + u ) ( 3 t 2 + u ) d u d t + 12 179 0 1 0 1 2 t u 2 ( 3 t 2 + u ) d u d t +
(72)
12 179 1 2 0 3 - t 2 t u 2 ( 3 t 2 + u ) d u d t = 24029 12530 12 179 1 2 0 3 - t 2 t u 2 ( 3 t 2 + u ) d u d t = 24029 12530
(73)
Var [ Z ] = E [ Z 2 ] - E 2 [ Z ] = 11170332 5607175 Cov [ Z , X ] = E [ Z X ] - E [ Z ] E [ X ] = - 1517647 11214350 Var [ Z ] = E [ Z 2 ] - E 2 [ Z ] = 11170332 5607175 Cov [ Z , X ] = E [ Z X ] - E [ Z ] E [ X ] = - 1517647 11214350
(74)
tuappr:  [0 2] [0 2] 400 400 (12/179)*(3*t.^2 + u).*(u <= min(2,3-t))
M = (t<=1)&(u>=1);
G = (t + u).*M + 2*u.^2.*(1 - M);
EZ = total(G.*P);
EX = dot(X,PX);
CV = total(t.*G.*P) - EZ*EX
CV = -0.1347


## Exercise 36

fXY(t,u)=12227(3t+2tu)fXY(t,u)=12227(3t+2tu), for 0t20t2, 0umin{1+t,2}0umin{1+t,2} (see Exercise 30 and Exercise 41 from "Problems on Mathematical Expectation").

Z = I M ( X , Y ) X + I M c ( X , Y ) X Y , M = { ( t , u ) : u min ( 1 , 2 - t ) } Z = I M ( X , Y ) X + I M c ( X , Y ) X Y , M = { ( t , u ) : u min ( 1 , 2 - t ) }
(75)
E [ X ] = 1567 1135 , E [ Z ] = 5774 3405 , E [ Z 2 ] = 56673 15890 E [ X ] = 1567 1135 , E [ Z ] = 5774 3405 , E [ Z 2 ] = 56673 15890
(76)

Determine Var [Z] Var [Z] and Cov [X,Z] Cov [X,Z]. Check with discrete approximation.

### Solution

E [ Z X ] = 12 227 0 1 0 1 t 2 ( 3 t + 2 t u ) d u d t + 12 227 1 2 0 2 - t t 2 ( 3 t + 2 t u ) d u d t + E [ Z X ] = 12 227 0 1 0 1 t 2 ( 3 t + 2 t u ) d u d t + 12 227 1 2 0 2 - t t 2 ( 3 t + 2 t u ) d u d t +
(77)
12 227 0 1 1 1 + t t 2 u ( 3 t + 2 t u ) d u d t + 12 227 1 2 2 - t 2 t 2 u ( 3 t + 2 t u ) d u d t = 20338 7945 12 227 0 1 1 1 + t t 2 u ( 3 t + 2 t u ) d u d t + 12 227 1 2 2 - t 2 t 2 u ( 3 t + 2 t u ) d u d t = 20338 7945
(78)
Var [ Z ] = E [ Z 2 ] - E 2 [ Z ] = 112167631 162316350 Cov [ Z , X ] = E [ Z X ] - E [ Z ] E [ X ] = 5915884 27052725 Var [ Z ] = E [ Z 2 ] - E 2 [ Z ] = 112167631 162316350 Cov [ Z , X ] = E [ Z X ] - E [ Z ] E [ X ] = 5915884 27052725
(79)
tuappr: [0 2] [0 2] 400 400 (12/227)*(3*t + 2*t.*u).*(u <= min(1+t,2))
EX = dot(X,PX);
M = u <= min(1,2-t);
G = t.*M + t.*u.*(1 - M);
EZ = total(G.*P);
EZX = total(t.*G.*P)
EZX =  2.5597
CV = EZX - EX*EZ
CV =   0.2188
VZ = total(G.^2.*P) - EZ^2
VZ =   0.6907


## Exercise 37

(See Exercise 20, and Exercises 9 and 10 from "Problems on Functions of Random Variables"). For the pair {X,Y}{X,Y} in Exercise 20, let

Z = g ( X , Y ) = 3 X 2 + 2 X Y - Y 2 Z = g ( X , Y ) = 3 X 2 + 2 X Y - Y 2
(80)
W = h ( X , Y ) = X for X + Y 4 2 Y for X + Y > 4 = I M ( X , Y ) X + I M c ( X , Y ) 2 Y W = h ( X , Y ) = X for X + Y 4 2 Y for X + Y > 4 = I M ( X , Y ) X + I M c ( X , Y ) 2 Y
(81)

Determine the joint distribution for the pair {Z,W}{Z,W} and determine the regression line of W on Z.

### Solution

npr08_07
Data are in X, Y, P
jointzw
Enter joint prob for (X,Y) P
Enter values for X X
Enter values for Y Y
Enter expression for g(t,u) 3*t.^2 + 2*t.*u - u.^2
Enter expression for h(t,u) t.*(t+u<=4) + 2*u.*(t+u>4)
Use array operations on Z, W, PZ, PW, v, w, PZW
EZ = dot(Z,PZ)
EZ =    5.2975
EW = dot(W,PW)
EW =    4.7379
VZ = dot(Z.^2,PZ) - EZ^2
VZ =    1.0588e+03
CZW = total(v.*w.*PZW) - EZ*EW
CZW = -12.1697
a = CZW/VZ
a =   -0.0115
b = EW - a*EZ
b =    4.7988                 % Regression line: w = av + b


## Content actions

PDF | EPUB (?)

### What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks