<< Chapter < Page | Chapter >> Page > |
We wish to generate a matrix whose rows are the minterm vectors for , A , , , C , and , respectively.
>>minvec3 % Call for the setup procedure
Variables are A, B, C, Ac, Bc, CcThey may be renamed, if desired>>V = [A|Ac; A; A&B; A&B&C; C; Ac&Cc]; % Logical combinations (one per% row) yield logical vectors>>disp(V)
1 1 1 1 1 1 1 1 % Mixed logical and0 0 0 0 1 1 1 1 % numerical vectors
0 0 0 0 0 0 1 10 0 0 0 0 0 0 1
0 1 0 1 0 1 0 11 0 1 0 0 0 0 0
Minterm probabilities and Boolean combination
If we have the probability of every minterm generated by a finite class, we can determine the probability of any Boolean combination of the members of theclass. When we know the minterm expansion or, equivalently, the minterm vector, we simply pick out the probabilities corresponding to the mintermsin the expansion and add them. In the following example, we do this “by hand” then show how to do it with MATLAB .
Consider and of the example above, and suppose the respective minterm probabilities are
Use of a minterm map shows and . so that
This is easily handled in MATLAB.
The following is a transcript of the MATLAB operations.
>>minvec3 % Call for the setup procedure
Variables are A, B, C, Ac, Bc, CcThey may be renamed, if desired.>>E = (A&(B|Cc))|(Ac&~(B|Cc));>>F = (Ac&Bc)|(A&C);>>pm = 0.01*[21 6 29 11 9 3 14 7];>>PE = E*pm' % Picks out and adds the minterm probabilities
PE = 0.3600>>PF = F*pm'
PF = 0.3700
We set up the matrix equations with the use of MATLAB and solve for the minterm probabilities. From these, we may solve for the desired “target”probabilities.
>>minvec3
Variables are A, B, C, Ac, Bc, CcThey may be renamed, if desired.
Data vector combinations are:>>DV = [A|Ac; A; B; C; A&B&C; Ac&Bc; (A&B)|(A&C)|(B&C); (A&Bc&C) - 2*(Ac&B&C)]
DV =1 1 1 1 1 1 1 1 % Data mixed numerical
0 0 0 0 1 1 1 1 % and logical vectors0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 10 0 0 0 0 0 0 1
1 1 0 0 0 0 0 00 0 0 1 0 1 1 1
0 0 0 -2 0 1 0 0>>DP = [1 0.8 0.65 0.3 0.1 0.05 0.65 0]; % Corresponding data probabilities>>pm = DV\DP' % Solution for minterm probabilities
pm =-0.0000 % Roundoff -3.5 x 10-17
0.05000.1000
0.05000.2000
0.10000.4000
0.1000>>TV = [(A&B&Cc)|(A&Bc&C)|(Ac&B&C); Ac&Bc&C] % Target combinationsTV =
0 0 0 1 0 1 1 0 % Target vectors0 1 0 0 0 0 0 0>>PV = TV*pm % Solution for target probabilities
PV =0.5500 % Target probabilities
0.0500
Notification Switch
Would you like to follow the 'Applied probability' conversation and receive update notifications?