# Connexions

You are here: Home » Content » Applied Probability » Problems on Functions of Random Variables

• 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 Functions of Random Variables

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

## Exercise 1

Suppose X is a nonnegative, absolutely continuous random variable. Let Z=g(X)=Ce-aXZ=g(X)=Ce-aX, where a>0,C>0a>0,C>0. Then 0<ZC0<ZC. Use properties of the exponential and natural log function to show that

F Z ( v ) = 1 - F X - ln ( v / C ) a for 0 < v C F Z ( v ) = 1 - F X - ln ( v / C ) a for 0 < v C
(1)

### Solution

Z=Ce-aXvZ=Ce-aXv iff e-aXv/Ce-aXv/C iff -aXln(v/C)-aXln(v/C) iff X-ln(v/C)/aX-ln(v/C)/a, so that

F Z ( v ) = P ( Z v ) = P ( X - ln ( v / C ) / a ) = 1 - F X - ln ( v / C ) a F Z ( v ) = P ( Z v ) = P ( X - ln ( v / C ) / a ) = 1 - F X - ln ( v / C ) a
(2)

## Exercise 2

Use the result of Exercise 1 to show that if XX exponential (λ)(λ), then

F Z ( v ) = v C λ / a 0 < v C F Z ( v ) = v C λ / a 0 < v C
(3)

### Solution

F Z ( v ) = 1 - 1 - e x p - λ a · ln ( v / C ) = v C λ / a F Z ( v ) = 1 - 1 - e x p - λ a · ln ( v / C ) = v C λ / a
(4)

## Exercise 3

Present value of future costs. Suppose money may be invested at an annual rate a, compounded continually. Then one dollar in hand now, has a value eaxeax at the end of x years. Hence, one dollar spent x years in the future has a present valuee-axe-ax. Suppose a device put into operation has time to failure (in years) XX exponential (λ)(λ). If the cost of replacement at failure is C dollars, then the present value of the replacement is Z=Ce-aXZ=Ce-aX. Suppose λ=1/10λ=1/10, a=0.07a=0.07, and C=$1000C=$1000.

1. Use the result of Exercise 2 to determine the probability Z700,500,200Z700,500,200.
2. Use a discrete approximation for the exponential density to approximate the probabilities in part (a). Truncate X at 1000 and use 10,000 approximation points.

### Solution

P ( Z v ) = v 1000 10 / 7 P ( Z v ) = v 1000 10 / 7
(5)
v = [700 500 200];
P = (v/1000).^(10/7)
P =  0.6008    0.3715    0.1003
tappr
Enter matrix [a b] of x-range endpoints  [0 1000]
Enter number of x approximation points  10000
Enter density as a function of t  0.1*exp(-t/10)
Use row matrices X and PX as in the simple case
G = 1000*exp(-0.07*t);
PM1 = (G<=700)*PX'
PM1 =  0.6005
PM2 = (G<=500)*PX'
PM2 =  0.3716
PM3 = (G<=200)*PX'
PM3 =  0.1003


## Exercise 4

Optimal stocking of merchandise. A merchant is planning for the Christmas season. He intends to stock m units of a certain item at a cost of c per unit. Experience indicates demand can be represented by a random variable DD Poisson (μ)(μ). If units remain in stock at the end of the season, they may be returned with recovery of r per unit. If demand exceeds the number originally ordered, extra units may be ordered at a cost of s each. Units are sold at a price p per unit. If Z=g(D)Z=g(D) is the gain from the sales, then

• For tm,g(t)=(p-c)t-(c-r)(m-t)=(p-r)t+(r-c)mtm,g(t)=(p-c)t-(c-r)(m-t)=(p-r)t+(r-c)m
• For t>m,g(t)=(p-c)m+(t-m)(p-s)=(p-s)t+(s-c)mt>m,g(t)=(p-c)m+(t-m)(p-s)=(p-s)t+(s-c)m

Let M=(-,m]M=(-,m]. Then

g ( t ) = I M ( t ) [ ( p - r ) t + ( r - c ) m ] + I M ( t ) [ ( p - s ) t + ( s - c ) m ] g ( t ) = I M ( t ) [ ( p - r ) t + ( r - c ) m ] + I M ( t ) [ ( p - s ) t + ( s - c ) m ]
(6)
= ( p - s ) t + ( s - c ) m + I M ( t ) ( s - r ) ( t - m ) = ( p - s ) t + ( s - c ) m + I M ( t ) ( s - r ) ( t - m )
(7)

Suppose μ=50m=50c=30p=50r=20s=40.μ=50m=50c=30p=50r=20s=40..
Approximate the Poisson random variable D by truncating at 100. Determine P(500Z1100)P(500Z1100).

### Solution

mu = 50;
D = 0:100;
c = 30;
p = 50;
r = 20;
s = 40;
m = 50;
PD = ipoisson(mu,D);
G = (p - s)*D + (s - c)*m +(s - r)*(D - m).*(D <= m);
M = (500<=G)&(G<=1100);
PM = M*PD'
PM =  0.9209

[Z,PZ] = csort(G,PD);         % Alternate: use dbn for Z
m = (500<=Z)&(Z<=1100);
pm = m*PZ'
pm =  0.9209


## Exercise 5

(See Example 2 from "Functions of a Random Variable") The cultural committee of a student organization has arranged a special deal for tickets to a concert. The agreement is that the organization will purchase ten tickets at $20 each (regardless of the number of individual buyers). Additional tickets are available according to the following schedule: • 11-20,$18 each
• 21-30, $16 each • 31-50,$15 each
• 51-100, \$13 each

If the number of purchasers is a random variable X, the total cost (in dollars) is a random quantity Z=g(X)Z=g(X) described by

g ( X ) = 200 + 18 I M 1 ( X ) ( X - 10 ) + ( 16 - 18 ) I M 2 ( X ) ( X - 20 ) + g ( X ) = 200 + 18 I M 1 ( X ) ( X - 10 ) + ( 16 - 18 ) I M 2 ( X ) ( X - 20 ) +
(8)
( 15 - 16 ) I M 3 ( X ) ( X - 30 ) + ( 13 - 15 ) I M 4 ( X ) ( X - 50 ) ( 15 - 16 ) I M 3 ( X ) ( X - 30 ) + ( 13 - 15 ) I M 4 ( X ) ( X - 50 )
(9)
where M 1 = [ 10 , ) , M 2 = [ 20 , ) , M 3 = [ 30 , ) , M 4 = [ 50 , ) where M 1 = [ 10 , ) , M 2 = [ 20 , ) , M 3 = [ 30 , ) , M 4 = [ 50 , )
(10)

Suppose XX Poisson (75). Approximate the Poisson distribution by truncating at 150. Determine P(Z1000),P(Z1300)P(Z1000),P(Z1300), and P(900Z1400)P(900Z1400).

### Solution

X = 0:150;
PX = ipoisson(75,X);
G = 200 + 18*(X - 10).*(X>=10) + (16 - 18)*(X - 20).*(X>=20) + ...
(15 - 16)*(X- 30).*(X>=30) + (13 - 15)*(X - 50).*(X>=50);
P1 = (G>=1000)*PX'
P1 =  0.9288
P2 = (G>=1300)*PX'
P2 =  0.1142
P3 = ((900<=G)&(G<=1400))*PX'
P3 =  0.9742
[Z,PZ] = csort(G,PX);         % Alternate: use dbn for Z
p1 = (Z>=1000)*PZ'
p1 =  0.9288


## Exercise 6

(See Exercise 6 from "Problems on Random Vectors and Joint Distributions", and Exercise 1 from "Problems on Independent Classes of Random Variables")) The pair {X,Y}{X,Y} has the joint distribution

(in m-file npr08_06.m):

X = [ - 2 . 3 - 0 . 7 1 . 1 3 . 9 5 . 1 ] Y = [ 1 . 3 2 . 5 4 . 1 5 . 3 ] X = [ - 2 . 3 - 0 . 7 1 . 1 3 . 9 5 . 1 ] Y = [ 1 . 3 2 . 5 4 . 1 5 . 3 ]
(11)
P = 0 . 0483 0 . 0357 0 . 0420 0 . 0399 0 . 0441 0 . 0437 0 . 0323 0 . 0380 0 . 0361 0 . 0399 0 . 0713 0 . 0527 0 . 0620 0 . 0609 0 . 0551 0 . 0667 0 . 0493 0 . 0580 0 . 0651 0 . 0589 P = 0 . 0483 0 . 0357 0 . 0420 0 . 0399 0 . 0441 0 . 0437 0 . 0323 0 . 0380 0 . 0361 0 . 0399 0 . 0713 0 . 0527 0 . 0620 0 . 0609 0 . 0551 0 . 0667 0 . 0493 0 . 0580 0 . 0651 0 . 0589
(12)

Determine P(max{X,Y}4),P(|X-Y|>3)P(max{X,Y}4),P(|X-Y|>3). Let Z=3X3+3X2Y-Y3Z=3X3+3X2Y-Y3.
Determine P(Z<0)P(Z<0) and P(-5<Z300)P(-5<Z300).

### Solution

npr08_06
Data are in X, Y, P
jcalc
Enter JOINT PROBABILITIES (as on the plane)  P
Enter row matrix of VALUES of X  X
Enter row matrix of VALUES of Y  Y
Use array operations on matrices X, Y, PX, PY, t, u, and P
P1 = total((max(t,u)<=4).*P)
P1 =  0.4860
P2 = total((abs(t-u)>3).*P)
P2 =  0.4516
G = 3*t.^3 + 3*t.^2.*u - u.^3;
P3 = total((G<0).*P)
P3 =  0.5420
P4 = total(((-5<G)&(G<=300)).*P)
P4 =  0.3713
[Z,PZ] = csort(G,P);          % Alternate: use dbn for Z
p4 = ((-5<Z)&(Z<=300))*PZ'
p4 =  0.3713


## Exercise 7

(See Exercise 2 from "Problems on Independent Classes of Random Variables") The pair {X,Y}{X,Y} has the joint distribution (in m-file npr09_02.m):

X = [ - 3 . 9 - 1 . 7 1 . 5 2 8 4 . 1 ] Y = [ - 2 1 2 . 6 5 . 1 ] X = [ - 3 . 9 - 1 . 7 1 . 5 2 8 4 . 1 ] Y = [ - 2 1 2 . 6 5 . 1 ]
(13)
P = 0 . 0589 0 . 0342 0 . 0304 0 . 0456 0 . 0209 0 . 0961 0 . 0556 0 . 0498 0 . 0744 0 . 0341 0 . 0682 0 . 0398 0 . 0350 0 . 0528 0 . 0242 0 . 0868 0 . 0504 0 . 0448 0 . 0672 0 . 0308 P = 0 . 0589 0 . 0342 0 . 0304 0 . 0456 0 . 0209 0 . 0961 0 . 0556 0 . 0498 0 . 0744 0 . 0341 0 . 0682 0 . 0398 0 . 0350 0 . 0528 0 . 0242 0 . 0868 0 . 0504 0 . 0448 0 . 0672 0 . 0308
(14)

Determine P({X+Y5}{Y2})P({X+Y5}{Y2}), P(X2+Y210)P(X2+Y210).

### Solution

npr09_02
Data are in X, Y, P
jcalc
Enter JOINT PROBABILITIES (as on the plane)  P
Enter row matrix of VALUES of X  X
Enter row matrix of VALUES of Y  Y
Use array operations on matrices X, Y, PX, PY, t, u, and P
M1 = (t+u>=5)|(u<=2);
P1 = total(M1.*P)
P1 =  0.7054
M2 = t.^2 + u.^2 <= 10;
P2 = total(M2.*P)
P2 =  0.3282


## Exercise 8

(See Exercise 7 from "Problems on Random Vectors and Joint Distributions", and Exercise 3 from "Problems on Independent Classes of Random Variables") The pair {X,Y}{X,Y} has the joint distribution

(in m-file npr08_07.m):

P ( X = t , Y = u ) P ( X = t , Y = u )
(15)
 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

Determine P(X2-3X0)P(X2-3X0), P(X3-3|Y|<3)P(X3-3|Y|<3).

### Solution

npr08_07
Data are in X, Y, P
jcalc
Enter JOINT PROBABILITIES (as on the plane)  P
Enter row matrix of VALUES of X  X
Enter row matrix of VALUES of Y  Y
Use array operations on matrices X, Y, PX, PY, t, u, and P
M1 = t.^2 - 3*t <=0;
P1 = total(M1.*P)
P1 =  0.4500
M2 = t.^3 - 3*abs(u) < 3;
P2 = total(M2.*P)
P2 =  0.7876


## Exercise 9

For the pair {X,Y}{X,Y} in Exercise 8, let Z=g(X,Y)=3X2+2XY-Y2Z=g(X,Y)=3X2+2XY-Y2. Determine and plot the distribution function for Z.

### Solution

G = 3*t.^2 + 2*t.*u - u.^2;  % Determine g(X,Y)
[Z,PZ] = csort(G,P);         % Obtain dbn for Z = g(X,Y)
ddbn                         % Call for plotting m-procedure
Enter row matrix of VALUES  Z
Enter row matrix of PROBABILITIES  PZ   % Plot not reproduced here


## Exercise 10

For the pair {X,Y}{X,Y} in Exercise 8, let

W = g ( 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 = g ( 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
(16)

Determine and plot the distribution function for W.

### Solution

H = t.*(t+u<=4) + 2*u.*(t+u>4);
[W,PW] = csort(H,P);
ddbn
Enter row matrix of VALUES  W
Enter row matrix of PROBABILITIES  PW   % Plot not reproduced here


For the distributions in Exercises 10-15 below

1. Determine analytically the indicated probabilities.
2. Use a discrete approximation to calculate the same probablities.'

## Exercise 11

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

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 )
(17)

Determine P(Z2)P(Z2)

### Solution

P ( Z 2 ) = P ( Z Q = Q 1 M 1 Q 2 M 2 ) , where M 1 = { ( t , u ) : 0 t 1 , 0 u 1 + t } P ( Z 2 ) = P ( Z Q = Q 1 M 1 Q 2 M 2 ) , where M 1 = { ( t , u ) : 0 t 1 , 0 u 1 + t }
(18)
M 2 = { ( t , u ) : 1 < t 2 , 0 u 1 + t } M 2 = { ( t , u ) : 1 < t 2 , 0 u 1 + t }
(19)
Q 1 = { ( t , u ) : 0 t 1 / 2 } , Q 2 = { ( t , u ) : u 2 - t } (see figure) Q 1 = { ( t , u ) : 0 t 1 / 2 } , Q 2 = { ( t , u ) : u 2 - t } (see figure)
(20)
P = 3 88 0 1 / 2 0 1 + t ( 2 t + 3 u 2 ) d u d t + 3 88 1 2 0 2 - t ( 2 t + 3 u 2 ) d u d t = 563 5632 P = 3 88 0 1 / 2 0 1 + t ( 2 t + 3 u 2 ) d u d t + 3 88 1 2 0 2 - t ( 2 t + 3 u 2 ) d u d t = 563 5632
(21)
tuappr
Enter matrix [a b] of X-range endpoints  [0 2]
Enter matrix [c d] of Y-range endpoints  [0 3]
Enter number of X approximation points  200
Enter number of Y approximation points  300
Enter expression for joint density  (3/88)*(2*t + 3*u.^2).*(u<=1+t)
Use array operations on X, Y, PX, PY, t, u, and P
G = 4*t.*(t<=1) + (t+u).*(t>1);
[Z,PZ] = csort(G,P);
PZ2 = (Z<=2)*PZ'
PZ2 =  0.1010                       % Theoretical = 563/5632 = 0.1000


## Exercise 12

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

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 }
(22)

Determine P(Z1/4)P(Z1/4).

### Solution

P ( Z 1 / 4 ) = P ( ( X , Y ) M 1 Q 1 M 2 Q 2 ) , M 1 = { ( t , u ) : 0 t u 1 } P ( Z 1 / 4 ) = P ( ( X , Y ) M 1 Q 1 M 2 Q 2 ) , M 1 = { ( t , u ) : 0 t u 1 }
(23)
M 2 = { ( t , u ) : 0 t 2 , 0 t min ( t , 2 - t ) } M 2 = { ( t , u ) : 0 t 2 , 0 t min ( t , 2 - t ) }
(24)
Q 1 = { ( t , u ) : t 1 / 2 } Q 2 = { ( t , u ) : u 1 / 2 } (see figure) Q 1 = { ( t , u ) : t 1 / 2 } Q 2 = { ( t , u ) : u 1 / 2 } (see figure)
(25)
P = 24 11 0 1 / 2 0 1 t u d u d t + 24 11 1 / 2 3 / 2 0 1 / 2 t u d u d t + 24 11 3 / 2 2 0 2 - t t u d u d t = 85 176 P = 24 11 0 1 / 2 0 1 t u d u d t + 24 11 1 / 2 3 / 2 0 1 / 2 t u d u d t + 24 11 3 / 2 2 0 2 - t t u d u d t = 85 176
(26)
tuappr
Enter matrix [a b] of X-range endpoints  [0 2]
Enter matrix [c d] of Y-range endpoints  [0 1]
Enter number of X approximation points  400
Enter number of Y approximation points  200
Enter expression for joint density  (24/11)*t.*u.*(u<=min(1,2-t))
Use array operations on X, Y, PX, PY, t, u, and P
G = 0.5*t.*(u>t) + u.^2.*(u<t);
[Z,PZ] = csort(G,P);
pp = (Z<=1/4)*PZ'
pp =  0.4844                        % Theoretical = 85/176 = 0.4830


## Exercise 13

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

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 }
(27)

Determine P(Z1)P(Z1).

### Solution

P ( Z 1 ) = P ( ( X , Y ) M 1 Q 1 M 2 Q 2 ) , M 1 = { ( t , u ) : 0 t 1 , 0 u 1 - t } P ( Z 1 ) = P ( ( X , Y ) M 1 Q 1 M 2 Q 2 ) , M 1 = { ( t , u ) : 0 t 1 , 0 u 1 - t }
(28)
M 2 = { ( t , u ) : 1 t 2 , 0 u t } M 2 = { ( t , u ) : 1 t 2 , 0 u t }
(29)
Q 1 = { ( t , u ) : u 1 - t } Q 2 = { ( t , u ) : u 1 / 2 } (see figure) Q 1 = { ( t , u ) : u 1 - t } Q 2 = { ( t , u ) : u 1 / 2 } (see figure)
(30)
P = 3 23 0 1 0 1 - t ( t + 2 u ) d u d t + 3 23 1 2 0 1 / 2 ( t + 2 u ) d u d t = 9 46 P = 3 23 0 1 0 1 - t ( t + 2 u ) d u d t + 3 23 1 2 0 1 / 2 ( t + 2 u ) d u d t = 9 46
(31)
tuappr
Enter matrix [a b] of X-range endpoints  [0 2]
Enter matrix [c d] of Y-range endpoints  [0 2]
Enter number of X approximation points  300
Enter number of Y approximation points  300
Enter expression for joint density  (3/23)*(t + 2*u).*(u<=max(2-t,t))
Use array operations on X, Y, PX, PY, t, u, and P
M = max(t,u) <= 1;
G = M.*(t + u) + (1 - M)*2.*u;
p = total((G<=1).*P)
p =  0.1960                         % Theoretical = 9/46 = 0.1957


## Exercise 14

fXY(t,u)=12179(3t2+u)fXY(t,u)=12179(3t2+u), for 0t20t2, 0umin{2,3-t}0umin{2,3-t} (see Exercise 19 from "Problems on Random Vectors and Joint Distributions").

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 }
(32)

Determine P(Z2)P(Z2).

### Solution

P ( Z 2 ) = P ( ( , Y ) M 1 Q 1 ( M 2 M 3 ) Q 2 ) , M 1 = { ( t , u ) : 0 t 1 , 1 u 2 } P ( Z 2 ) = P ( ( , Y ) M 1 Q 1 ( M 2 M 3 ) Q 2 ) , M 1 = { ( t , u ) : 0 t 1 , 1 u 2 }
(33)
M 2 = { ( t , u ) : 0 t 1 , 0 u 1 } M 3 = { ( t , u ) : 1 t 2 , 0 u 3 - t } M 2 = { ( t , u ) : 0 t 1 , 0 u 1 } M 3 = { ( t , u ) : 1 t 2 , 0 u 3 - t }
(34)
Q 1 = { ( t , u ) : u 1 - t } Q 2 = { ( t , u ) : u 1 / 2 } (see figure) Q 1 = { ( t , u ) : u 1 - t } Q 2 = { ( t , u ) : u 1 / 2 } (see figure)
(35)
P = 12 179 0 1 0 2 - t ( 3 t 2 + u ) d u d t + 12 179 1 2 0 1 ( 3 t 2 + u ) d u d t = 119 179 P = 12 179 0 1 0 2 - t ( 3 t 2 + u ) d u d t + 12 179 1 2 0 1 ( 3 t 2 + u ) d u d t = 119 179
(36)
tuappr
Enter matrix [a b] of X-range endpoints  [0 2]
Enter matrix [c d] of Y-range endpoints  [0 2]
Enter number of X approximation points  300
Enter number of Y approximation points  300
Enter expression for joint density  (12/179)*(3*t.^2 + u).*(u<=min(2,3-t))
Use array operations on X, Y, PX, PY, t, u, and P
M = (t<=1)&(u>=1);
Z = M.*(t + u) + (1 - M)*2.*u.^2;
G = M.*(t + u) + (1 - M)*2.*u.^2;
p = total((G<=2).*P)
p =  0.6662                          % Theoretical = 119/179 = 0.6648


## Exercise 15

fXY(t,u)=12227(3t+2tu)fXY(t,u)=12227(3t+2tu), for 0t20t2, 0umin{1+t,2}0umin{1+t,2} (see Exercise 20 from "Problems on Random Variables and Joint Distributions")

Z = I M ( X , Y ) X + I M c ( X , Y ) Y X , M = { ( t , u ) : u min ( 1 , 2 - t ) } Z = I M ( X , Y ) X + I M c ( X , Y ) Y X , M = { ( t , u ) : u min ( 1 , 2 - t ) }
(37)

Detemine P(Z1)P(Z1).

### Solution

P ( Z 1 ) = P ( ( X , Y ) M 1 Q 1 M 2 Q 2 ) , M 1 = M , M 2 = M c P ( Z 1 ) = P ( ( X , Y ) M 1 Q 1 M 2 Q 2 ) , M 1 = M , M 2 = M c
(38)
Q 1 = { ( t , u ) : 0 t 1 } Q 2 = { ( t , u ) : u t } (see figure) Q 1 = { ( t , u ) : 0 t 1 } Q 2 = { ( t , u ) : u t } (see figure)
(39)
P = 12 227 0 1 0 1 ( 3 t + 2 t u ) d u d t + 12 227 1 2 2 - t t ( 3 t + 2 t u ) d u d t = 124 227 P = 12 227 0 1 0 1 ( 3 t + 2 t u ) d u d t + 12 227 1 2 2 - t t ( 3 t + 2 t u ) d u d t = 124 227
(40)
tuappr
Enter matrix [a b] of X-range endpoints  [0 2]
Enter matrix [c d] of Y-range endpoints  [0 2]
Enter number of X approximation points  400
Enter number of Y approximation points  400
Enter expression for joint density  (12/227)*(3*t+2*t.*u).*(u<=min(1+t,2))
Use array operations on X, Y, PX, PY, t, u, and P
Q = (u<=1).*(t<=1) + (t>1).*(u>=2-t).*(u<=t);
P = total(Q.*P)
P =  0.5478                        % Theoretical = 124/227 = 0.5463


## Exercise 16

The class {X,Y,Z}{X,Y,Z} is independent.

X=-2IA+IB+3ICX=-2IA+IB+3IC. Minterm probabilities are (in the usual order)

0 . 255 0 . 025 0 . 375 0 . 045 0 . 108 0 . 012 0 . 162 0 . 018 0 . 255 0 . 025 0 . 375 0 . 045 0 . 108 0 . 012 0 . 162 0 . 018
(41)

Y=ID+3IE+IF-3Y=ID+3IE+IF-3. The class {D,E,F}{D,E,F} is independent with

P ( D ) = 0 . 32 P ( E ) = 0 . 56 P ( F ) = 0 . 40 P ( D ) = 0 . 32 P ( E ) = 0 . 56 P ( F ) = 0 . 40
(42)

Z has distribution

 Value -1.3 1.2 2.7 3.4 5.8 Probability 0.12 0.24 0.43 0.13 0.08

Determine P(X2+3XY2>3Z)P(X2+3XY2>3Z).

### Solution

% file npr10_16.m  Data for Exercise 16
cx = [-2 1 3 0];
pmx = 0.001*[255  25 375  45 108  12 162  18];
cy = [1 3 1 -3];
pmy = minprob(0.01*[32 56 40]);
Z = [-1.3 1.2 2.7 3.4 5.8];
PZ = 0.01*[12 24 43 13  8];
disp('Data are in cx, pmx, cy, pmy, Z, PZ')
npr10_16                % Call for data
Data are in cx, pmx, cy, pmy, Z, PZ
[X,PX] = canonicf(cx,pmx);
[Y,PY] = canonicf(cy,pmy);
icalc3
Enter row matrix of X-values  X
Enter row matrix of Y-values  Y
Enter row matrix of Z-values  Z
Enter X probabilities  PX
Enter Y probabilities  PY
Enter Z probabilities  PZ
Use array operations on matrices X, Y, Z,
PX, PY, PZ, t, u, v, and P
M = t.^2 + 3*t.*u.^2 > 3*v;
PM = total(M.*P)
PM =  0.3587


## Exercise 17

The simple random variable X has distribution

X = [ - 3 . 1 - 0 . 5 1 . 2 2 . 4 3 . 7 4 . 9 ] P X = [ 0 . 15 0 . 22 0 . 33 0 . 12 0 . 11 0 . 07 ] X = [ - 3 . 1 - 0 . 5 1 . 2 2 . 4 3 . 7 4 . 9 ] P X = [ 0 . 15 0 . 22 0 . 33 0 . 12 0 . 11 0 . 07 ]
(43)
1. Plot the distribution function FX and the quantile function QX.
2. Take a random sample of size n=10,000n=10,000. Compare the relative frequency for each value with the probability that value is taken on.

### Solution

X = [-3.1 -0.5 1.2 2.4 3.7 4.9];
PX = 0.01*[15 22 33 12 11  7];
ddbn
Enter row matrix of VALUES  X
Enter row matrix of PROBABILITIES  PX  % Plot not reproduced here
dquanplot
Enter VALUES for X  X
Enter PROBABILITIES for X  PX          % Plot not reproduced here
rand('seed',0)                      % Reset random number generator
dsample                             % for comparison purposes
Enter row matrix of VALUES  X
Enter row matrix of PROBABILITIES  PX
Sample size n  10000
Value      Prob    Rel freq
-3.1000    0.1500    0.1490
-0.5000    0.2200    0.2164
1.2000    0.3300    0.3340
2.4000    0.1200    0.1184
3.7000    0.1100    0.1070
4.9000    0.0700    0.0752
Sample average ex = 0.8792
Population mean E[X] = 0.859
Sample variance vx = 5.146
Population variance Var[X] = 5.112


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