# Pizza Combinatorics

## By G. Weber Man: So what's this new deal?
Pizza Chef: Two pizzas.
Man: [Towards four-year-old boy.] Two pizzas. Write that down.
Pizza Chef: And on the two pizzas choose any topping up to five.
Ten-Year-Old Boy: Do you...
Pizza Chef: ...have to pick the same topping on each pizza. No!
Four-Year-Old "Math Whiz": Then the possibilities are endless.
Man: What do you mean? Five plus five are ten.
Four-Year-Old "Math Whiz": Actually, there are 1,048,576 possibilities.
Man: Ten was just a ballpark figure.
Old Man: You got that right.
Narrator: [Name of Pizza Chain] favorite five - not one, but two pizzas - choice of five toppings - \$7.98 - pizza, pizza.

On November 8, 1993, the world's largest carry-out pizza chain first aired, on national television, this very popular commercial spot, titled "Math Whiz". Most viewers probably found this commercial to be cute. Some maybe remembered from their mathematical background that the large number of possibilities had something to do with permutations, factorials, combinations, or some other long forgotten technique. Perhaps only the authors of this article were so intrigued that they determined whether or not the four-year-old "math whiz" was correct in his calculations.

The commercial derives its conclusion using the combinatorics calculation where each term added together represents the number of combinations of the given number of toppings chosen, up to five, out of eleven available toppings. The result is then squared since the toppings on the two pizzas need not be the same. However, this analysis yields a value that is nearly twice as large as it should be. For example, if the first pizza is a pepperoni pizza, and the second is a sausage pizza, then the analysis would incorrectly treat this as a different possibility than if the first pizza is a sausage pizza, and the second is a pepperoni pizza. To correct this mistake, this total number of possibilities should be divided by two. However, in each case where both pizzas are identical, there is no need to divide by two, since each of these occurrences appears only once. Thus, for n possibilities for one pizza, contrary to the incorrect n^2 used by the four-year-old "math whiz", would better describe the desired number of possibilities for two pizzas. The first term divides n^2 by two, eliminating the doubled occurrences. However, since the possibilities of two identical pizzas are not doubled, the second term reinstates those possibilities eliminated by the first term. The same result can also be achieved using ,

where the first term allows for the selection of two different pizzas out of the n possibilities for one pizza, and the second term allows both pizzas to be identical. Using n = 1024, now results in 524,800 possibilities for two pizzas. To see if this now is really the correct answer, further consideration of the pizza ordering process must be explored.

The menu pad supplied by the national headquarters, which is used by the local pizza chef, actually has thirteen choices of toppings, excluding extra-cheese, which cannot be used as one of the five selected toppings. The toppings consist of pepperoni (P), mushroom (M), green pepper (GP), onions (O), ham (H), Canadian bacon (CB), bacon (B), ground beef (GB), Italian sausage (IS), black olives (BO), pineapple (PN), hot pepper rings (R), and anchovies (A). The format of the menu pad appears similar to
P | M | GP | O | H | CB | B | GB | IS | BO | PN | R | A ,

and the pizza chef simply puts an X over the symbol for each topping ordered. If double pepperoni, counting as two toppings, is ordered, then the two X's are placed over the P symbol slot. The consideration of the often asked for double topping, and the theoretically possible, but almost never requested triple, quadruple, or quintuple topping is ignored by the "math whiz".

Allowing multiple amounts of a topping greatly complicates the calculations. The easiest way of tackling this updated problem is to consider the menu pad. If in addition to double pepperoni, onions and double Italian sausage are also ordered, then omitting the topping symbols and the blank spaces, the menu pad would look like
X X | | | X | | | | | X X | | | | .

Similarly,
X X X | | | | | | | X | | | | | X

would represent triple pepperoni, ground beef, and anchovies. In fact, any five toppings, allowing multiple amounts of a topping, can be represented by all distinguishable permutations of twelve |'s and five X's. Since the number of distinguishable permutations of r objects, s of which look alike, and t of which look alike is ,

the number of different pizzas with exactly five toppings is .

Likewise, the number of pizzas with exactly four toppings (twelve |'s and four X's) is .

Continuing in this manner, the number of possibilities for one pizza, allowing multiple amounts of a topping, is .

Using n = 8568, the number of overall possibilities for the two pizzas, allowing multiple amounts of a topping, is actually 36,709,596.

The "math whiz" should now be informed that he can order a different set of two pizzas each day for over 35 million more days than he originally calculated. However, since he is only four-years-old, maybe he will eventually be able to try all the possibilities!