<< Chapter < Page Chapter >> Page >

Boolean combinations using minvec3

We wish to generate a matrix whose rows are the minterm vectors for Ω = A A c , A , A B , A B C , C , and A c C c , 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
Got questions? Get instant answers now!

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 E = A ( B C c ) A c ( B C c ) c and F = A c B c A C of the example above, and suppose the respective minterm probabilities are

p 0 = 0 . 21 , p 1 = 0 . 06 , p 2 = 0 . 29 , p 3 = 0 . 11 , p 4 = 0 . 09 , p 5 = 0 . 03 , p 6 = 0 . 14 , p 7 = 0 . 07

Use of a minterm map shows E = M ( 1 , 4 , 6 , 7 ) and F = M ( 0 , 1 , 5 , 7 ) . so that

P ( E ) = p 1 + p 4 + p 6 + p 7 = p ( 1 , 4 , 6 , 7 ) = 0 . 36 and P ( F ) = p ( 0 , 1 , 5 , 7 ) = 0 . 37

This is easily handled in MATLAB.

  • Use minvec3 to set the generating minterm vectors.
  • Use logical matrix operations
    E = ( A & ( B | C c ) ) | ( A c & ( ( B | C c ) ) ) and F = ( A c & B c ) | ( A & C )
    to obtain the (logical) minterm vectors for E and F .
  • If p m is the matrix of minterm probabilities, perform the algebraic dot product or scalar product of the p m matrix and the minterm vector for the combination. This can be called for by the MATLAB commands PE = E*pm'and PF = F*pm'.

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
Got questions? Get instant answers now!

Solution of the software survey problem

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
Got questions? Get instant answers now!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Applied probability. OpenStax CNX. Aug 31, 2009 Download for free at http://cnx.org/content/col10708/1.6
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Applied probability' conversation and receive update notifications?

Ask