# Connexions

You are here: Home » Content » Applied Probability » Problems on Conditional Expectation, Regression

• Preface to Pfeiffer Applied Probability

### 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 collection is included in aLens by: Digital Scholarship at Rice University

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

#### Also in these lenses

• UniqU content

This collection is included inLens: UniqU's lens
By: UniqU, LLC

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

### Recently Viewed

This feature requires Javascript to be enabled.

Inside Collection:

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

# Problems on Conditional Expectation, Regression

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

For the distributions in Exercises 1-3

1. Determine the regression curve of Y on X and compare with the regression line of Y on X.
2. For the function Z=g(X,Y)Z=g(X,Y) indicated in each case, determine the regression curve of Z on X.

## Exercise 1

(See 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 )
(1)
 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

The regression line of Y on X is u=0.5275t+0.6924u=0.5275t+0.6924.

Z = X 2 Y + | X + Y | Z = X 2 Y + | X + Y |
(2)

### Solution

The regression line of Y on X is u=0.5275t+0.6924u=0.5275t+0.6924.

npr08_07
Data are in X, Y, P
jcalc
- - - - - - - - - - -
EYx = sum(u.*P)./sum(P);
disp([X;EYx]')
-3.1000   -0.0290
-0.5000   -0.6860
1.2000    1.3270
2.4000    2.1960
3.7000    3.8130
4.9000    2.5700
G = t.^2.*u + abs(t+u);
EZx = sum(G.*P)./sum(P);
disp([X;EZx]')
-3.1000    4.0383
-0.5000    3.5345
1.2000    6.0139
2.4000   17.5530
3.7000   59.7130
4.9000   69.1757


## Exercise 2

(See 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 )
(3)
 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

The regression line of Y on X is u=-0.2584t+5.6110u=-0.2584t+5.6110.

Z = I Q ( X , Y ) X ( Y - 4 ) + I Q c ( X , Y ) X Y 2 Q = { ( t , u ) : u t } Z = I Q ( X , Y ) X ( Y - 4 ) + I Q c ( X , Y ) X Y 2 Q = { ( t , u ) : u t }
(4)

### Solution

The regression line of Y on X is u=-0.2584t+5.6110u=-0.2584t+5.6110.

npr08_08
Data are in X, Y, P
jcalc
- - - - - - - - - - - -
EYx = sum(u.*P)./sum(P);
disp([X;EYx]')
1.0000    5.5350
3.0000    5.9869
5.0000    3.6500
7.0000    2.3100
9.0000    2.0254
11.0000    2.9100
13.0000    3.1957
15.0000    0.9100
17.0000    1.5254
19.0000    0.9100
M = u<=t;
G = (u-4).*sqrt(t).*M + t.*u.^2.*(1-M);
EZx = sum(G.*P)./sum(P);
disp([X;EZx]')
1.0000   58.3050
3.0000  166.7269
5.0000  175.9322
7.0000  185.7896
9.0000  119.7531
11.0000  105.4076
13.0000   -2.8999
15.0000  -11.9675
17.0000  -10.2031
19.0000  -13.4690


## Exercise 3

(See 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 )
(5)
 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

The regression line of Y on X is u=-0.7793t+4.3051u=-0.7793t+4.3051.

Z = ( Y - 2 . 8 ) / X Z = ( Y - 2 . 8 ) / X
(6)

### Solution

The regression line of Y on X is u=-0.7793t+4.3051u=-0.7793t+4.3051.

npr08_09
Data are in X, Y, P
jcalc
- - - - - - - - - - - -
EYx = sum(u.*P)./sum(P);
disp([X;EYx]')
1.0000    3.8333
1.5000    3.1250
2.0000    2.5175
2.5000    2.3933
3.0000    2.3900
G = (u - 2.8)./t;
EZx = sum(G.*P)./sum(P);
disp([X;EZx]')
1.0000    1.0333
1.5000    0.2167
2.0000   -0.1412
2.5000   -0.1627
3.0000   -0.1367


For the joint densities in Exercises 4-11 below

1. Determine analytically the regression curve of Y on X and compare with the regression line of Y on X.
2. Check these with a discrete approximation.

## Exercise 4

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

The regression line of Y on X is u=1-tu=1-t.

f X ( t ) = 2 ( 1 - t ) , 0 t 1 f X ( t ) = 2 ( 1 - t ) , 0 t 1
(7)

### Solution

The regression line of Y on X is u=1-tu=1-t.

f Y | X ( u | t ) = 1 2 ( 1 - t ) , 0 t 1 , 0 u 2 ( 1 - t ) f Y | X ( u | t ) = 1 2 ( 1 - t ) , 0 t 1 , 0 u 2 ( 1 - t )
(8)
E [ Y | X = t ] = 1 2 ( 1 - t ) 0 2 ( 1 - t ) u d u = 1 - t , 0 t 1 E [ Y | X = t ] = 1 2 ( 1 - t ) 0 2 ( 1 - t ) u d u = 1 - t , 0 t 1
(9)
tuappr: [0 1] [0 2] 200 400 u<=2*(1-t)
- - - - - - - - - - - - -
EYx = sum(u.*P)./sum(P);
plot(X,EYx)   % Straight line thru  (0,1), (1,0)


## Exercise 5

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

The regression line of Y on X is u=-t/11+35/33u=-t/11+35/33.

f X ( t ) = 1 4 ( t + 1 ) , 0 t 2 f X ( t ) = 1 4 ( t + 1 ) , 0 t 2
(10)

### Solution

The regression line of Y on X is u=-t/11+35/33u=-t/11+35/33.

f Y | X ( u | t ) = ( t + u ) 2 ( t + 1 ) 0 t 2 , 0 u 2 f Y | X ( u | t ) = ( t + u ) 2 ( t + 1 ) 0 t 2 , 0 u 2
(11)
E [ Y | X = t ] = 1 2 ( t + 1 ) 0 2 ( t u + u 2 ) d u = 1 + 1 3 t + 3 0 t 2 E [ Y | X = t ] = 1 2 ( t + 1 ) 0 2 ( t u + u 2 ) d u = 1 + 1 3 t + 3 0 t 2
(12)
tuappr: [0 2] [0 2] 200 200 (1/8)*(t+u)
EYx = sum(u.*P)./sum(P);
eyx = 1 + 1./(3*X+3);
plot(X,EYx,X,eyx)            % Plots nearly indistinguishable


## Exercise 6

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

The regression line of Y on X is u=0.0958t+1.4876u=0.0958t+1.4876.

f X ( t ) = 3 88 ( 1 + t ) ( 1 + 4 t + t 2 ) = 3 88 ( 1 + 5 t + 5 t 2 + t 3 ) , 0 t 2 f X ( t ) = 3 88 ( 1 + t ) ( 1 + 4 t + t 2 ) = 3 88 ( 1 + 5 t + 5 t 2 + t 3 ) , 0 t 2
(13)

### Solution

The regression line of Y on X is u=0.0958t+1.4876u=0.0958t+1.4876.

f Y | X ( u | t ) = 2 t + 3 u 2 ( 1 + t ) ( 1 + 4 t + t 2 ) 0 u 1 + t f Y | X ( u | t ) = 2 t + 3 u 2 ( 1 + t ) ( 1 + 4 t + t 2 ) 0 u 1 + t
(14)
E [ Y | X = t ] = 1 ( 1 + t ) ( 1 + 4 t + t 2 ) 0 1 + t ( 2 t u + 3 u 3 ) d u E [ Y | X = t ] = 1 ( 1 + t ) ( 1 + 4 t + t 2 ) 0 1 + t ( 2 t u + 3 u 3 ) d u
(15)
= ( t + 1 ) ( t + 3 ) ( 3 t + 1 ) 4 ( 1 + 4 t + t 2 ) , 0 t 2 = ( t + 1 ) ( t + 3 ) ( 3 t + 1 ) 4 ( 1 + 4 t + t 2 ) , 0 t 2
(16)
tuappr:  [0 2] [0 3] 200 300 (3/88)*(2*t + 3*u.^2).*(u<=1+t)
EYx = sum(u.*P)./sum(P);
eyx = (X+1).*(X+3).*(3*X+1)./(4*(1 + 4*X + X.^2));
plot(X,EYx,X,eyx)            % Plots nearly indistinguishable


## Exercise 7

(See Exercise 16 from " Problems On Random Vectors and Joint Distributions", Exercise 26 from "Problems on Mathematical Expectation", and Exercise 26 from "Problems on Variance, Covariance, Linear Regression"). 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 )
(17)

The regression line of Y on X is u=(4t+5)/9u=(4t+5)/9.

f X ( t ) = I [ - 1 , 0 ] ( t ) 6 t 2 ( t + 1 ) 2 + I ( 0 , 1 ] ( t ) 6 t 2 ( 1 - t 2 ) f X ( t ) = I [ - 1 , 0 ] ( t ) 6 t 2 ( t + 1 ) 2 + I ( 0 , 1 ] ( t ) 6 t 2 ( 1 - t 2 )
(18)

### Solution

The regression line of Y on X is u=(23t+4)/18u=(23t+4)/18.

f Y | X ( u | t ) = I [ - 1 , 0 ] ( t ) 2 u ( t + 1 ) 2 + I ( 0 , 1 ] ( t ) 2 u ( 1 - t 2 ) on the parallelogram f Y | X ( u | t ) = I [ - 1 , 0 ] ( t ) 2 u ( t + 1 ) 2 + I ( 0 , 1 ] ( t ) 2 u ( 1 - t 2 ) on the parallelogram
(19)
E [ Y | X = t ] = I [ - 1 , 0 ] ( t ) 1 ( t + 1 ) 2 0 t + 1 2 u d u + I ( 0 , 1 ] ( t ) 1 ( 1 - t 2 ) t 1 2 u d u E [ Y | X = t ] = I [ - 1 , 0 ] ( t ) 1 ( t + 1 ) 2 0 t + 1 2 u d u + I ( 0 , 1 ] ( t ) 1 ( 1 - t 2 ) t 1 2 u d u
(20)
= I [ - 1 , 0 ] ( t ) 2 3 ( t + 1 ) + I ( 0 , 1 ] ( t ) 2 3 t 2 + t + 1 t + 1 = I [ - 1 , 0 ] ( t ) 2 3 ( t + 1 ) + I ( 0 , 1 ] ( t ) 2 3 t 2 + t + 1 t + 1
(21)
tuappr: [-1 1] [0 1] 200 100 12*t.^2.*u.*((u<= min(t+1,1))&(u>=max(0,t)))
EYx = sum(u.*P)./sum(P);
M = X<=0;
eyx = (2/3)*(X+1).*M + (2/3)*(1-M).*(X.^2 + X + 1)./(X + 1);
plot(X,EYx,X,eyx)            % Plots quite close


## Exercise 8

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

The regression line of Y on X is u=(-124t+368)/431u=(-124t+368)/431

f X ( t ) = I [ 0 , 1 ] ( t ) 12 11 t + I ( 1 , 2 ] ( t ) 12 11 t ( 2 - t ) 2 f X ( t ) = I [ 0 , 1 ] ( t ) 12 11 t + I ( 1 , 2 ] ( t ) 12 11 t ( 2 - t ) 2
(22)

### Solution

The regression line of Y on X is u=(-124t+368)/431u=(-124t+368)/431.

f Y | X ( u | t ) = I [ 0 , 1 ] ( t ) 2 u + I ( 1 , 2 ] ( t ) 2 u ( 2 - t ) 2 f Y | X ( u | t ) = I [ 0 , 1 ] ( t ) 2 u + I ( 1 , 2 ] ( t ) 2 u ( 2 - t ) 2
(23)
E [ Y | X = t ] = I [ 0 , 1 ] ( t ) 0 1 2 u 2 d u + I ( 1 , 2 ] ( t ) 1 ( 2 - t ) 2 0 2 - t 2 u 2 d u E [ Y | X = t ] = I [ 0 , 1 ] ( t ) 0 1 2 u 2 d u + I ( 1 , 2 ] ( t ) 1 ( 2 - t ) 2 0 2 - t 2 u 2 d u
(24)
= I [ 0 , 1 ] ( t ) 2 3 + I ( 1 , 2 ] ( t ) 2 3 ( 2 - t ) = I [ 0 , 1 ] ( t ) 2 3 + I ( 1 , 2 ] ( t ) 2 3 ( 2 - t )
(25)
tuappr: [0 2] [0 1] 200 100 (24/11)*t.*u.*(u<=min(1,2-t))
EYx = sum(u.*P)./sum(P);
M = X <= 1;
eyx = (2/3)*M + (2/3).*(2 - X).*(1-M);
plot(X,EYx,X,eyx)            % Plots quite close


## Exercise 9

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

The regression line of Y on X is u=1.0561t-0.2603u=1.0561t-0.2603.

f X ( t ) = I [ 0 , 1 ] ( t ) 6 23 ( 2 - t ) + I ( 1 , 2 ] ( t ) 6 23 t 2 f X ( t ) = I [ 0 , 1 ] ( t ) 6 23 ( 2 - t ) + I ( 1 , 2 ] ( t ) 6 23 t 2
(26)

### Solution

The regression line of Y on X is u=1.0561t-0.2603u=1.0561t-0.2603.

f Y | X ( u | t ) = I [ 0 , 1 ] ( t ) t + 2 u 2 ( 2 - t ) + I ( 1 , 2 ] ( t ) t + 2 u 2 t 2 0 u max ( 2 - t , t ) f Y | X ( u | t ) = I [ 0 , 1 ] ( t ) t + 2 u 2 ( 2 - t ) + I ( 1 , 2 ] ( t ) t + 2 u 2 t 2 0 u max ( 2 - t , t )
(27)
E [ Y | X = t ] = I [ 0 , 1 ] ( t ) 1 2 ( 2 - t ) 0 2 - t ( t u + 2 u 2 ) d u + I ( 1 , 2 ] ( t ) 1 2 t 2 0 t ( t u + 2 u 2 ) d u E [ Y | X = t ] = I [ 0 , 1 ] ( t ) 1 2 ( 2 - t ) 0 2 - t ( t u + 2 u 2 ) d u + I ( 1 , 2 ] ( t ) 1 2 t 2 0 t ( t u + 2 u 2 ) d u
(28)
= I [ 0 , 1 ] ( t ) 1 12 ( t - 2 ) ( t - 8 ) + I ( 1 , 2 ] ( t ) 7 12 t = I [ 0 , 1 ] ( t ) 1 12 ( t - 2 ) ( t - 8 ) + I ( 1 , 2 ] ( t ) 7 12 t
(29)
tuappr:  [0 2] [0 2] 200 200 (3/23)*(t+2*u).*(u<=max(2-t,t))
EYx = sum(u.*P)./sum(P);
M = X<=1;
eyx = (1/12)*(X-2).*(X-8).*M + (7/12)*X.*(1-M);
plot(X,EYx,X,eyx)             % Plots quite close


## Exercise 10

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

The regression line of Y on X is u=-0.1359t+1.0839u=-0.1359t+1.0839.

f X ( t ) = I [ 0 , 1 ] ( t ) 12 13 t 2 + I ( 1 , 2 ] ( t ) 6 13 ( 3 - t ) f X ( t ) = I [ 0 , 1 ] ( t ) 12 13 t 2 + I ( 1 , 2 ] ( t ) 6 13 ( 3 - t )
(30)

### Solution

The regression line of Y on X is u=-0.1359t+1.0839u=-0.1359t+1.0839.

f Y | X ( t | u ) = I [ 0 , 1 ] ( t ) t + 2 u 6 t 2 + I ( 1 , 2 ] ( t ) t + 2 u 3 ( 3 - t ) 0 u max ( 2 t , 3 - t ) f Y | X ( t | u ) = I [ 0 , 1 ] ( t ) t + 2 u 6 t 2 + I ( 1 , 2 ] ( t ) t + 2 u 3 ( 3 - t ) 0 u max ( 2 t , 3 - t )
(31)
E [ Y | X = t ] = I [ 0 , 1 ] ( t ) 1 6 t 2 0 t ( t u + 2 u 2 ) d u + I ( 1 , 2 ] ( t ) 1 3 ( 3 - t ) 0 3 - t ( t u + 2 u 2 ) d u E [ Y | X = t ] = I [ 0 , 1 ] ( t ) 1 6 t 2 0 t ( t u + 2 u 2 ) d u + I ( 1 , 2 ] ( t ) 1 3 ( 3 - t ) 0 3 - t ( t u + 2 u 2 ) d u
(32)
= I [ 0 , 1 ] ( t ) 11 9 t + I ( 1 , 2 ] ( t ) 1 18 ( t 2 - 15 t + 36 ) = I [ 0 , 1 ] ( t ) 11 9 t + I ( 1 , 2 ] ( t ) 1 18 ( t 2 - 15 t + 36 )
(33)
tuappr: [0 2] [0 2] 200 200 (2/13)*(t+2*u).*(u<=min(2*t,3-t))
EYx = sum(u.*P)./sum(P);
M = X<=1;
eyx = (11/9)*X.*M + (1/18)*(X.^2 - 15*X + 36).*(1-M);
plot(X,EYx,X,eyx)              % Plots quite close


## Exercise 11

(See Exercise 22 from " Problems On Random Vectors and Joint Distributions", Exercise 32 from "Problems on Mathematical Expectation", and Exercise 30 from "Problems on Variance, Covariance, Linear Regression"). 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.

The regression line of Y on X is u=0.0817t+0.5989u=0.0817t+0.5989.

f X ( t ) = I [ 0 , 1 ] ( t ) 3 8 ( t 2 + 1 ) + I ( 1 , 2 ] ( t ) 3 14 t 2 f X ( t ) = I [ 0 , 1 ] ( t ) 3 8 ( t 2 + 1 ) + I ( 1 , 2 ] ( t ) 3 14 t 2
(34)

### Solution

The regression line of Y on X is u=0.0817t+0.5989u=0.0817t+0.5989.

f Y | X ( t | u ) = I [ 0 , 1 ] ( t ) t 2 + 2 u t 2 + 1 + I ( 1 , 2 ] ( t ) 3 u 2 0 u 1 f Y | X ( t | u ) = I [ 0 , 1 ] ( t ) t 2 + 2 u t 2 + 1 + I ( 1 , 2 ] ( t ) 3 u 2 0 u 1
(35)
E [ Y | X = t ] = I [ 0 , 1 ] ( t ) 1 t 2 + 1 0 1 ( t 2 u + 2 u 2 ) d u + I ( 1 , 2 ] ( t ) 0 1 3 u 3 d u E [ Y | X = t ] = I [ 0 , 1 ] ( t ) 1 t 2 + 1 0 1 ( t 2 u + 2 u 2 ) d u + I ( 1 , 2 ] ( t ) 0 1 3 u 3 d u
(36)
= I [ 0 , 1 ] ( t ) 3 t 2 + 4 6 ( t 2 + 1 ) + I ( 1 , 2 ] ( t ) 3 4 = I [ 0 , 1 ] ( t ) 3 t 2 + 4 6 ( t 2 + 1 ) + I ( 1 , 2 ] ( t ) 3 4
(37)
tuappr: [0 2] [0 1] 200 100 (3/8)*(t.^2 + 2*u).*(t<=1) + ...
(9/14)*t.^2.*u.^2.*(t>1)
EYx = sum(u.*P)./sum(P);
M = X<=1;
eyx = M.*(3*X.^2 + 4)./(6*(X.^2 + 1)) + (3/4)*(1 - M);
plot(X,EYx,X,eyx)              % Plots quite close


For the distributions in Exercises 12-16 below

1. Determine analytically E[Z|X=t]E[Z|X=t]
2. Use a discrete approximation to calculate the same functions.

## Exercise 12

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

f X ( t ) = 3 88 ( 1 + t ) ( 1 + 4 t + t 2 ) = 3 88 ( 1 + 5 t + 5 t 2 + t 3 ) , 0 t 2 f X ( t ) = 3 88 ( 1 + t ) ( 1 + 4 t + t 2 ) = 3 88 ( 1 + 5 t + 5 t 2 + t 3 ) , 0 t 2
(38)
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 )
(39)

### Solution

Z=IM(X)4X+IN(X)(X+Y)Z=IM(X)4X+IN(X)(X+Y), Use of linearity, (CE8), and (CE10) gives

E [ Z | X = t ] = I M ( t ) 4 t + I N ( t ) ( t + E [ Y | X = t ] ) E [ Z | X = t ] = I M ( t ) 4 t + I N ( t ) ( t + E [ Y | X = t ] )
(40)
= I M ( t ) 4 t + I N ( t ) t + ( t + 1 ) ( t + 3 ) ( 3 t + 1 ) 4 ( 1 + 4 t + t 2 ) = I M ( t ) 4 t + I N ( t ) t + ( t + 1 ) ( t + 3 ) ( 3 t + 1 ) 4 ( 1 + 4 t + t 2 )
(41)
% Continuation of Exercise 6
G = 4*t.*(t<=1) + (t + u).*(t>1);
EZx = sum(G.*P)./sum(P);
M = X<=1;
ezx = 4*X.*M + (X + (X+1).*(X+3).*(3*X+1)./(4*(1 + 4*X + X.^2))).*(1-M);
plot(X,EZx,X,ezx)              % Plots nearly indistinguishable


## Exercise 13

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

f X ( t ) = I [ 0 , 1 ] ( t ) 12 11 t + I ( 1 , 2 ] ( t ) 12 11 t ( 2 - t ) 2 f X ( t ) = I [ 0 , 1 ] ( t ) 12 11 t + I ( 1 , 2 ] ( t ) 12 11 t ( 2 - t ) 2
(42)
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 }
(43)

### Solution

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 }
(44)
I M ( t , u ) = I [ 0 , 1 ] ( t ) I [ t , 1 ] ( u ) I M c ( t , u ) = I [ 0 , 1 ] ( t ) I [ 0 , t ] ( u ) + I ( 1 , 2 ] ( t ) I [ 0 , 2 - t ] ( u ) I M ( t , u ) = I [ 0 , 1 ] ( t ) I [ t , 1 ] ( u ) I M c ( t , u ) = I [ 0 , 1 ] ( t ) I [ 0 , t ] ( u ) + I ( 1 , 2 ] ( t ) I [ 0 , 2 - t ] ( u )
(45)
E [ Z | X = t ] = I [ 0 , 1 ] ( t ) t 2 t 1 2 u d u + 0 t u 2 · 2 u d u + I ( 1 , 2 ] ( t ) 0 2 - t u 2 · 2 u ( 2 - t ) 2 d u E [ Z | X = t ] = I [ 0 , 1 ] ( t ) t 2 t 1 2 u d u + 0 t u 2 · 2 u d u + I ( 1 , 2 ] ( t ) 0 2 - t u 2 · 2 u ( 2 - t ) 2 d u
(46)
= I [ 0 , 1 ] ( t ) 1 2 t ( 1 - t 2 + t 3 ) + I ( 1 , 2 ] ( t ) 1 2 ( 2 - t ) 2 = I [ 0 , 1 ] ( t ) 1 2 t ( 1 - t 2 + t 3 ) + I ( 1 , 2 ] ( t ) 1 2 ( 2 - t ) 2
(47)
% Continuation of Exercise 6
Q = u>t;
G = (1/2)*t.*Q + u.^2.*(1-Q);
EZx = sum(G.*P)./sum(P);
M = X <= 1;
ezx = (1/2)*X.*(1-X.^2+X.^3).*M + (1/2)*(2-X).^2.*(1-M);
plot(X,EZx,X,ezx)              % Plots nearly indistinguishable


## Exercise 14

fXY(t,u)=323(t+2u)fXY(t,u)=323(t+2u) for 0t20t2, 0umax{2-t,t}0umax{2-t,t} (see Exercise 39, and Exercise 9).

f X ( t ) = I [ 0 , 1 ] ( t ) 6 23 ( 2 - t ) + I ( 1 , 2 ] ( t ) 6 23 t 2 f X ( t ) = I [ 0 , 1 ] ( t ) 6 23 ( 2 - t ) + I ( 1 , 2 ] ( t ) 6 23 t 2
(48)
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 }
(49)

### Solution

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 }
(50)
I M ( t , u ) = I [ 0 , 1 ] ( t ) I [ 0 , 1 ] ( u ) I M c ( t , u ) = I [ 0 , 1 ] ( t ) I [ 1 , 2 - t ] ( u ) + I ( 1 , 2 ] ( t ) I [ 0 , t ] ( u ) I M ( t , u ) = I [ 0 , 1 ] ( t ) I [ 0 , 1 ] ( u ) I M c ( t , u ) = I [ 0 , 1 ] ( t ) I [ 1 , 2 - t ] ( u ) + I ( 1 , 2 ] ( t ) I [ 0 , t ] ( u )
(51)
E [ Z | X = t ] = I [ 0 , 1 ] ( t ) 1 2 ( 2 - t ) 0 1 ( t + u ) ( t + 2 u ) d u + 1 ( 2 - t ) 1 2 - t u ( t + 2 u ) d u ] + I ( 1 , 2 ] ( t ) 2 E [ Y | X = t ] E [ Z | X = t ] = I [ 0 , 1 ] ( t ) 1 2 ( 2 - t ) 0 1 ( t + u ) ( t + 2 u ) d u + 1 ( 2 - t ) 1 2 - t u ( t + 2 u ) d u ] + I ( 1 , 2 ] ( t ) 2 E [ Y | X = t ]
(52)
= I [ 0 , 1 ] ( t ) 1 12 · 2 t 3 - 30 t 2 + 69 t - 60 t - 2 + I ( 1 , 2 ] ( t ) 7 6 2 t = I [ 0 , 1 ] ( t ) 1 12 · 2 t 3 - 30 t 2 + 69 t - 60 t - 2 + I ( 1 , 2 ] ( t ) 7 6 2 t
(53)
% Continuation of Exercise 9
M = X <= 1;
Q = (t<=1)&(u<=1);
G = (t+u).*Q + 2*u.*(1-Q);
EZx = sum(G.*P)./sum(P);
ezx = (1/12)*M.*(2*X.^3 - 30*X.^2 + 69*X -60)./(X-2) + (7/6)*X.*(1-M);
plot(X,EZx,X,ezx)


## Exercise 15

fXY(t,u)=213(t+2u)fXY(t,u)=213(t+2u), for 0t20t2, 0umin{2t,3-t}0umin{2t,3-t}. (see Exercise 31 from "Problems on Mathematical Expectation", and Exercise 10).

f X ( t ) = I [ 0 , 1 ] ( t ) 12 13 t 2 + I ( 1 , 2 ] ( t ) 6 13 ( 3 - t ) f X ( t ) = I [ 0 , 1 ] ( t ) 12 13 t 2 + I ( 1 , 2 ] ( t ) 6 13 ( 3 - t )
(54)
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 }
(55)

### Solution

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 }
(56)
I M ( t , u ) = I [ 0 , 1 ] ( t ) I [ 1 , 2 ] ( u ) I M c ( t , u ) = I [ 0 , 1 ] ( t ) I [ 0 , 1 ) ( u ) + I ( 1 , 2 ] ( t ) I [ 0 , 3 - t ] ( u ) I M ( t , u ) = I [ 0 , 1 ] ( t ) I [ 1 , 2 ] ( u ) I M c ( t , u ) = I [ 0 , 1 ] ( t ) I [ 0 , 1 ) ( u ) + I ( 1 , 2 ] ( t ) I [ 0 , 3 - t ] ( u )
(57)
E [ Z | X = t ] = I [ 0 , 1 / 2 ] ( t ) 1 6 t 2 0 2 t 2 u 2 ( t + 2 u ) d u + E [ Z | X = t ] = I [ 0 , 1 / 2 ] ( t ) 1 6 t 2 0 2 t 2 u 2 ( t + 2 u ) d u +
(58)
I ( 1 / 2 , 1 ] ( t ) 1 6 t 2 0 1 2 u 2 ( t + 2 u ) d u + 1 6 t 2 1 2 t ( t + u ) ( t + 2 u ) d u + I ( 1 , 2 ] ( t ) 1 3 ( 3 - t ) 0 3 - t 2 u 2 ( t + 2 u ) d u I ( 1 / 2 , 1 ] ( t ) 1 6 t 2 0 1 2 u 2 ( t + 2 u ) d u + 1 6 t 2 1 2 t ( t + u ) ( t + 2 u ) d u + I ( 1 , 2 ] ( t ) 1 3 ( 3 - t ) 0 3 - t 2 u 2 ( t + 2 u ) d u
(59)
= I [ 0 , 1 / 2 ] ( t ) 32 9 t 2 + I ( 1 / 2 , 1 ] ( t ) 1 36 · 80 t 3 - 6 t 2 - 5 t + 2 t 2 + I ( 1 , 2 ] ( t ) 1 9 ( - t 3 + 15 t 2 - 63 t + 81 ) = I [ 0 , 1 / 2 ] ( t ) 32 9 t 2 + I ( 1 / 2 , 1 ] ( t ) 1 36 · 80 t 3 - 6 t 2 - 5 t + 2 t 2 + I ( 1 , 2 ] ( t ) 1 9 ( - t 3 + 15 t 2 - 63 t + 81 )
(60)
tuappr:  [0 2] [0 2] 200 200 (2/13)*(t + 2*u).*(u<=min(2*t,3-t))
M = (t<=1)&(u>=1);
Q = (t+u).*M + 2*(1-M).*u.^2;
EZx = sum(Q.*P)./sum(P);
N1 = X <= 1/2;
N2 = (X > 1/2)&(X<=1);
N3 = X > 1;
ezx = (32/9)*N1.*X.^2 + (1/36)*N2.*(80*X.^3 - 6*X.^2 - 5*X + 2)./X.^2 ...
+ (1/9)*N3.*(-X.^3 + 15*X.^2 - 63.*X + 81);
plot(X,EZx,X,ezx)


## Exercise 16

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. (see Exercise 32 from "Problems on Mathematical Expectation", and Exercise 11).

f X ( t ) = I [ 0 , 1 ] ( t ) 3 8 ( t 2 + 1 ) + I ( 1 , 2 ] ( t ) 3 14 t 2 f X ( t ) = I [ 0 , 1 ] ( t ) 3 8 ( t 2 + 1 ) + I ( 1 , 2 ] ( t ) 3 14 t 2
(61)
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 ) }
(62)

### Solution

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 ) }
(63)
E [ | X = t ] = I [ 0 , 1 ] ( t ) 0 1 t 3 + 2 t u t 2 + 1 d u + I ( 1 , 2 ] ( t ) 0 2 - t 3 t u 2 d u + 2 - t 1 3 t u 3 d u E [ | X = t ] = I [ 0 , 1 ] ( t ) 0 1 t 3 + 2 t u t 2 + 1 d u + I ( 1 , 2 ] ( t ) 0 2 - t 3 t u 2 d u + 2 - t 1 3 t u 3 d u
(64)
= I [ 0 , 1 ] ( t ) t + I ( 1 , 2 ] ( t ) ( - 13 4 t + 12 t 2 - 12 t 3 + 5 t 4 - 3 4 t 5 ) = I [ 0 , 1 ] ( t ) t + I ( 1 , 2 ] ( t ) ( - 13 4 t + 12 t 2 - 12 t 3 + 5 t 4 - 3 4 t 5 )
(65)
tuappr:  [0 2] [0 1] 200 100  (t<=1).*(t.^2 + 2*u)./(t.^2 + 1) +3*u.^2.*(t>1)
M = u<=min(1,2-t);
G = M.*t + (1-M).*t.*u;
EZx = sum(G.*P)./sum(P);
N = X<=1;
ezx = X.*N + (1-N).*(-(13/4)*X + 12*X.^2 - 12*X.^3 + 5*X.^4 - (3/4)*X.^5);
plot(X,EZx,X,ezx)


## Exercise 17

Suppose XX uniform on 0 through n and YY conditionally uniform on 0 through i, given X=iX=i.

1. Determine E[Y]E[Y] from E[Y|X=i]E[Y|X=i].
2. Determine the joint distribution for {X,Y}{X,Y} for n=50n=50 (see Example 7 from "Conditional Expectation, Regression" for a possible approach). Use jcalc to determine E[Y]E[Y]; compare with the theoretical value.

### Solution

1. E[Y|X=i]=i/2E[Y|X=i]=i/2, so
E[Y]=i=0nE[Y|X=i]P(X=i)=1n+1i=1ni/2=n/4E[Y]=i=0nE[Y|X=i]P(X=i)=1n+1i=1ni/2=n/4
(66)
2. P(X=i)=1/(n+1),0inP(X=i)=1/(n+1),0in, P(Y=k|X=i)=1/(i+1),0kiP(Y=k|X=i)=1/(i+1),0ki; hence P(X=i,Y=k)=1/(n+1)(i+1)0in,0kiP(X=i,Y=k)=1/(n+1)(i+1)0in,0ki.
n = 50; X = 0:n; Y = 0:n;
P0 = zeros(n+1,n+1);
for i = 0:n
P0(i+1,1:i+1) = (1/((n+1)*(i+1)))*ones(1,i+1);
end
P = rot90(P0);
jcalc: X Y P
- - - - - - - - - - -
EY = dot(Y,PY)
EY = 12.5000        % Comparison with part (a):  50/4 = 12.5


## Exercise 18

Suppose XX uniform on 1 through n and YY conditionally uniform on 1 through i, given X=iX=i.

1. Determine E[Y]E[Y] from E[Y|X=i]E[Y|X=i].
2. Determine the joint distribution for {X,Y}{X,Y} for n=50n=50 (see Example 7 from "Conditional Expectation, Regression" for a possible approach). Use jcalc to determine E[Y]E[Y]; compare with the theoretical value.

### Solution

1. E[Y|X=i]=(i+1)/2E[Y|X=i]=(i+1)/2, so
E[Y]= i=1nE[Y|X=i]P(X=i)=1ni=1ni+12=n+34E[Y]= i=1nE[Y|X=i]P(X=i)=1ni=1ni+12=n+34
(67)
2. P(X=i)=1/n,1inP(X=i)=1/n,1in, P(Y=k|X=i)=1/i,1kiP(Y=k|X=i)=1/i,1ki; hence P(X=i,Y=k)=1/ni1in,1kiP(X=i,Y=k)=1/ni1in,1ki.
n = 50; X = 1:n; Y = 1:n;
P0 = zeros(n,n);
for i = 1:n
P0(i,1:i) = (1/(n*i))*ones(1,i);
end
P = rot90(P0);
jcalc:  P X Y
- - - - - - - - - - - -
EY = dot(Y,PY)
EY =  13.2500       % Comparison with part (a):  53/4 = 13.25


## Exercise 19

Suppose XX uniform on 1 through n and YY conditionally binomial (i,p)(i,p), given X=iX=i.

1. Determine E[Y]E[Y] from E[Y|X=k]E[Y|X=k].
2. Determine the joint distribution for {X,Y}{X,Y} for n=50n=50 and p=0.3p=0.3. Use jcalc to determine E[Y]E[Y]; compare with the theoretical value.

### Solution

1. E[Y|X=i]=ipE[Y|X=i]=ip, so
E[Y]= i=1nE[Y|X=i]P(X=i)=pn i=1ni=p(n+1)2E[Y]= i=1nE[Y|X=i]P(X=i)=pn i=1ni=p(n+1)2
(68)
2. P(X=i)=1/n,1inP(X=i)=1/n,1in, P(Y=k|X=i)=ibinom(i,p,0:i),0kiP(Y=k|X=i)=ibinom(i,p,0:i),0ki.
n = 50; p = 0.3; X = 1:n; Y = 0:n;
P0 = zeros(n,n+1);   % Could use randbern
for i = 1:n
P0(i,1:i+1) = (1/n)*ibinom(i,p,0:i);
end
P = rot90(P0);
jcalc: X Y P
- - - - - - - - - - -
EY = dot(Y,PY)
EY = 7.6500             %  Comparison with part (a):  0.3*51/2 = 0.765


## Exercise 20

A number X is selected randomly from the integers 1 through 100. A pair of dice is thrown X times. Let Y be the number of sevens thrown on the X tosses. Determine the joint distribution for {X,Y}{X,Y} and then determine E[Y]E[Y].

### Solution

1. P(X=i)=1/nP(X=i)=1/n, E[Y|X=i]=i/6E[Y|X=i]=i/6, so
E[Y]=16 i=0ni/n=(n+1)12E[Y]=16 i=0ni/n=(n+1)12
(69)
2. n = 100; p = 1/6; X = 1:n; Y = 0:n; PX = (1/n)*ones(1,n);
P0 = zeros(n,n+1);   % Could use randbern
for i = 1:n
P0(i,1:i+1) = (1/n)*ibinom(i,p,0:i);
end
P = rot90(P0);
jcalc
EY = dot(Y,PY)
EY =  8.4167             % Comparison with part (a):  101/12 = 8.4167


## Exercise 21

A number X is selected randomly from the integers 1 through 100. Each of two people draw X times, independently and randomly, a number from 1 to 10. Let Y be the number of matches (i.e., both draw ones, both draw twos, etc.). Determine the joint distribution and then determine E[Y]E[Y].

### Solution

Same as Exercise 20, except p=1/10p=1/10. E[Y]=(n+1)/20E[Y]=(n+1)/20.

n = 100; p = 0.1; X = 1:n; Y = 0:n; PX = (1/n)*ones(1,n);
P0 = zeros(n,n+1);         % Could use randbern
for i = 1:n
P0(i,1:i+1) = (1/n)*ibinom(i,p,0:i);
end
P = rot90(P0);
jcalc
- - - - - - - - - -
EY = dot(Y,PY)
EY =  5.0500                  % Comparison with part (a): EY = 101/20 = 5.05


## Exercise 22

E[Y|X=t]=10tE[Y|X=t]=10t and X has density function fX(t)=4-2tfX(t)=4-2t for 1t21t2. Determine E[Y]E[Y].

### Solution

E [ Y ] = E [ Y | X = t ] f X ( t ) d t = 1 2 10 t ( 4 - 2 t ) d t = 40 / 3 E [ Y ] = E [ Y | X = t ] f X ( t ) d t = 1 2 10 t ( 4 - 2 t ) d t = 40 / 3
(70)

## Exercise 23

E[Y|X=t]=23(1-t)E[Y|X=t]=23(1-t) for 0t<10t<1 and X has density function fX(t)=30t2(1-t)2fX(t)=30t2(1-t)2 for 0t10t1. Determine E[Y]E[Y].

### Solution

E [ Y ] = E [ Y | X = t ] f X ( t ) d t = 0 1 20 t 2 ( 1 - t ) 3 d t = 1 / 3 E [ Y ] = E [ Y | X = t ] f X ( t ) d t = 0 1 20 t 2 ( 1 - t ) 3 d t = 1 / 3
(71)

## Exercise 24

E[Y|X=t]=23(2-t)E[Y|X=t]=23(2-t) and X has density function fX(t)=1516t2(2-t)20t<2fX(t)=1516t2(2-t)20t<2. Determine E[Y]E[Y].

### Solution

E [ Y ] = E [ Y | X = t ] f X ( t ) d t = 5 8 0 2 t 2 ( 2 - t ) 3 d t = 2 / 3 E [ Y ] = E [ Y | X = t ] f X ( t ) d t = 5 8 0 2 t 2 ( 2 - t ) 3 d t = 2 / 3
(72)

## Exercise 25

Suppose the pair {X,Y}{X,Y} is independent, with XX Poisson (μ)(μ) and YY Poisson (λ)(λ). Show that X is conditionally binomial (n,μ/(μ+λ))(n,μ/(μ+λ)), given X+Y=nX+Y=n. That is, show that

P ( X = k | X + Y = n ) = C ( n , k ) p k ( 1 - p ) n - k , 0 k n , for p = μ / ( μ + λ ) P ( X = k | X + Y = n ) = C ( n , k ) p k ( 1 - p ) n - k , 0 k n , for p = μ / ( μ + λ )
(73)

### Solution

XX Poisson (μ)(μ), YY Poisson (λ)(λ), Use of property (T1) and generating functions shows that X+YX+Y Poisson (μ+λ)(μ+λ)

P ( X = k | X + Y = n ) = P ( X = k , X + Y = n ) P ( X + Y = n ) = P ( X = k , Y = n - k ) P ( X + Y = n ) P ( X = k | X + Y = n ) = P ( X = k , X + Y = n ) P ( X + Y = n ) = P ( X = k , Y = n - k ) P ( X + Y = n )
(74)
= e - μ μ k k ! e - λ λ n - k ( n - k ) ! e - ( μ + λ ) ( μ + λ ) n n ! = n ! k ! ( n - k ) ! μ k λ n - k ( μ + λ ) n = e - μ μ k k ! e - λ λ n - k ( n - k ) ! e - ( μ + λ ) ( μ + λ ) n n ! = n ! k ! ( n - k ) ! μ k λ n - k ( μ + λ ) n
(75)

Put p=μ/(μ+λ)p=μ/(μ+λ) and q=1-p=λ/(μ+λ)q=1-p=λ/(μ+λ) to get the desired result.

## Exercise 26

Use the fact that g(X,Y)=g*(X,Y,Z)g(X,Y)=g*(X,Y,Z), where g*(t,u,v)g*(t,u,v) does not vary with v. Extend property (CE10) to show

E [ g ( X , Y ) | X = t , Z = v ] = E [ g ( t , Y ) | X = t , Z = v ] a . s . [ P X Z ] E [ g ( X , Y ) | X = t , Z = v ] = E [ g ( t , Y ) | X = t , Z = v ] a . s . [ P X Z ]
(76)

### Solution

E [ g ( X , Y ) | X = t , Z = v ] = E [ g * ( X , Z , Y ) | ( X , Z ) = ( t , v ) ] = E [ g * ( t , v , Y ) | ( X , Z ) = ( t , v ) ] E [ g ( X , Y ) | X = t , Z = v ] = E [ g * ( X , Z , Y ) | ( X , Z ) = ( t , v ) ] = E [ g * ( t , v , Y ) | ( X , Z ) = ( t , v ) ]
(77)
= E [ g ( t , Y ) | X = t , Z = v ] a . s . [ P X Z ] by (CE10) = E [ g ( t , Y ) | X = t , Z = v ] a . s . [ P X Z ] by (CE10)
(78)

## Exercise 27

Use the result of Exercise 26 and properties (CE9a) and (CE10) to show that

E [ g ( X , Y ) | Z = v ] = E [ g ( t , Y ) | X = t , Z = v ] F X | Z ( d t | v ) a . s . [ P Z ] E [ g ( X , Y ) | Z = v ] = E [ g ( t , Y ) | X = t , Z = v ] F X | Z ( d t | v ) a . s . [ P Z ]
(79)

### Solution

By (CE9), E[g(X,Y)|Z]=E{E[g(X,Y)|X,Z]|Z}=E[e(X,Z)|Z]a.s.E[g(X,Y)|Z]=E{E[g(X,Y)|X,Z]|Z}=E[e(X,Z)|Z]a.s.

By (CE10),

E [ e ( X , Z ) | Z = v ] = E [ e ( X , v ) | Z = v ] = E [ e ( X , Z ) | Z = v ] = E [ e ( X , v ) | Z = v ] =
(80)
e ( t , v ) F X | Z ( d t | v ) a . s . e ( t , v ) F X | Z ( d t | v ) a . s .
(81)

By Exercise 26,

E [ g ( X , Y ) | X = t , Z = v ] F X | Z ( d t | v ) = E [ g ( X , Y ) | X = t , Z = v ] F X | Z ( d t | v ) =
(82)
E [ g ( t , Y ) | X = t , Z = v ] F X | Z ( d t | v ) a . s . [ P Z ] E [ g ( t , Y ) | X = t , Z = v ] F X | Z ( d t | v ) a . s . [ P Z ]
(83)

## Exercise 28

A shop which works past closing time to complete jobs on hand tends to speed up service on any job received during the last hour before closing. Suppose the arrival time of a job in hours before closing time is a random variable TT uniform [0,1][0,1]. Service time Y for a unit received in that period is conditionally exponential β(2-u)β(2-u), given T=uT=u. Determine the distribution function for Y.

### Solution

F Y ( v ) = F Y | T ( v | u ) f T ( u ) d u = 0 1 ( 1 - e - β ( 2 - u ) v ) d u = F Y ( v ) = F Y | T ( v | u ) f T ( u ) d u = 0 1 ( 1 - e - β ( 2 - u ) v ) d u =
(84)
1 - e - 2 β v e β v - 1 β v = 1 - e - β v 1 - e - β v β v , 0 < v 1 - e - 2 β v e β v - 1 β v = 1 - e - β v 1 - e - β v β v , 0 < v
(85)

## Exercise 29

Time to failure X of a manufactured unit has an exponential distribution. The parameter is dependent upon the manufacturing process. Suppose the parameter is the value of random variable HH uniform on[0.005, 0.01], and X is conditionally exponential (u)(u), given H=uH=u. Determine P(X>150)P(X>150). Determine E[X|H=u]E[X|H=u] and use this to determine E[X]E[X].

### Solution

F X | H ( t | u ) = 1 - e - u t f H ( u ) = 1 0 . 005 = 200 , 0 . 005 u 0 . 01 F X | H ( t | u ) = 1 - e - u t f H ( u ) = 1 0 . 005 = 200 , 0 . 005 u 0 . 01
(86)
F X ( t ) = 1 - 200 0 . 005 0 . 01 e - u t d u = 1 - 200 t e - 0 . 005 t - e - 0 . 01 t F X ( t ) = 1 - 200 0 . 005 0 . 01 e - u t d u = 1 - 200 t e - 0 . 005 t - e - 0 . 01 t
(87)
P ( X > 150 ) = 200 150 [ e - 0 . 75 - e - 1 . 5 ] 0 . 3323 P ( X > 150 ) = 200 150 [ e - 0 . 75 - e - 1 . 5 ] 0 . 3323
(88)
E [ X | H = u ] = 1 / u E [ X ] = 200 0 . 005 0 . 01 d u u = 200 ln 2 E [ X | H = u ] = 1 / u E [ X ] = 200 0 . 005 0 . 01 d u u = 200 ln 2
(89)

## Exercise 30

A system has n components. Time to failure of the ith component is Xi and the class

{Xi:1in}{Xi:1in} is iid exponential (λ)(λ). The system fails if any one or more of the components fails. Let W be the time to system failure. What is the probability the failure is due to the ith component?

Suggestion. Note that W=XiW=Xi iff Xj>XiXj>Xi for all jiji. Thus

{ W = X i } = { ( X 1 , X 2 , , X n ) Q } , Q = { ( t 1 , t 2 , t n ) : t k > t i , k i } { W = X i } = { ( X 1 , X 2 , , X n ) Q } , Q = { ( t 1 , t 2 , t n ) : t k > t i , k i }
(90)
P ( W = X i ) = E [ I Q ( X 1 , X 2 , , X n ) ] = E { E [ I Q ( X 1 , X 2 , , X n ) | X i ] } P ( W = X i ) = E [ I Q ( X 1 , X 2 , , X n ) ] = E { E [ I Q ( X 1 , X 2 , , X n ) | X i ] }
(91)

### Solution

Let Q={(t1,t2,,tn):tk>ti,ki}Q={(t1,t2,,tn):tk>ti,ki}. Then

P ( W = X i ) = E [ I Q ( X 1 , X 2 , , X n ) ] = E { E [ I Q ( X 1 , X 2 , , X n ) | X i ] } P ( W = X i ) = E [ I Q ( X 1 , X 2 , , X n ) ] = E { E [ I Q ( X 1 , X 2 , , X n ) | X i ] }
(92)
= E [ I Q ( X 1 , X 2 , , t i , X n ) ] F X ( d t ) = E [ I Q ( X 1 , X 2 , , t i , X n ) ] F X ( d t )
(93)
E [ I Q ( X 1 , X 2 , , t i , X n ) ] = k i P ( X k > t ) = [ 1 - F X ( t ) ] n - 1 E [ I Q ( X 1 , X 2 , , t i , X n ) ] = k i P ( X k > t ) = [ 1 - F X ( t ) ] n - 1
(94)

If FX is continuous, strictly increasing, zero for t<0t<0, put u=FX(t)u=FX(t), du=fX(t)dtdu=fX(t)dt. t=0u=0t=0u=0, t=u=1t=u=1. Then

P ( W = X i ) = 0 1 ( 1 - u ) n - 1 d u = 0 1 u n - 1 d u = 1 / n P ( W = X i ) = 0 1 ( 1 - u ) n - 1 d u = 0 1 u n - 1 d u = 1 / n
(95)

## 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.

PDF | EPUB (?)

### What is an EPUB file?

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

#### Collection to:

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

#### Module to:

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