<< Chapter < Page | Chapter >> Page > |
Note that the zero power is missing from , corresponding to the fact that .
gN = 0.2*[1 1 1 1 1];gY = 0.1*[0 5 3 2]; % Note the zero coefficient in the zero positiongend
Do not forget zero coefficients for missing powersEnter the gen fn COEFFICIENTS for gN gN
Enter the gen fn COEFFICIENTS for gY gYResults are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, PTo view distribution for D, call for gD
disp(gD) % Optional display of complete distribution 0 0.2000
1.0000 0.1000 2.0000 0.1100
3.0000 0.1250 4.0000 0.1155
5.0000 0.1110 6.0000 0.0964
7.0000 0.0696 8.0000 0.0424
9.0000 0.0203 10.0000 0.0075
11.0000 0.0019 12.0000 0.0003
p3 = (D == 3)*PD' % P(D=3)
P3 = 0.1250P4_12 = ((D >= 4)&(D <= 12))*PD'
P4_12 = 0.4650 % P(4 <= D <= 12)
We are interested in the number of successes in N trials for a general counting random variable. This is a generalization of the Bernoulli case in [link] . Suppose, as in [link] , the number of customers in a major appliance store is equally likely to be 1, 2, or 3, and eachbuys at least one item with probability . Determine the distribution for the number D of buying customers.
SOLUTION
We use , and gend.
gN = (1/3)*[0 1 1 1]; % Note zero coefficient for missing zero powergY = [0.4 0.6]; % Generating function for the indicator functiongend
Do not forget zero coefficients for missing powersEnter gen fn COEFFICIENTS for gN gN
Enter gen fn COEFFICIENTS for gY gYResults are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, PTo view distribution for D, call for gD
disp(gD) 0 0.2080
1.0000 0.4560 2.0000 0.2640
3.0000 0.0720
The procedure gend is limited to simple N and Y k , with nonnegative integer values. Sometimes, a random variable with unbounded range may be approximated by a simplerandom variable. The solution in the following example utilizes such an approximation procedure for the counting random variable N .
The number N of jobs brought to a service shop in a day is Poisson (8). The individual shop hour charges Y k have the common distribution with probabilities .
Under the basic assumptions of our model, determine .
SOLUTION
Since Poisson N is unbounded, we need to check for a sufficient number of terms in a simple approximation. Then we proceed as in the simple case.
pa = cpoisson(8,10:5:30) % Check for sufficient number of terms
pa = 0.2834 0.0173 0.0003 0.0000 0.0000p25 = cpoisson(8,25) % Check on choice of n = 25
p25 = 1.1722e-06gN = ipoisson(8,0:25); % Approximate gN
gY = 0.25*[1 2 1];
gendDo not forget zero coefficients for missing powers
Enter gen fn COEFFICIENTS for gN gN
Enter gen fn COEFFICIENTS for gY gYResults are in N, PN, Y, PY, D, PD, P
May use jcalc or jcalcf on N, D, PTo view distribution for D, call for gD
disp(gD(D<=20,:)) % Calculated values to D = 50
0 0.0025 % Display for D <= 20
1.0000 0.0099 2.0000 0.0248
3.0000 0.0463 4.0000 0.0711
5.0000 0.0939 6.0000 0.1099
7.0000 0.1165 8.0000 0.1132
9.0000 0.1021 10.0000 0.0861
11.0000 0.0684 12.0000 0.0515
13.0000 0.0369 14.0000 0.0253
15.0000 0.0166 16.0000 0.0105
17.0000 0.0064 18.0000 0.0037
19.0000 0.0021 20.0000 0.0012
sum(PD) % Check on sufficiency of approximationans = 1.0000
P4 = (D<=4)*PD'
P4 = 0.1545 % Theoretical value (4 places) = 0.1545ED = D*PD'
ED = 8.0000 % Theoretical = 8 (
[link] )
VD = (D.^2)*PD' - ED^2VD = 11.9999 % Theoretical = 12 (
[link] )
Notification Switch
Would you like to follow the 'Applied probability' conversation and receive update notifications?