The Binomial Distribution

This is just to have something here, under this heading. I hope to have a better discussion later, with contributions from students. This said, here goes:

In Mathematica notation, the ith element of the binomial distribution with sample size n of and probability of success p is:

b[n_, p_, i_] := Binomial[n, i]*(p^i)*((1-p)^(n-i)).

This number is the probability of getting i successes when making n attempts, when each attempt has a probability p of success, or the probability of getting i red marbles when randomly drawing n marbles from a jar containing a proportion p of reds (provided the number of marbles in the jar is large enough that drawing any n marbles has a negligible effect on the proportion. To be mathematically precise, the jar would have to contain infinitely many marbles, since if there are only finitely many then removing marbles may---and generally does---change the proportion of reds in the remaining.)

The coefficient Binomial[n, i] is equal to n*(n-1)*...*(n-i+1)/(1*2*...*i). This is also called "n choose i", because it is the number of ways of choosing i items from an n-element set, where we count two choices the same if they have the same elements. (Thus choosing the Sweet and Pungent Pork, Kung Pao Shrimp and Mongolian Beef is the same as choosing Mongolian Beef, Sweet and Pungent Pork and Kung Pao Shrimp.)

Note that the ith element of the binomial distribution is equal to the ith term of

(p+q)^n = q^n + n*p*q^(n-1) + (n*(n-1)/2)*p^2*q^(n-2)+...,

when evaluated at q = 1-p.