<< Chapter < Page Chapter >> Page >

mintable.m function y = mintable(n) generates a table of minterm vectors by repeated use of the m-function minterm .

function y = mintable(n) % MINTABLE y = mintable(n) Table of minterms vectors% Version of 3/2/93 % Generates a table of minterm vectors% Uses the m-function minterm y = zeros(n,2^n);for i = 1:n y(i,:) = minterm(n,i);end
Got questions? Get instant answers now!

minvec3.m sets basic minterm vectors A , B , C , A c , B c , C c for the class { A , B , C } . (Similarly for minvec4.m, minvec5.m , etc.)

% MINVEC3 file minvec3.m Basic minterm vectors % Version of 1/31/95A = minterm(3,1); B = minterm(3,2);C = minterm(3,3); Ac = ~A;Bc = ~B; Cc = ~C;disp('Variables are A, B, C, Ac, Bc, Cc') disp('They may be renamed, if desired.')
Got questions? Get instant answers now!

minmap function y = minmap(pm) reshapes a row or column vector pm of minterm probabilities into minterm map format.

function y = minmap(pm) % MINMAP y = minmap(pm) Reshapes vector of minterm probabilities% Version of 12/9/93 % Reshapes a row or column vector pm of minterm% probabilities into minterm map format m = length(pm);n = round(log(m)/log(2)); a = fix(n/2);if m ~= 2^n disp('The number of minterms is incorrect')else y = reshape(pm,2^a,2^(n-a));end
Got questions? Get instant answers now!

binary.m function y = binary(d,n) converts a matrix d of floating point nonnegative integers to a matrix of binary equivalents, one on each row.Adapted from m-functions written by Hans Olsson and by Simon Cooke. Each matrix row may be converted to an unspaced string of zeros and ones by the device ys = setstr(y + '0').

function y = binary(d,n) % BINARY y = binary(d,n) Integers to binary equivalents% Version of 7/14/95 % Converts a matrix d of floating point, nonnegative% integers to a matrix of binary equivalents. Each row % is the binary equivalent (n places) of one number.% Adapted from the programs dec2bin.m, which shared % first prize in an April 95 Mathworks contest.% Winning authors: Hans Olsson from Lund, Sweden, % and Simon Cooke from Glasgow, UK.% Each matrix row may be converted to an unspaced string % of zeros and ones by the device: ys = setstr(y + '0').if nargin<2, n = 1; end % Allows omission of argument n [f,e]= log2(d); n = max(max(max(e)),n);y = rem(floor(d(:)*pow2(1-n:0)),2);
Got questions? Get instant answers now!

mincalc.m The m-procedure mincalc determines minterm probabilities from suitable data. For a discussion of the data formatting and certain problems, see 2.6.

% MINCALC file mincalc.m Determines minterm probabilities % Version of 1/22/94 Updated for version 5.1 on 6/6/97% Assumes a data file which includes % 1. Call for minvecq to set q basic minterm vectors, each (1 x 2^q)% 2. Data vectors DV = matrix of md data Boolean combinations of basic sets-- % Matlab produces md minterm vectors-- one on each row.% The first combination is always A|Ac (the whole space) % 3. DP = row matrix of md data probabilities.% The first probability is always 1. % 4. Target vectors TV = matrix of mt target Boolean combinations.% Matlab produces a row minterm vector for each target combination. % If there are no target combinations, set TV = []; [md,nd]= size(DV); ND = 0:nd-1;ID = eye(nd); % Row i is minterm vector i-1 [mt,nt]= size(TV); MT = 1:mt;rd = rank(DV); if rd<md disp('Data vectors are NOT linearly independent')else disp('Data vectors are linearly independent')end % Identification of which minterm probabilities can be determined from the data% (i.e., which minterm vectors are not linearly independent of data vectors) AM = zeros(1,nd);for i = 1:nd AM(i) = rd == rank([DV;ID(i,:)]); % Checks for linear dependence of each endam = find(AM); % minterm vector CAM = ID(am,:)/DV; % Determination of coefficients for the available mintermspma = DP*CAM'; % Calculation of probabilities of available minterms PMA = [ND(am);pma]'; if sum(pma<-0.001)>0 % Check for data consistency disp('Data probabilities are INCONSISTENT')else % Identification of which target probabilities are computable from the dataCT = zeros(1,mt); for j = 1:mtCT(j) = rd == rank([DV;TV(j,:)]);end ct = find(CT);CCT = TV(ct,:)/DV; % Determination of coefficients for computable targets ctp = DP*CCT'; % Determination of probabilitiesdisp(' Computable target probabilities') disp([MT(ct); ctp]') end % end for "if sum(pma<-0.001)>0" disp(['The number of minterms is ',num2str(nd),]) disp(['The number of available minterms is ',num2str(length(pma)),]) disp('Available minterm probabilities are in vector pma')disp('To view available minterm probabilities, call for PMA')
Got questions? Get instant answers now!

Questions & Answers

what is mutation
Janga Reply
what is a cell
Sifune Reply
how is urine form
Sifune
what is antagonism?
mahase Reply
classification of plants, gymnosperm features.
Linsy Reply
what is the features of gymnosperm
Linsy
how many types of solid did we have
Samuel Reply
what is an ionic bond
Samuel
What is Atoms
Daprince Reply
what is fallopian tube
Merolyn
what is bladder
Merolyn
what's bulbourethral gland
Eduek Reply
urine is formed in the nephron of the renal medulla in the kidney. It starts from filtration, then selective reabsorption and finally secretion
onuoha Reply
State the evolution relation and relevance between endoplasmic reticulum and cytoskeleton as it relates to cell.
Jeremiah
what is heart
Konadu Reply
how is urine formed in human
Konadu
how is urine formed in human
Rahma
what is the diference between a cavity and a canal
Pelagie Reply
what is the causative agent of malaria
Diamond
malaria is caused by an insect called mosquito.
Naomi
Malaria is cause by female anopheles mosquito
Isaac
Malaria is caused by plasmodium Female anopheles mosquitoe is d carrier
Olalekan
a canal is more needed in a root but a cavity is a bad effect
Commander
what are pathogens
Don Reply
In biology, a pathogen (Greek: πάθος pathos "suffering", "passion" and -γενής -genēs "producer of") in the oldest and broadest sense, is anything that can produce disease. A pathogen may also be referred to as an infectious agent, or simply a germ. The term pathogen came into use in the 1880s.[1][2
Zainab
A virus
Commander
Definition of respiration
Muhsin Reply
respiration is the process in which we breath in oxygen and breath out carbon dioxide
Achor
how are lungs work
Commander
where does digestion begins
Achiri Reply
in the mouth
EZEKIEL
what are the functions of follicle stimulating harmones?
Rashima Reply
stimulates the follicle to release the mature ovum into the oviduct
Davonte
what are the functions of Endocrine and pituitary gland
Chinaza
endocrine secrete hormone and regulate body process
Achor
while pituitary gland is an example of endocrine system and it's found in the Brain
Achor
what's biology?
Egbodo Reply
Biology is the study of living organisms, divided into many specialized field that cover their morphology, physiology,anatomy, behaviour,origin and distribution.
Lisah
biology is the study of life.
Alfreda
Biology is the study of how living organisms live and survive in a specific environment
Sifune
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

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