(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
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
(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
Determine
npr07_02
Data are in T, pc
EX = T*pc';
VX = (T.^2)*pc' - EX^2
VX = 2.8525
(See Exercise 12 from "Problems on Random Variables and Probabilities", Exercise 3 from "Problems on Mathematical Expectation", m-file npr06_12.m). The class
Consider
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
(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
(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
(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
Determine
(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
(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
The class
0.43, 0.53, 0.46, 0.37, 0.45, 0.39. Let
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
Consider
probabilities (data are in m-file npr12_10.m)
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
Consider a second random variable
The pair
(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
Suppose the pair
The pair
Determine
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
The class
Let
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
For the Beta
Using
Some algebraic manipulations show that
The pair
Determine
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
The pair
Determine
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
The pair
Let
Determine
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
(See Exercise 9 from "Problems on Mathematical Expectation"). Random variable X has density function
For the distributions in Exercises 20-22
Determine
(See Exercise 7 from "Problems On Random Vectors and Joint Distributions", and Exercise 17 from "Problems on Mathematical Expectation"). The pair
| t = | -3.1 | -0.5 | 1.2 | 2.4 | 3.7 | 4.9 |
| u = 7.5 | 0.0090 | 0.0396 | 0.0594 | 0.0216 | 0.0440 | 0.0203 |
| 4.1 | 0.0495 | 0 | 0.1089 | 0.0528 | 0.0363 | 0.0231 |
| -2.0 | 0.0405 | 0.1320 | 0.0891 | 0.0324 | 0.0297 | 0.0189 |
| -3.8 | 0.0510 | 0.0484 | 0.0726 | 0.0132 | 0 | 0.0077 |
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
(See Exercise 8 from "Problems On Random Vectors and Joint Distributions", and Exercise 18 from "Problems on Mathematical Expectation"). The pair
| t = | 1 | 3 | 5 | 7 | 9 | 11 | 13 | 15 | 17 | 19 |
| u = 12 | 0.0156 | 0.0191 | 0.0081 | 0.0035 | 0.0091 | 0.0070 | 0.0098 | 0.0056 | 0.0091 | 0.0049 |
| 10 | 0.0064 | 0.0204 | 0.0108 | 0.0040 | 0.0054 | 0.0080 | 0.0112 | 0.0064 | 0.0104 | 0.0056 |
| 9 | 0.0196 | 0.0256 | 0.0126 | 0.0060 | 0.0156 | 0.0120 | 0.0168 | 0.0096 | 0.0056 | 0.0084 |
| 5 | 0.0112 | 0.0182 | 0.0108 | 0.0070 | 0.0182 | 0.0140 | 0.0196 | 0.0012 | 0.0182 | 0.0038 |
| 3 | 0.0060 | 0.0260 | 0.0162 | 0.0050 | 0.0160 | 0.0200 | 0.0280 | 0.0060 | 0.0160 | 0.0040 |
| -1 | 0.0096 | 0.0056 | 0.0072 | 0.0060 | 0.0256 | 0.0120 | 0.0268 | 0.0096 | 0.0256 | 0.0084 |
| -3 | 0.0044 | 0.0134 | 0.0180 | 0.0140 | 0.0234 | 0.0180 | 0.0252 | 0.0244 | 0.0234 | 0.0126 |
| -5 | 0.0072 | 0.0017 | 0.0063 | 0.0045 | 0.0167 | 0.0090 | 0.0026 | 0.0172 | 0.0217 | 0.0223 |
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
(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):
| t = | 1 | 1.5 | 2 | 2.5 | 3 |
| u = 5 | 0.039 | 0.011 | 0.005 | 0.001 | 0.001 |
| 4 | 0.065 | 0.070 | 0.050 | 0.015 | 0.010 |
| 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 |
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
(See Exercise 10 from "Problems On Random Vectors and Joint Distributions", and Exercise 20 from "Problems on Mathematical Expectation").
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
(See Exercise 13 from "Problems On Random Vectors and Joint Distributions", and Exercise 23 from "Problems on Mathematical Expectation").
tuappr: [0 2] [0 2] 200 200 (1/8)*(t+u)
VX = 0.3055 CV = -0.0278 a = -0.0909 b = 1.2727
(See Exercise 15 from "Problems On Random Vectors and Joint Distributions", and Exercise 25 from "Problems on Mathematical Expectation").
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
(See Exercise 16 from "Problems On Random Vectors and Joint Distributions", and Exercise 26 from "Problems on Mathematical Expectation").
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
(See Exercise 17 from "Problems On Random Vectors and Joint Distributions", and Exercise 27 from "Problems on Mathematical Expectation").
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
(See Exercise 18 from "Problems On Random Vectors and Joint Distributions", and Exercise 28 from "Problems on Mathematical Expectation").
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
(See Exercise 21 from "Problems On Random Vectors and Joint Distributions", and Exercise 31 from "Problems on Mathematical Expectation").
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
(See Exercise 22 from "Problems On Random Vectors and Joint Distributions", and Exercise 32 from "Problems on Mathematical Expectation").
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
The class
Let
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
Determine
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
Determine
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
Determine
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
Determine
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
Determine
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
(See Exercise 20, and Exercises 9 and 10 from "Problems on Functions of Random Variables"). For the pair
Determine the joint distribution for the pair
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