This does not seem to work: Only when all rows of the truth table are satisfying, q[s](R) are binomial coefficients. Understanding the Binomial distribution provides more insight into how MAXMEAN works. See: http://en.wikipedia.org/wiki/Binomial_distribution In general, if the random variable X follows the binomial distribution with parameters n and p, we write X ~ B(n, p). The probability of getting exactly k successes is given by the probability mass function: f(k;n,p)={n \choose k}p^k(1-p)^{n-k}, for k=0,1,2,...,n. Note that the term: