# 15.3: Problems on Random Selection

• • Paul Pfeiffer
• Rice University
$$\newcommand{\vecs}{\overset { \rightharpoonup} {\mathbf{#1}} }$$ $$\newcommand{\vecd}{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$$$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

Exercise $$\PageIndex{1}$$

(See Exercise 3 from "Problems on Random Variables and Joint Distributions") A die is rolled. Let $$X$$ be the number of spots that turn up. A coin is flipped $$X$$ times. Let $$Y$$ be the number of heads that turn up. Determine the distribution for $$Y$$.

PX = [0 (1/6)*ones(1,6)];
PY = [0.5 0.5];
gend
Do not forget zero coefficients for missing powers
Enter gen fn COEFFICIENTS for gN  PX
Enter gen fn COEFFICIENTS for gY  PY
Results are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, P
To view the distribution, call for gD.
disp(gD)             % Compare with P8-3
0    0.1641
1.0000    0.3125
2.0000    0.2578
3.0000    0.1667
4.0000    0.0755
5.0000    0.0208
6.0000    0.0026

Exercise $$\PageIndex{2}$$

(See Exercise 4 from "Problems on Random Variables and Joint Distributions") As a variation of Exercise 15.3.1, suppose a pair of dice is rolled instead of a single die. Determine the distribution for $$Y$$.

PN = (1/36)*[0 0 1 2 3 4 5 6 5 4 3 2 1];
PY = [0.5 0.5];
gend
Do not forget zero coefficients for missing powers
Enter gen fn COEFFICIENTS for gN  PN
Enter gen fn COEFFICIENTS for gY  PY
Results are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, P
To view the distribution, call for gD.
disp(gD)
0    0.0269
1.0000    0.1025
2.0000    0.1823
3.0000    0.2158
4.0000    0.1954
5.0000    0.1400
6.0000    0.0806
7.0000    0.0375
8.0000    0.0140     % (Continued next page)
9.0000    0.0040
10.0000    0.0008
11.0000    0.0001
12.0000    0.0000

Exercise $$\PageIndex{3}$$

(See Exercise 5 from "Problems on Random Variables and Joint Distributions") Suppose a pair of dice is rolled. Let $$X$$ be the total number of spots which turn up. Roll the pair an additional $$X$$ times. Let $$Y$$ be the number of sevens that are thrown on the $$X$$ rolls. Determine the distribution for $$Y$$. What is the probability of three or more sevens?

PX = (1/36)*[0 0 1 2 3 4 5 6 5 4 3 2 1];
PY = [5/6 1/6];
gend
Do not forget zero coefficients for missing powers
Enter gen fn COEFFICIENTS for gN  PX
Enter gen fn COEFFICIENTS for gY  PY
Results are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, P
To view the distribution, call for gD.
disp(gD)
0    0.3072
1.0000    0.3660
2.0000    0.2152
3.0000    0.0828
4.0000    0.0230
5.0000    0.0048
6.0000    0.0008
7.0000    0.0001
8.0000    0.0000
9.0000    0.0000
10.0000    0.0000
11.0000    0.0000
12.0000    0.0000
P = (D>=3)*PD'
P =  0.1116

Exercise $$\PageIndex{4}$$

(See Example 7 from "Conditional Expectation, Regression") A number $$X$$ is chosen by a random selection from the integers 1 through 20 (say by drawing a card from a box). A pair of dice is thrown $$X$$ times. Let $$Y$$ be the number of “matches” (i.e., both ones, both twos, etc.). Determine the distribution for $$Y$$.

gN = (1/20)*[0 ones(1,20)];
gY = [5/6 1/6];
gend
Do not forget zero coefficients for missing powers
Enter gen fn COEFFICIENTS for gN  gN
Enter gen fn COEFFICIENTS for gY  gY
Results are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, P
To view the distribution, call for gD.

disp(gD)
0    0.2435
1.0000    0.2661
2.0000    0.2113
3.0000    0.1419
4.0000    0.0795
5.0000    0.0370
6.0000    0.0144
7.0000    0.0047
8.0000    0.0013
9.0000    0.0003
10.0000    0.0001
11.0000    0.0000
12.0000    0.0000
13.0000    0.0000
14.0000    0.0000
15.0000    0.0000
16.0000    0.0000
17.0000    0.0000
18.0000    0.0000
19.0000    0.0000
20.0000    0.0000

Exercise $$\PageIndex{5}$$

(See Exercise 20 from "Problems on Conditional Expectation, Regression") 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 distribution for $$Y$$. Determine $$E[Y]$$ and $$P(Y \le 20)$$.

gN = 0.01*[0 ones(1,100)];
gY = [5/6 1/6];
gend
Do not forget zero coefficients for missing powers
Enter gen fn COEFFICIENTS for gN  gN
Enter gen fn COEFFICIENTS for gY  gY
Results are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, P
To view the distribution, call for gD.
EY = dot(D,PD)
EY =   8.4167
P20 = (D<=20)*PD'
P20 =  0.9837

Exercise $$\PageIndex{6}$$

(See Exercise 21 from "Problems on Conditional Expectation, Regression") 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 distribution for $$Y$$. Determine $$E[Y]$$ and $$P(Y \le 10)$$.

gN = 0.01*[0 ones(1,100)];
gY = [0.9 0.1];
gend
Do not forget zero coefficients for missing powers
Enter gen fn COEFFICIENTS for gN  gN
Enter gen fn COEFFICIENTS for gY  gY
Results are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, P
To view the distribution, call for gD.
EY = dot(D,PD)
EY =  5.0500
P10 = (D<=10)*PD'
P10 = 0.9188

Exercise $$\PageIndex{7}$$

Suppose the number of entries in a contest is $$N$$ ~ binomial (20, 0.4). There are four questions. Let $$Y_i$$ be the number of questions answered correctly by the $$i$$th contestant. Suppose the $$Y_i$$ are iid, with common distribution

$$Y =$$ [1 2 3 4] $$PY =$$ [0.2 0.4 0.3 0.1]

Let $$D$$ be the total number of correct answers. Determine $$E[D]$$, $$\text{Var} [D]$$, $$P(15 \le D \le 25)$$, and $$P(10 \le D \le 30)$$.

gN = ibinom(20,0.4,0:20);
gY = 0.1*[0 2 4 3 1];
gend
Do not forget zero coefficients for missing powers
Enter gen fn COEFFICIENTS for gN  gN
Enter gen fn COEFFICIENTS for gY  gY
Results are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, P
To view the distribution, call for gD.
ED = dot(D,PD)
ED =  18.4000
VD = (D.^2)*PD' - ED^2
VD =  31.8720
P1 = ((15<=D)&(D<=25))*PD'
P1 =   0.6386
P2 = ((10<=D)&(D<=30))*PD'
P2 =   0.9290

Exercise $$\PageIndex{8}$$

Game wardens are making an aerial survey of the number of deer in a park. The number of herds to be sighted is assumed to be a random variable $$N$$ ~ binomial (20, 0.5). Each herd is assumed to be from 1 to 10 in size, with probabilities

 Value 1 2 3 4 5 6 7 8 9 10 Probability 0.05 0.1 0.15 0.2 0.15 0.1 0.1 0.05 0.05 0.05

Let $$D$$ be the number of deer sighted under this model. Determine $$P(D \le t)$$ for $$t = 25, 50, 75, 100$$ and $$P(D \ge 90)$$.

gN = ibinom(20,0.5,0:20);
gY = 0.01*[0 5 10 15 20 15 10 10 5 5 5];
gend
Do not forget zero coefficients for missing powers
Enter gen fn COEFFICIENTS for gN  gN
Enter gen fn COEFFICIENTS for gY  gY
Results are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, P
To view the distribution, call for gD.
k = [25 50 75 100];
P = zeros(1,4);
for i = 1:4
P(i) = (D<=k(i))*PD';
end
disp(P)
0.0310    0.5578    0.9725    0.9998

Exercise $$\PageIndex{9}$$

A supply house stocks seven popular items. The table below shows the values of the items and the probability of each being selected by a customer.

 Value 12.5 25 30.5 40 42.5 50 60 Probability 0.1 0.15 0.2 0.2 0.15 0.1 0.1

Suppose the purchases of customers are iid, and the number of customers in a day is binomial (10,0.5). Determine the distribution for the total demand $$D$$.

1. How many different possible values are there? What is the maximum possible total sales?
2. Determine $$E[D]$$ and $$P(D \le t)$$ for $$t = 100, 150, 200, 250, 300$$.
Determine $$P(100 < D \le 200)$$.
gN = ibinom(10,0.5,0:10);
Y  = [12.5 25 30.5 40 42.5 50 60];
PY = 0.01*[10 15 20 20 15 10 10];
mgd
Enter gen fn COEFFICIENTS for gN  gN
Enter VALUES for Y  Y
Enter PROBABILITIES for Y  PY
Values are in row matrix D; probabilities are in PD.
To view the distribution, call for mD.
s = size(D)
s =    1   839
M = max(D)
M =    590
t = [100 150 200 250 300];
P = zeros(1,5);
for i = 1:5
P(i) = (D<=t(i))*PD';
end
disp(P)
0.1012    0.3184    0.6156    0.8497    0.9614
P1 = ((100<D)&(D<=200))*PD'
P1 =   0.5144

Exercise $$\PageIndex{10}$$

A game is played as follows:

1. A wheel is spun, giving one of the integers 0 through 9 on an equally likely basis.
2. A single die is thrown the number of times indicated by the result of the spin of the wheel. The number of points made is the total of the numbers turned up on the sequence of throws of the die.
3. A player pays sixteen dollars to play; a dollar is returned for each point made.

Let $$Y$$ represent the number of points made and $$X = Y - 16$$ be the net gain (possibly negative) of the player. Determine the maximum value of

$$X, E[X], \text{Var} [X], P(X > 0), P(X \ge 10), P(X \ge 16)$$

gn = 0.1*ones(1,10);
gy = (1/6)*[0 ones(1,6)];
[Y,PY] = gendf(gn,gy);
[X,PX] = csort(Y-16,PY);
M = max(X)
M =  38
EX = dot(X,PX)               % Check EX = En*Ey - 16 = 4.5*3.5
EX  =  -0.2500               % 4.5*3.5 - 16 = -0.25
VX = dot(X.^2,PX) - EX^2
VX =  114.1875
Ppos = (X>0)*PX'
Ppos =  0.4667
P10 = (X>=10)*PX'
P10 =   0.2147
P16 = (X>=16)*PX'
P16 =   0.0803

Exercise $$\PageIndex{11}$$

Marvin calls on four customers. With probability $$p_1 = 0.6$$ he makes a sale in each case. Geraldine calls on five customers, with probability $$p_2 = 0.5$$ of a sale in each case. Customers who buy do so on an iid basis, and order an amount $$Y_i$$ (in dollars) with common distribution:

$$Y =$$ [200 220 240 260 280 300] $$PY =$$ [0.10 0.15 0.25 0.25 0.15 0.10]

Let $$D_1$$ be the total sales for Marvin and $$D_2$$ the total sales for Geraldine. Let $$D = D_1 + D_2$$. Determine the distribution and mean and variance for $$D_1$$, $$D_2$$, and $$D$$. Determine $$P(D_1 \ge D_2)$$ and $$P(D \ge 1500)$$, $$P(D \ge 1000)$$, and $$P(D \ge 750)$$.

gnM = ibinom(4,0.6,0:4);
gnG = ibinom(5,0.5,0:5);
Y = 200:20:300;
PY = 0.01*[10 15 25 25 15 10];
[D1,PD1] = mgdf(gnM,Y,PY);
[D2,PD2] = mgdf(gnG,Y,PY);
ED1 = dot(D1,PD1)
ED1 =  600.0000              % Check: ED1 = EnM*EY = 2.4*250
VD1 = dot(D1.^2,PD1) - ED1^2
VD1 =    6.1968e+04
ED2 = dot(D2,PD2)
ED2 =  625.0000              % Check: ED2 = EnG*EY = 2.5*250
VD2 = dot(D2.^2,PD2) - ED2^2
VD2 =    8.0175e+04
[D1,D2,t,u,PD1,PD2,P] = icalcf(D1,D2,PD1,PD2);
Use array opertions on matrices X, Y, PX, PY, t, u, and P
[D,PD] = csort(t+u,P);
ED = dot(D,PD)
ED =   1.2250e+03
eD = ED1 + ED2              % Check: ED = ED1 + ED2
eD =   1.2250e+03           % (Continued next page)

VD = dot(D.^2,PD) - ED^2
VD =   1.4214e+05
vD = VD1 + VD2            % Check: VD = VD1 + VD2
vD =   1.4214e+05
P1g2 = total((t>u).*P)
P1g2 = 0.4612
k = [1500 1000 750];
PDk = zeros(1,3);
for i = 1:3
PDk(i) = (D>=k(i))*PD';
end
disp(PDk)
0.2556    0.7326    0.8872

Exercise $$\PageIndex{12}$$

A questionnaire is sent to twenty persons. The number who reply is a random number $$N$$ ~ binomial (20, 0.7). If each respondent has probability $$p = 0.8$$ of favoring a certain proposition, what is the probability of ten or more favorable replies? Of fifteen or more?

gN = ibinom(20,0.7,0:20);
gY = [0.2 0.8];
gend
Do not forget zero coefficients for missing powers
Enter gen fn COEFFICIENTS for gN  gN
Enter gen fn COEFFICIENTS for gY  gY
Results are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, P
To view the distribution, call for gD.
P10 = (D>=10)*PD'
P10 =   0.7788
P15 = (D>=15)*PD'
P15 =   0.0660
pD = ibinom(20,0.7*0.8,0:20);  % Alternate: use D binomial (pp0)
D = 0:20;
p10 = (D>=10)*pD'
p10 =  0.7788
p15 = (D>=15)*pD'
p15 =  0.0660

Exercise $$\PageIndex{13}$$

A random number $$N$$ of students take a qualifying exam. A grade of 70 or more earns a pass. Suppose $$N$$ ~ binomial (20, 0.3). If each student has probability $$p = 0.7$$ of making 70 or more, what is the probability all will pass? Ten or more will pass?

gN = ibinom(20,0.3,0:20);
gY = [0.3 0.7];
gend
Do not forget zero coefficients for missing powers
Enter gen fn COEFFICIENTS for gN  gN
Enter gen fn COEFFICIENTS for gY  gY
Results are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, P
To view the distribution, call for gD.
Pall = (D==20)*PD'
Pall =  2.7822e-14
pall = (0.3*0.7)^20    % Alternate: use D binomial (pp0)
pall =  2.7822e-14
P10 = (D >= 10)*PD'
P10 = 0.0038

Exercise $$\PageIndex{14}$$

Five hundred questionnaires are sent out. The probability of a reply is 0.6. The probability that a reply will be favorable is 0.75. What is the probability of at least 200, 225, 250 favorable replies?

n = 500;
p = 0.6;
p0 = 0.75;
D = 0:500;
PD = ibinom(500,p*p0,D);
k = [200 225 250];
P = zeros(1,3);
for i = 1:3
P(i) = (D>=k(i))*PD';
end
disp(P)
0.9893    0.5173    0.0140

Exercise $$\PageIndex{15}$$

Suppose the number of Japanese visitors to Florida in a week is $$N1$$ ~ Poisson (500) and the number of German visitors is $$N2$$ ~ Poisson (300). If 25 percent of the Japanese and 20 percent of the Germans visit Disney World, what is the distribution for the total number $$D$$ of German and Japanese visitors to the park? Determine $$P(D \ge k)$$ for $$k = 150, 155, \cdot\cdot\cdot, 245, 250$$.

$$JD$$ ~ Poisson (500*0.25 = 125); $$GD$$ ~ Poisson (300*0.20 = 60); $$D$$ ~ Poisson (185).

k = 150:5:250;
PD = cpoisson(185,k);
disp([k;PD]')
150.0000    0.9964
155.0000    0.9892
160.0000    0.9718
165.0000    0.9362
170.0000    0.8736
175.0000    0.7785
180.0000    0.6532
185.0000    0.5098
190.0000    0.3663
195.0000    0.2405
200.0000    0.1435
205.0000    0.0776
210.0000    0.0379
215.0000    0.0167
220.0000    0.0067
225.0000    0.0024
230.0000    0.0008
235.0000    0.0002
240.0000    0.0001
245.0000    0.0000
250.0000    0.0000

Exercise $$\PageIndex{16}$$

A junction point in a network has two incoming lines and two outgoing lines. The number of incoming messages $$N_1$$ on line one in one hour is Poisson (50); on line 2 the number is $$N_2$$ ~ Poisson (45). On incoming line 1 the messages have probability $$P_{1a} = 0.33$$ of leaving on outgoing line a and $$1 - p_{1a}$$ of leaving on line b. The messages coming in on line 2 have probability $$p_{2a} = 0.47$$ of leaving on line a. Under the usual independence assumptions, what is the distribution of outgoing messages on line a? What are the probabilities of at least 30, 35, 40 outgoing messages on line a?

m1a = 50*0.33;  m2a = 45*0.47; ma = m1a + m2a;
PNa = cpoisson(ma,[30 35 40])
PNa =   0.9119    0.6890    0.3722

Exercise $$\PageIndex{17}$$

A computer store sells Macintosh, HP, and various other IBM compatible personal computers. It has two major sources of customers:

1. Students and faculty from a nearby university
2. General customers for home and business computing. Suppose the following assumptions are reasonable for monthly purchases.
• The number of university buyers $$N1$$ ~ Poisson (30). The probabilities for Mac, HP, others are 0.4, 0.2, 0.4, respectively.
• The number of non-university buyers $$N2$$ ~ Poisson (65). The respective probabilities for Mac, HP, others are 0.2, 0.3, 0.5.
• For each group, the composite demand assumptions are reasonable, and the two groups buy independently.

What is the distribution for the number of Mac sales? What is the distribution for the total number of Mac and Dell sales?

Mac sales Poisson (30*0.4 + 65*0.2 = 25); HP sales Poisson (30*0.2 + 65*0.3 = 25.5); total Mac plus HP sales Poisson(50.5).

Exercise $$\PageIndex{18}$$

The number $$N$$ of “hits” in a day on a Web site on the internet is Poisson (80). Suppose the probability is 0.10 that any hit results in a sale, is 0.30 that the result is a request for information, and is 0.60 that the inquirer just browses but does not identify an interest. What is the probability of 10 or more sales? What is the probability that the number of sales is at least half the number of information requests (use suitable simple approximations)?

X = 0:30;
Y = 0:80;
PX = ipoisson(80*0.1,X);
PY = ipoisson(80*0.3,Y);
icalc:  X  Y  PX  PY
- - - - - - - - - - - -
PX10 = (X>=10)*PX'    % Approximate calculation
PX10 =  0.2834
pX10 = cpoisson(8,10)   % Direct calculation
pX10 =  0.2834
M = t>=0.5*u;
PM = total(M.*P)
PM =    0.1572

Exercise $$\PageIndex{19}$$

The number $$N$$ of orders sent to the shipping department of a mail order house is Poisson (700). Orders require one of seven kinds of boxes, which with packing costs have distribution

 Cost (dollars) 0.75 1.25 2 2.5 3 3.5 4 Probability 0.1 0.15 0.15 0.25 0.2 0.1 0.05

What is the probability the total cost of the $2.50 boxes is no greater than$475? What is the probability the cost of the $2.50 boxes is greater than the cost of the$3.00 boxes? What is the probability the cost of the $2.50 boxes is not more than$50.00 greater than the cost of the $3.00 boxes? Suggestion. Truncate the Poisson distributions at about twice the mean value. Answer X = 0:400; Y = 0:300; PX = ipoisson(700*0.25,X); PY = ipoisson(700*0.20,Y); 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 P1 = (2.5*X<=475)*PX' P1 = 0.8785 M = 2.5*t<=(3*u + 50); PM = total(M.*P) PM = 0.7500 Exercise $$\PageIndex{20}$$ One car in 5 in a certain community is a Volvo. If the number of cars passing a traffic check point in an hour is Poisson (130), what is the expected number of Volvos? What is the probability of at least 30 Volvos? What is the probability the number of Volvos is between 16 and 40 (inclusive)? Answer P1 = cpoisson(130*0.2,30) = 0.2407 P2 = cpoisson(26,16) - cpoisson(26,41) = 0.9819 Exercise $$\PageIndex{21}$$ A service center on an interstate highway experiences customers in a one-hour period as follows: • Northbound: Total vehicles: Poisson (200). Twenty percent are trucks. • Southbound: Total vehicles: Poisson (180). Twenty five percent are trucks. • Each truck has one or two persons, with respective probabilities 0.7 and 0.3. • Each car has 1, 2, 3, 4, or 5 persons, with probabilities 0.3, 0.3, 0.2, 0.1, 0.1, respectively Under the usual independence assumptions, let $$D$$ be the number of persons to be served. Determine $$E[D]$$, $$\text{Var} [D]$$, and the generating function $$g_D (s)$$. Answer $$T$$ ~ Poisson (200*0.2 = 180*0.25 = 85), $$P$$ ~ Poisson (200*0.8 + 180*0.75 = 295). a = 85 b = 200*0.8 + 180*0.75 b = 295 YT = [1 2]; PYT = [0.7 0.3]; EYT = dot(YT,PYT) EYT = 1.3000 VYT = dot(YT.^2,PYT) - EYT^2 VYT = 0.2100 YP = 1:5; PYP = 0.1*[3 3 2 1 1]; EYP = dot(YP,PYP) EYP = 2.4000 VYP = dot(YP.^2,PYP) - EYP^2 VYP = 1.6400 EDT = 85*EYT EDT = 110.5000 EDP = 295*EYP EDP = 708.0000 ED = EDT + EDP ED = 818.5000 VT = 85*(VYT + EYT^2) VT = 161.5000 VP = 295*(VYP + EYP^2) VP = 2183 VD = VT + VP VD = 2.2705e+03 NT = 0:180; % Possible alternative gNT = ipoisson(85,NT); gYT = 0.1*[0 7 3]; [DT,PDT] = gendf(gNT,gYT); EDT = dot(DT,PDT) EDT = 110.5000 VDT = dot(DT.^2,PDT) - EDT^2 VDT = 161.5000 NP = 0:500; gNP = ipoisson(295,NP); gYP = 0.1*[0 3 2 2 1 1]; [DP,PDP] = gendf(gNP,gYP); % Requires too much memory $$g_{DT} (s) = \text{exp} (85(0.7s + 0.3s^2 - 1))$$ $$g_{DP} (s) = \text{exp} (295(0.1(3s + 3s^2 2s^3 + s^4 + s^5) - 1))$$ $$g_D (s) = g_{DT} (s) g_{DP} (s)$$ Exercise $$\PageIndex{22}$$ The number $$N$$ of customers in a shop in a given day is Poisson (120). Customers pay with cash or by MasterCard or Visa charge cards, with respective probabilties 0.25, 0.40, 0.35. Make the usual independence assumptions. Let $$N_1, N_2, N_3$$ be the numbers of cash sales, MasterCard charges, Visa card charges, respectively. Determine $$P(N_1 \ge 30)$$, $$P(N_2 \ge 60)$$, $$P(N_3 \ge 50$$, and $$P(N_2 > N_3)$$. Answer X = 0:120; PX = ipoisson(120*0.4,X); Y = 0:120; PY = ipoisson(120*0.35,Y); 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 opertions on matrices X, Y, PX, PY, t, u, and P M = t > u; PM = total(M.*P) PM = 0.7190 Exercise $$\PageIndex{23}$$ A discount retail store has two outlets in Houston, with a common warehouse. Customer requests are phoned to the warehouse for pickup. Two items, a and b, are featured in a special sale. The number of orders in a day from store A is $$N_A$$ ~ Poisson (30); from store B, the nember of orders is $$N_B$$ ~ Poisson (40). For store A, the probability an order for a is 0.3, and for b is 0.7. For store B, the probability an order for a is 0.4, and for b is 0.6. What is the probability the total order for item b in a day is 50 or more? Answer P = cpoisson(30*0.7+40*0.6,50) = 0.2468 Exercise $$\PageIndex{24}$$ The number of bids on a job is a random variable $$N$$ ~ binomial (7, 0.6). Bids (in thousands of dollars) are iid with $$Y$$ uniform on [3, 5]. What is the probability of at least one bid of$3,500 or less? Note that “no bid” is not a bid of 0.

% First solution ---  FY(t) = 1 - gN[P(Y>t)]
P = 1-(0.4 + 0.6*0.75)^7
P  =    0.6794
% Second solution --- Positive number of satisfactory bids,
% i.e. the outcome is indicator for event E, with P(E) = 0.25
pN = ibinom(7,0.6,0:7);
gY = [3/4 1/4];         % Generator function for indicator
[D,PD] = gendf(pN,gY);  % D is number of successes
Pa = (D>0)*PD'          % D>0 means at least one successful bid
Pa =    0.6794

Exercise $$\PageIndex{25}$$

The number of customers during the noon hour at a bank teller's station is a random number $$N$$ with distribution

$$N =$$ 1 : 10, $$PN =$$ 0.01 * [5 7 10 11 12 13 12 11 10 9]

The amounts they want to withdraw can be represented by an iid class having the common distribution $$Y$$ ~ exponential (0.01). Determine the probabilities that the maximum withdrawal is less than or equal to $$t$$ for $$t = 100, 200, 300, 400, 500$$.

Use $$F_W (t) = g_N[P(Y \le T)]$$

gN = 0.01*[0 5 7 10 11 12 13 12 11 10 9];
t = 100:100:500;
PY = 1 - exp(-0.01*t);
FW = polyval(fliplr(gN),PY)  % fliplr puts coeficients in
% descending order of powers
FW =    0.1330    0.4598    0.7490    0.8989    0.9615

Exercise $$\PageIndex{26}$$

A job is put out for bids. Experience indicates the number $$N$$ of bids is a random variable having values 0 through 8, with respective probabilities

 Value 0 1 2 3 4 5 6 7 8 Probability 0.05 0.1 0.15 0.2 0.2 0.1 0.1 0.07 0.03

The market is such that bids (in thousands of dollars) are iid, uniform [100, 200]. Determine the probability of at least one bid of $125,000 or less. Answer Probability of a successful bid $$PY = (125 - 100)/100 = 0.25$$ PY =0.25; gN = 0.01*[5 10 15 20 20 10 10 7 3]; P = 1 - polyval(fliplr(gN),PY) P = 0.9116 Exercise $$\PageIndex{27}$$ A property is offered for sale. Experience indicates the number $$N$$ of bids is a random variable having values 0 through 10, with respective probabilities  Value 0 1 2 3 4 5 6 7 8 9 10 Probability 0.05 0.15 0.15 0.2 0.1 0.1 0.05 0.05 0.05 0.05 0.05 The market is such that bids (in thousands of dollars) are iid, uniform [150, 200] Determine the probability of at least one bid of$180,000 or more.

Consider a sequence of $$N$$ trials with probabilty $$p = (180 - 150)/50 = 0.6$$.

gN = 0.01*[5 15 15 20 10 10 5 5 5 5 5];
gY = [0.4 0.6];
[D,PD] = gendf(gN,gY);
P = (D>0)*PD'
P =   0.8493

Exercise $$\PageIndex{28}$$

A property is offered for sale. Experience indicates the number $$N$$ of bids is a random variable having values 0 through 8, with respective probabilities

 Number 0 1 2 3 4 5 6 7 8 Probability 0.05 0.15 0.15 0.2 0.15 0.1 0.1 0.05 0.05

The market is such that bids (in thousands of dollars) are iid symmetric triangular on [150 250]. Determine the probability of at least one bid of $210,000 or more. Answer gN = 0.01*[5 15 15 20 15 10 10 5 5]; PY = 0.5 + 0.5*(1 - (4/5)^2) PY = 0.6800 >> PW = 1 - polyval(fliplr(gN),PY) PW = 0.6536 %alternate gY = [0.68 0.32]; [D,PD] = gendf(gN,gY); P = (D>0)*PD' P = 0.6536 Exercise $$\PageIndex{29}$$ Suppose $$N$$ ~ binomial (10, 0.3) and the $$Y_i$$ are iid, uniform on [10, 20]. Let $$V$$ be the minimum of the $$N$$ values of the $$Y_i$$. Determine $$P(V > t)$$ for integer values from 10 to 20. Answer gN = ibinom(10,0.3,0:10); t = 10:20; p = 0.1*(20 - t); P = polyval(fliplr(gN),p) - 0.7^10 P = Columns 1 through 7 0.9718 0.7092 0.5104 0.3612 0.2503 0.1686 0.1092 Columns 8 through 11 0.0664 0.0360 0.0147 0 Pa = (0.7 + 0.3*p).^10 - 0.7^10 % Alternate form of gN Pa = Columns 1 through 7 0.9718 0.7092 0.5104 0.3612 0.2503 0.1686 0.1092 Columns 8 through 11 0.0664 0.0360 0.0147 0 Exercise $$\PageIndex{30}$$ Suppose a teacher is equally likely to have 0, 1, 2, 3 or 4 students come in during office hours on a given day. If the lengths of the individual visits, in minutes, are iid exponential (0.1), what is the probability that no visit will last more than 20 minutes. Answer gN = 0.2*ones(1,5); p = 1 - exp(-2); FW = polyval(fliplr(gN),p) FW = 0.7635 gY = [p 1-p]; % Alternate [D,PD] = gendf(gN,gY); PW = (D==0)*PD' PW = 0.7635 Exercise $$\PageIndex{31}$$ Twelve solid-state modules are installed in a control system. If the modules are not defective, they have practically unlimited life. However, with probability $$p = 0.05$$ any unit could have a defect which results in a lifetime (in hours) exponential (0.0025). Under the usual independence assumptions, what is the probability the unit does not fail because of a defective module in the first 500 hours after installation? Answer p = 1 - exp(-0.0025*500); FW = (0.95 + 0.05*p)^12 FW = 0.8410 gN = ibinom(12,0.05,0:12); gY = [p 1-p]; [D,PD] = gendf(gN,gY); PW = (D==0)*PD' PW = 0.8410 Exercise $$\PageIndex{32}$$ The number $$N$$ of bids on a painting is binomial (10, 0.3). The bid amounts (in thousands of dollars) $$Y_i$$ form an iid class, with common density function $$f_Y (t) =0.005 (37 - 2t), 2 \le t \le 10$$. What is the probability that the maximum amount bid is greater than$5,000?

$$P(Y \le 5) = 0.005 \int_{2}^{5} (37 - 2t)\ dt = 0.45$$

p = 0.45;
P = 1 - (0.7 + 0.3*p)^10
P =   0.8352
gN = ibinom(10,0.3,0:10);
gY = [p 1-p];
[D,PD] = gendf(gN,gY);  % D is number of "successes"
Pa = (D>0)*PD'
Pa =  0.8352

Exercise $$\PageIndex{33}$$

A computer store offers each customer who makes a purchase of \$500 or more a free chance at a drawing for a prize. The probability of winning on a draw is 0.05. Suppose the times, in hours, between sales qualifying for a drawing is exponential (4). Under the usual independence assumptions, what is the expected time between a winning draw? What is the probability of three or more winners in a ten hour day? Of five or more?

$$N_t$$ ~ Poisson ($$\lambda t$$), $$N_{Dt}$$ ~ Poisson ($$\lambda pt$$), $$W_{Dt}$$ exponential ($$\lambda p$$).

p = 0.05;
t = 10;
lambda = 4;
EW = 1/(lambda*p)
EW =    5
PND10 = cpoisson(lambda*p*t,[3 5])
PND10 =  0.3233    0.0527

Exercise $$\PageIndex{34}$$

Noise pulses arrrive on a data phone line according to an arrival process such that for each $$t > 0$$ the number $$N_t$$ of arrivals in time interval $$(0, t]$$, in hours, is Poisson $$(7t)$$. The $$i$$th pulse has an “intensity” $$Y_i$$ such that the class $$\{Y_i: 1 \le i\}$$ is iid, with the common distribution function $$F_Y (u) = 1 - e^{-2u^2}$$ for $$u \ge 0$$. Determine the probability that in an eight-hour day the intensity will not exceed two.

$$N_8$$ is Poisson (7*8 = 56) $$g_N (s) = e^{56(s - 1)}$$.

t = 2;
FW2 = exp(56*(1 - exp(-t^2) - 1))
FW2 =   0.3586

Exercise $$\PageIndex{35}$$

The number $$N$$ of noise bursts on a data transmission line in a period $$(0, t]$$ is Poisson ($$\mu$$). The number of digit errors caused by the $$i$$th burst is $$Y_i$$, with the class $$\{Y_i: 1 \le i\}$$ iid, $$Y_i - 1$$ ~ geometric $$(p)$$. An error correcting system is capable or correcting five or fewer errors in any burst. Suppose $$\mu = 12$$ and $$p = 0.35$$. What is the probability of no uncorrected error in two hours of operation?

$$F_W (k) = g_N [P(Y \le k)]P(Y \le k) - 1 - q^{k - 1}\ \ N_t$$ ~ Poisson (12$$t$$)

q = 1 - 0.35;
k = 5;
t = 2;
mu = 12;
FW = exp(mu*t*(1 - q^(k-1) - 1))
FW =  0.0138


This page titled 15.3: Problems on Random Selection is shared under a CC BY 3.0 license and was authored, remixed, and/or curated by Paul Pfeiffer via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.