function y = minprob(p) % MINPROB y = minprob(p) Minterm probs for independent events % Version of 4/7/96 % p is a vector [P(A1) P(A2) ... P(An)], with % {A1,A2, ... An} independent. % y is the row vector of minterm probabilities % Uses the m-functions mintable, colcopy n = length(p); M = mintable(n); a = colcopy(p,2^n); % 2^n columns, each the vector p m = a.*M + (1 - a).*(1 - M); % Puts probabilities into the minterm % pattern on its side (n by 2^n) y = prod(m); % Product of each column of m