The binomial distribution
The binomial distribution is defined by this formula for its PDF:

, for x = 0, 1, …, n
Here, n and p are parameters: n must be a positive integer and 0 ≤ p ≤ 1. The symbol is called a binomial coefficient. It can be computed from the following formula:

The exclamation point (!) stands for factorial, which means to multiply the integer by all its preceding positive integers. For example, five factorial is 5! = 5·4·3·2·1 = 120.
We encountered the binomial distribution in Chapter 3, Data Visualization, with the coin-flipping example. Here's a similar example. Suppose you have a bottle with five identical, balanced, tetrahedral dice. Each die has one face painted red and the other three faces painted green, as shown in the following figure:

Figure 4-7. Tetrahedral Die
The experiment is to shake the flat-bottomed bottle and observe how the five dice land. Let X be the number of dice that land with a red face down. This random variable has a binomial distribution with n =...