Exercise 2.4.19. Suppose each pizza can have any subset of the extra toppings (so double pepperoni is not allowed, while no topping at all is allowed). How many possible pairs of pizzas are there? Hint: use the formula for the number of subsets of a set of size n you obtained in Exercise 2.1.8 to find the number of possible pizzas. Then use the formula in Exercise 2.4.14 above to count the number of pairs of pizzas.
Exercise 2.4.20. Suppose each pizza can have any five toppings (so triple pepperoni, onion and sausage would be an example, but just pepperoni would not be). Now how many pairs of pizzas are there? Hint: count pizzas by selecting five toppings from the five toppings, allowing repetitions.
Exercise 2.4.21. Suppose each pizza can have any five or fewer toppings (triple pepperoni and sausage, for example). Now how many pairs of pizzas are there? Hint: introduce a sixth “blank” topping and use the idea in the previous exercise.
2.5
Card Games
Here are some problems involving card games.
A standard deck of cards has 52 cards, broken up into four suits: hearts (♥), diamonds (♦), clubs (♣), and spades (♠). Each suit has 13 cards each. These are 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack (J), Queen (Q), King (K) and Ace (A). These thirteen cards are given an order, called rank. The rank order of the thirteen is specified in the list above. In particular, for our purposes, the ace has the highest rank.
Bridge is a game played by four players, each player receiving 13 cards. A bridge hand consists of a selection of 13 cards.
Exercise 2.5.1. How many bridge hands are there?
Exercise 2.5.2. How many “perfect” hands are there (all one suit)?
Exercise 2.5.3. How bridge hands have exactly 4 cards of one (unspecified) suit and exactly 3 cards in each of the other three suits? (Such a hand is said to have 4-3-3-3 distribution.)
Exercise 2.5.4. How many bridge hands are there that contain 4 diamonds and 3 of each of the other three suits?
A poker hand has five cards. The following exercises ask you to count the number of each kind of poker hand.
Exercise 2.5.5. How many total poker hands are there?
Exercise 2.5.6. A flush has all five cards of the same suit. How many flushes are there?
Exercise 2.5.7. A straight has all five cards in sequence (e.g., 3-4-5-6-7 or 8-9-10-J-Q). How many straights are there?
Exercise 2.5.8. A straight flush is both a straight and a flush. How many straight flushes are there?
Exercise 2.5.9. A full house has three of one kind and two of another kind (e.g., 5-5-5-A-A). How many full houses are there?
Exercise 2.5.10. Four of a kind has four of one kind (e.g., J-J-J-J-9). How many four-of-a-kinds are there?
Exercise 2.5.11. Three of a kind has three of one kind (but not four of a kind and not a full house). How many three-of-a-kinds are there?
Exercise 2.5.12. Two pair has two of one kind, two of another kind, and the fifth card of a third kind (e.g., 5-5-8-8-K). How many two pairs are there? Exercise 2.5.13. A pair has two of one kind (and nothing more) (e.g., 7-7-2- K-A). How many pairs are there?
Chapter 3
Catalan Numbers
This chapter is about the Catalan numbers, a number sequence almost as famous as the Fibonacci numbers. We will give a number of problems whose solution is the Catalan numbers. We will describe the sequence of Catalan numbers by a recursion and by an explicit formula.
3.1
Several Counting Problems
In this section we will describe several different sequences of numbers. We de- scribe these sequences as solutions to counting problems. In subsequent sections, we show that these problems are all solved by the same sequence of numbers.
The first problem is how many ways are there to triangulate a polygon. There are two ways to “triangulate” a quadrilateral. These are shown in Figure 3.1. There are five ways to “triangulate” a pentagon. These are shown in Figure 3.2.
Figure 3.1: Triangulations of a quadrilateral
By “triangulate”, we mean draw non-intersecting diagonals so that the in- terior of the polygon is partitioned into triangles. A triangulation of a hexagon is shown in Figure 3.3.
Exercise 3.1.1. Find all the ways to “triangulate” a hexagon.
Figure 3.2: Triangulations of a pentagon
3.1. SEVERAL COUNTING PROBLEMS 51
Exercise 3.1.2. Bill lives three blocks south and three blocks west from where he works. A railroad track runs diagonally from southwest to northeast, from just southeast of his house to just northeast of his work. Bill can take any of five different routes from home to work without crossing the tracks: NNNEEE, NNENEE, NNEENE, NENNEE, NENENE (see Figure 3.4). Find all the different routes he could take, without crossing tracks, if he lived four blocks south and four blocks west from where he works.
Figure 3.4: Blockwalking
Exercise 3.1.3. A sequence of parentheses is well-formed if every open paren- thesis “(” can be paired with a closed parenthesis “)” to its right in such a way so that the parentheses pairs are “nested.” There are five such sequences of 3 pairs. Here they are with the nestings indicated by braces:
( z }| { ( z }| { (z }| {) ) ) ( z }| { (z }| {)(z }| {) ) ( z }| { (z }| {) )(z }| {) (z }| {)( z }| { (z }| {) )
(z }| {)(z }| {)(z }| {) Find all the sequences of 4 pairs.
Exercise 3.1.4. A sequence of parentheses is balanced if the number of open parentheses equals the number of closed parentheses and, at every point in the sequence, the number of open parentheses to the left of that point is greater than or equal to the number of closed parentheses to the left of that point. There are five such sequences of 3 pairs: ((())), (()()), (())(), ()(()), ()()(). Find all the sequences of 4 pairs.
Note that the well-formed sequences of parentheses and the balanced se- quences of parentheses you found in Exercises 3.1.3 and 3.1.4 are the same. We will prove this in general in a later section.
Exercise 3.1.5. Alice, Brenda, Carlos, Duc, Elaine and Frank are seated in that order around a round table. They can shake hands with one another across the table, without crossing handshakes, in any one of five ways:
AB-CD-EF, AB-CF-DE, AD-BC-EF, AF-BC-DE, AF-BE-CD.
Suppose Georgia and Henry sit down at the table between Frank and Alice. Find all the ways the eight people can shake hands across the table without crossing handshakes.
Exercise 3.1.6. Here are all triples of integers (x1, x2, x3) subject to the con-
ditions that x1= 0, x2= 0 or 1, x3= 0, 1 or 2 and x1≤ x2≤ x3:
(0, 0, 0), (0, 0, 1), (0, 0, 2), (0, 1, 1), (0, 1, 2).
Write down all quadruples of integers (x1, x2, x3, x4) subject to the conditions
that x1= 0, x2= 0 or 1, x3= 0, 1 or 2, x4= 0, 1, 2 or 3 and x1≤ x2≤ x3≤ x4.
Exercise 3.1.7. Outlines contain various levels of headings. The possible out- line structures for all outlines with three headings, possibly at different levels, are shown in Figure 3.5. List all the outline structures with four headings.
Six children, Aaron, Beatrice, Chen, Diana, Eduardo and Faye, are all of different heights. Suppose Aaron is taller than Beatrice, Beatrice is taller than Chen, Chen is taller than Diana, Diana is taller than Eduardo, and Eduardo is taller than Faye. Let’s number the children: Aaron is 1, Beatrice is 2, Chen is
3.1. SEVERAL COUNTING PROBLEMS 53 I I I II A II III II A I I A A B 1
Figure 3.5: Outlines with three headings
3, Diana is 4, Eduardo is 5 and Faye is 6. So one child is taller than another translates into its number being less than the other’s.
There are 5 ways the children can be arranged in two rows and three columns so that the children decrease in height down each column and across each row, as shown in Figure 3.6. We call such an arrangement of numbers a 2 × 3 tableau. Each row and each column of a tableau is in increasing order.
Exercise 3.1.8. Now suppose Ginny and Hal join the group and Faye is taller than Ginny who is taller than Hal. Again, replace Ginny by 7 and Hal by 8. List all the ways the eight children can be arranged in two rows and four columns so that the children decrease in height down each column and across each row. That is, list all the 2 × 4 tableaux.
1 2 3 1 2 4 1 2 5 1 3 4 1 3 5 4 5 6 3 5 6 3 4 6 2 5 6 2 4 6
Figure 3.6: Tableaux of children
Exercise 3.1.9. For any one of Exercises 3.1.1 to 3.1.8, list all possibilities for the next case. For example, list all the possible triangulations of a heptagon (a seven-sided polygon).
Each of the objects above can be used to define a sequence of numbers. For instance, let BWn denote the number of ways Bill can walk to work if he
lives n blocks south and n blocks west of work, if he cannot walk in the region southeast of the diagonal from home to work. You have seen that BW3= 5 and
BW4= 14. We will call such a block-walk a non-crossing block-walk.
Similarly, define {TRn} so that TR3 is the number of ways to triangulate a
pentagon and TR4is the number of ways to triangulate a hexagon.
In the same fashion, define {WFn}, {BAn}, {HSn}, {ISn}, {OLn}, and
{TBn}. Thus, WF3is the number of well-formed sequences of parentheses with
3 pairs of parentheses, BA3 is the number of balanced sequences of parentheses
around a table can shake hands without crossing handshakes. Also, IS3 is the
number of triples of integers described in Exercise 3.1.6, OL3 is the number of
outline structures with 3 headings, and TB3is the number of 2 × 3 tableaux.
The discussion above shows that all the sequences take the value 5 when the parameter is 3, that is,
TR3= WF3= BA3= HS3= IS3= OL3= TB3= BW3= 5 .
Exercises 3.1.1 to 3.1.8 show that all the sequences take the value 14 when the parameter is 4.
Exercise 3.1.10. Show that all the sequences take the value 2 when the sub- script is 2.
Exercise 3.1.11. Show that all the sequences take the value 1 when the sub- script is 1.
Exercise 3.1.12. Describe how the parameter of the sequence relates to the parameter of the problem for each of Exercises 3.1.1 to 3.1.8. For example, in the triangulations of a polygon, what is the relationship between the n in TRn
and the number of sides of the polygon being triangulated?
We will assume that the sequences all take the value 1 when the parameter is 0. This even makes some sense: BW0 = 1, for if Bill lives where he works,
then he has one legal path to work—he sits still!
Thus we have seen that all eight of the sequences defined in this section begin {1, 1, 2, 5, 14, . . . }, where the initial term is indexed by 0.
The rest of this chapter will be devoted to solving the following three prob- lems:
i. Show that all of the sequences above are the same sequence. ii. Find a recursion for this sequence.
iii. Find an explicit formula for this sequence. Section 3.2 will be devoted to showing
BWn= BAn= ISn= TBn, (3.1)
and
WFn= HSn = OLn. (3.2)
The technique that we will use is the Principle of One-to-one Correspondences. Then in Section 3.3 we will show that
BWn= HSn= TRn, (3.3)
by demonstrating that {BWn}, {HSn} and {TRn} all satisfy the same recursion
and the same initial conditions. This will complete the first two parts of our program outlined above.