<< Chapter < Page Chapter >> Page >

Cautionary notes

The program mincalc depends upon the provision in MATLAB for solving equations when less than full data are available (based on the singular valuedecomposition). There are several situations which should be dealt with as special cases. It is usually a good idea to check results by hand to determinewhether they are consistent with data. The checking by hand is usually much easier than obtaining the solution unaided, so that use of MATLAB is advantageous evenin questionable cases.

  1. The Zero Problem . If the total probability of a group of minterms is zero, then it follows that theprobability of each minterm in the group is zero. However, if mincalc does not have enough information to calculate the separate minterm probabilities in the case they arenot zero, it will not pick up in the zero case the fact that the separate minterm probabilities are zero. It simply considers these minterm probabilities not computable.
  2. Linear dependence . In the case of linear dependence, the operation called for by the command CT = TV/DV may not be able to solve the equations. Thematrix may be singular, or it may not be able to decide which of the redundant data equations to use. Should it provide a solution, the result should be checked withthe aid of a minterm map.
  3. Consistency check . Since the consistency check is for negative minterms, if there are not enoughdata to calculate the minterm probabilities, there is no simple check on the consistency. Sometimes the probability of a target vector included in anothervector will actually exceed what should be the larger probability. Without considerable checking, it may be difficult to determine consistency.
  4. In a few unusual cases, the command CT = TV/DV does not operate appropriately, even though the data should be adequate for the problem at hand.Apparently the approximation process does not converge.

MATLAB Solutions for examples using mincalc

Software survey

% file mcalc01 Data for software survey minvec3;DV = [A|Ac; A; B; C; A&B&C; Ac&Bc; (A&B)|(A&C)|(B&C); (A&Bc&C) - 2*(Ac&B&C)];DP = [1 0.8 0.65 0.3 0.1 0.05 0.65 0];TV = [(A&B&Cc)|(A&Bc&C)|(Ac&B&C); Ac&Bc&C];disp('Call for mincalc')>>mcalc01 % Call for data Call for mincalc % Prompt supplied in the data file>>mincalc Data vectors are linearly independentComputable target probabilities 1.0000 0.55002.0000 0.0500 The number of minterms is 8The number of available minterms is 8 Available minterm probabilities are in vector pmaTo view available minterm probabilities, call for PMA>>disp(PMA) % Optional call for minterm probabilities 0 01.0000 0.0500 2.0000 0.10003.0000 0.0500 4.0000 0.20005.0000 0.1000 6.0000 0.40007.0000 0.1000
Got questions? Get instant answers now!

Computer survey

% file mcalc02.m Data for computer survey minvec3DV = [A|Ac; A; B; C; A&B&C; A&C; (A&B)|(A&C)|(B&C); ... 2*(B&C) - (A&C)];DP = 0.001*[1000 565 515 151 51 124 212 0]; TV = [A|B|C; Ac&Bc&C];disp('Call for mincalc')>>mcalc02 Call for mincalc>>mincalc Data vectors are linearly independentComputable target probabilities 1.0000 0.96802.0000 0.0160 The number of minterms is 8The number of available minterms is 8 Available minterm probabilities are in vector pmaTo view available minterm probabilities, call for PMA>>disp(PMA) 0 0.03201.0000 0.0160 2.0000 0.37603.0000 0.0110 4.0000 0.36405.0000 0.0730 6.0000 0.07707.0000 0.0510
Got questions? Get instant answers now!
% file mcalc03.m Data for opinion survey minvec4DV = [A|Ac; A; B; C; D; A&(B|Cc)&Dc; A|((B&C)|Dc) ; Ac&B&Cc&D; ... A&B&C&D; A&Bc&C; Ac&Bc&Cc&D; Ac&B&C; Ac&Bc&Dc; A&Cc; A&C&Dc; A&B&Cc&Dc];DP = 0.001*[1000 200 500 300 700 55 520 200 15 30 195 120 120 ... 140 25 20]; TV = [Ac&((B&Cc)|(Bc&C)); A|(B&Cc)];disp('Call for mincalc')>>mincalc03 Call for mincalc>>mincalc Data vectors are linearly independentComputable target probabilities 1.0000 0.40002.0000 0.4800 The number of minterms is 16The number of available minterms is 16 Available minterm probabilities are in vector pmaTo view available minterm probabilities, call for PMA>>disp(minmap(pma)) % Display arranged as on minterm map 0.0850 0.0800 0.0200 0.02000.1950 0.2000 0.0500 0.0500 0.0350 0.0350 0.0100 0.01500.0850 0.0850 0.0200 0.0150
Got questions? Get instant answers now!

The procedure mincalct

A useful modification, which we call mincalct , computes the available target probabilities, without checking and computing the minterm probabilities. This procedureassumes a data file similar to that for mincalc, except that it does not need the target matrix T V , since it prompts for target Boolean combination inputs. The procedure mincalct may be used after mincalc has performed its operations to calculate probabilitiesfor additional target combinations.

(continued) additional target datum for the opinion survey

Suppose mincalc has been applied to the data for the opinion survey and that it is desired to determine P ( A D B D c ) . It is not necessary to recalculate all the other quantities. We may simply use the procedure mincalct andinput the desired Boolean combination at the prompt.

>>mincalct Enter matrix of target Boolean combinations (A&D)|(B&Dc) Computable target probabilities1.0000 0.2850

Repeated calls for mcalct may be used to compute other target probabilities.

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