<< Chapter < Page | Chapter >> Page > |
A mail order house is featuring three items (limit one of each kind per customer). Let
There is a mailing charge of 3 dollars per order.
We suppose is independent with probabilities 0.6, 0.3, 0.5, respectively. Let X be the amount a customer who orders the special items spends on them plus mailing cost. Then, in affine form,
We seek first the primitive form, using the minterm probabilities, which may calculated in this case by using the m-function minprob.
i | c | s i | ||||
0 | 0 | 0 | 0 | 3 | 3 | 0.14 |
1 | 0 | 0 | 10 | 3 | 13 | 0.14 |
2 | 0 | 18 | 0 | 3 | 21 | 0.06 |
3 | 0 | 18 | 10 | 3 | 31 | 0.06 |
4 | 10 | 0 | 0 | 3 | 13 | 0.21 |
5 | 10 | 0 | 10 | 3 | 23 | 0.21 |
6 | 10 | 18 | 0 | 3 | 31 | 0.09 |
7 | 10 | 18 | 10 | 3 | 41 | 0.09 |
i | s i | |
0 | 3 | 0.14 |
1 | 13 | 0.14 |
4 | 13 | 0.21 |
2 | 21 | 0.06 |
5 | 23 | 0.21 |
3 | 31 | 0.06 |
6 | 31 | 0.09 |
7 | 41 | 0.09 |
k | t k | p k |
1 | 3 | 0.14 |
2 | 13 | 0.14 + 0.21 = 0.35 |
3 | 21 | 0.06 |
4 | 23 | 0.21 |
5 | 31 | 0.06 + 0.09 = 0.15 |
6 | 41 | 0.09 |
We now consider suitable MATLAB steps in determining the distribution from affine form, then incorporate these in the m-procedure canonic for carrying out the transformation. We start with the random variable in affine form, and suppose we have available, orcan calculate, the minterm probabilities.
>>c = [10 18 10 3]; % Constant term is listed last>>pm = minprob(0.1*[6 3 5]);>>M = mintable(3) % Minterm vector pattern
M =0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 10 1 0 1 0 1 0 1
% - - - - - - - - - - - - - - % An approach mimicking ``hand'' calculation>>C = colcopy(c(1:3),8) % Coefficients in position
C =10 10 10 10 10 10 10 10
18 18 18 18 18 18 18 1810 10 10 10 10 10 10 10>>CM = C.*M % Minterm vector values
CM =0 0 0 0 10 10 10 10
0 0 18 18 0 0 18 180 10 0 10 0 10 0 10>>cM = sum(CM) + c(4) % Values on minterms
cM =3 13 21 31 13 23 31 41
% - - - - - - - - - - - - - % Practical MATLAB procedure>>s = c(1:3)*M + c(4)
s =3 13 21 31 13 23 31 41>>pm = 0.14 0.14 0.06 0.06 0.21 0.21 0.09 0.09 % Extra zeros deleted>>const = c(4)*ones(1,8);}
>>disp([CM;const;s;pm]') % Display of primitive form0 0 0 3 3 0.14 % MATLAB gives four decimals
0 0 10 3 13 0.140 18 0 3 21 0.06
0 18 10 3 31 0.0610 0 0 3 13 0.21
10 0 10 3 23 0.2110 18 0 3 31 0.09
10 18 10 3 41 0.09>>[X,PX] = csort(s,pm); % Sorting on s, consolidation of pm>>disp([X;PX]') % Display of final result3 0.14
13 0.3521 0.06
23 0.2131 0.15
41 0.09
Notification Switch
Would you like to follow the 'Applied probability' conversation and receive update notifications?