Вы находитесь на странице: 1из 14

The Art of Counting

David M. Bressoud July 24, 2006

Introduction

Counting is the most basic mathematical activity we do, yet it can also be one of the most complex. It lies at the heart of any calculation of probabilities with discrete objects. Finding the number of congurations that satisfy a given set of rules is a recurring problem that one nds in chemistry, in physics, and in almost every discipline of mathematics. Following a short refresher on binomial coecients, this paper will focus on two of my favorite counting problems, problems that illustrate the power of recursion: 1. Slicing cheese: Given a large block of cheese, how many pieces can we get with six straight slices? 2. Square ice: How many ways can we place 25 water molecules (H2 O) into a square lattice so that each oxygen atom along the top or bottom is adjacent to three hydrogen atoms, and all other oxygen atoms are surrounded by exactly four hydrogen atoms? The title of this article is borrowed from a book of selected writings by Paul Erd os [9], one of the great counters of all time.

Binomial Coecients

Recursion is a basic technique of counting. Any formula that connects previous calculations to the next is called recursive. A good example of this is given by binomial coecients such as 5 2 which represents the number of ways of choosing two objects from a selection of ve. If our objects are the ve letters {A, B, C, D, E }, then the possible choices can be listed as AB, AC, AD, AE, BC, BD, BE, CD, CE, DE. I have intentionally separated these. The rst line consists of those choices that include the letter A, the second line those that do not include A. If we include A, then there are four ways of choosing 1

! 0$ =1 # " 0& % ! 1$ =1 # " 0& % ! 2$ =1 # " 0& % + ! 3$ =1 # " 0& % ! 1$ =1 # " 1& % ! 2$ =1 # " 2& % ! 3$ =1 # " 3& %

! 2$ =2 # " 1& % +

! 3$ =3 # " 1& %

! 3$ =3 # " 2& %

! 4$ =1 # " 0& %

! 4$ =4 # " 1& %

! 4$ =6 # " 2& %

! 4$ =4 # " 3& %

! 4$ =1 # " 4& %
! 5$ =1 # " 5& %

! 5$ =1 # " 0& %

! 5$ =5 # " 1& %

! 5$ = 10 # " 2& %

! 5$ = 10 # " 3& %

! 5$ =5 # " 4& %

Figure 1: The recursion that generates Pascals triangle. because there are four other letters, and we must select one of them, not include A, then we must pick two letters from the remaining four:
4 1 4 2

= 4. If our choice does = 6.

This idea works in general. Given n letters from which we must choose k , either we do choose the rst letter, leaving k 1 choices from n 1 letters, or we do not choose the rst letter, leaving k choices from n 1 letters: n1 n n1 + . = k1 k k When we combine this recursive formula with the observation that there is always one way of choosing nothing and one way of choosing everything, we can build Pascals triangle, obtaining each row from the row above by adding pairs of adjacent entries (see Figure 1). This triangle carries Pascals name because of the book he wrote in 1654, Treatise on the Arithmetical Triangle , that both explained and popularized this triangular arrangement of binomial coecients, but it is much older. Figure 2 shows a page from Siyuan yujian by the Chinese mathematician Zhu Shijie, written in 1303. He refers to it as an ancient method. The earliest reliable reference is to a work of Jia Xian from around 1100. There are hints that it might have been known as much as a hundred years earlier in China, in India, and/or in the Islamic Baghdad-Cairo axis.

Figure 2: Pascals triangle from Siyuan yujian , by Zhu Shijie, written in 1303. Reprinted from [5, p. 135].

Slicing Cheese

How many regions in space can we get if we cut space by six planes? This, our rst counting problem, was popularized by George P olya in the short lm he created for the Mathematical Association of America in 1965, Let Us Teach Guessing [7]. The rst published solution was by Jakob Steiner [10] in 1826. See also articles by Alexanderson and Wetzel [1, 2]. This problem is related to the one studied by Jean Pederson in an earlier Mathematical Adventure [6], but in her case, many of the planes were parallel. Here we want no two planes to be parallel and no more than three planes to meet in any single point. In other words, we want to get as many regions as we can. The situation starts out simply (see Figure 3): 0 1 2 3 planes: plane: planes: planes: 1 2 4 8 region regions regions regions.

But the fourth plane does not leave us with 16 regions, but rather only 15. To understand what happens, it is useful to back up and look at a simpler situation. Simpler than space cut by planes would be a plane cut by lines, but we are going to back up even further, to the number of pieces of a line cut by points. An uncut line consists of one piece. Each new cut point increases the number of pieces by one. So a line cut by n points has n + 1 pieces. We now 3

Figure 3: Space sliced by three planes. consider a plane cut by lines. The rst line gives us one additional piece. The second line gives us two additional pieces, and the third line gives us three additional pieces. A fourth line gives us four new pieces, and so on. When we add a new line, say the nth line, it cuts each of the previous n 1 lines. The new line is cut into n pieces. Each of those pieces cuts one region in the plane into two regions (see Figure 4). Since the nth line adds n new regions, the total number of regions on a plane cut by n lines is 1 + 1 + 2 + 3 + + n. What happens when our fourth plane cuts through space? It meets each of the previous three planes. Each of the previous planes cuts the new plane along a line. Our new fourth plane is cut by three lines. It will be cut into seven pieces, each of which creates one new region in space. We had eight regions in space. The fourth plane adds seven new regions. We now have fteen regions. You should be able to see the pattern that enables us to construct the following table: n 0 1 2 3 4 5 6 line by point 1 2 3 4 5 6 7 plane by line 1 2 4 7 11 16 22 space by plane 1 2 4 8 15 26 ?

I leave it to you to determine the number of regions in space cut by six planes. Something else is going on here. You should be very suspicious that each entry in this table is the sum of the entry directly above and the entry above and to the left. That is exactly the recursion 4

Figure 4: A fth line cuts through a plane already cut by four lines. of Pascals triangle. If we list of elements of Pascals triangle so that they line up according to this recursion, we can see what is happening: n 0 1 2 3 4 5 6 line/point 1 2 3 4 5 6 7 plane/line 1 2 4 7 11 16 22 space/plane 1 2 4 8 15 26 ? k=0 1 1 1 1 1 1 1 =1 1 2 3 4 5 6 =2 =3 =4 =5 =6

1 3 6 10 15

1 4 10 20

1 5 15

1 6

The number of pieces on a line cut by points is the sum of the rst two columns of Pascals triangle. For a plane cut by lines, it is the sum of the rst three columns. The formula for the number of pieces in space cut by n planes is n n n n + + + . 0 1 2 3 This leaves several questions that I invite you to explore: 1. Can you make sense of this formula? Given n planes in space, why should the number of regions equal the number of ways choosing none of the planes plus the number of ways of choosing one of the planes plus the number of ways of choosing two of the planes plus the number of ways of choosing three of the planes? 2. What is the formula for the number of nite regions formed by n planes? 3. What happens in higher dimensions, and what does that mean?

O H

O H

O H

O H

O H

O H

O H

O H

O H

O H

O H

O H

O H

O H

O H

O H

O H

O H

O H

O H

Figure 5: A 5 5 sheet of square ice.

Square Ice

A sheet of square ice (see Figure 5) is a grid of oxygen atoms (O) and hydrogen atoms (H). Except along the top and bottom rows, each oxygen atom is surrounded by four hydrogen atoms. Along the top and bottom, there are three hydrogen atoms next to each oxygen atom. If we have a square arrangement of oxygen atoms, then there will be exactly twice as many hydrogen atoms as oxygen atoms. Each oxygen atom must connect to exactly two of the neighboring hydrogen atoms. How many ways can this be done? As stated, this problem is articial. It is extremely dicult to get water to freeze into such a square lattice. But other materials do form square lattices, and this model is a useful description for other physical phenomena. David Robbins, a mathematician at the Institute for Defense Analysis, stumbled upon this question in 1980 when studying an algorithm for evaluating determinants, an algorithm that had been devised by Charles Dodgson [4], better known as Lewis Carroll, the author of Through the Looking Glass and Alices Adventures in Wonderland . Robbins own account of his discovery can be found in [8]. We shall follow Robbinss approach and start by changing this into another, equivalent problem. In each row, we record the molecules for which the oxygen atom is not connected to the hydrogen atom immediately below. We have one such molecule in the rst row, two in the second, and so on. For the sheet of square ice in Figure 5, this is molecule 2 in the rst row, molecules 1 and 4 in the second row, and molecules 1, 2, and 5 in the third row. This sheet of square ice corresponds to the triangle:

2 1 1 1 1 2 2 3 2 4 4 4 5 5 5

Which triangles correspond to sheets of square ice? If a number appears in one row and not in the row below, then the oxygen atom in the row from which it disappeared must be connected to the hydrogen atoms directly above and below. We call this a vertical molecule. If a number does not appear in one row but does appear in the row below, the the oxygen atom in the row in which it appears must be connected to the hydrogen atoms to the left and the right. We call this a horizontal molecule. Knowing where the horizontal and vertical molecules are located uniquely determines our triangle, and vice-versa. Notice that in any row or column, any two vertical molecules must be separated by a horizontal molecule. And any two horizontal molecules must be separated by a vertical molecule. Furthermore, once we have placed our horizontal and vertical molecules, all of the remaining molecular bonds are uniquely determined. If a number in one of the rows of our triangle does not appear in the next row, then there must be two new numbers in that next row, one of which is smaller than the number that disappeared, one of which is larger. In general, if k numbers in a given row do not appear in the next row, then k + 1 new numbers must appear, and for the j th number from the left that disappears, 1 j k , there will be j new smaller numbers that appear, k j + 1 new larger numbers that appear. This is the same as saying that for any three adjacent numbers in the triangle, a b c

we always have b a c and b < c. These inequalities guarantee that there will be a corresponding sheet of square ice. We call a triangle that meets these conditions a monotone triangle. Our example is a monotone triangle of size 5. Now, how many monotone triangles of size 5 are there? We start by listing all of the possible rows of each length (see Figure 6). Each monotone triangle corresponds to a choice of rows. In the gure, the choices that correspond to our example are marked as a path that starts at 12345 and ends at 2. How many such paths are there? Each path must go through one row of each length, but we are not free to take any row we want. The rows of length k that are allowed will depend on the the row of length k + 1 from which the path is coming. For the row of length 4: 1245, there is only one path from 12345. But for the row of length 3: 125, we could go through 1235 or 1245. To get to 124, we could go through 1234, 1235, or 1245. There are four paths to 134, and ve paths to 234. Consider 14, a row of length 2. Any path to 14 must pass through 124, 125, 134, 135, or 145. 7

1 12 13 123 124 1234 14 125

2 15

3 23

4 24 135

5 25 145 1345 34 234 2345 35 45

134

235 345

1235

1245 12345

Figure 6: A choice of rows for the monotone triangles of size 5. We can calculate the number of paths to each of these: 3, 2, 4, 3, and 2, respectively. There are a total of 3 + 2 + 4 + 3 + 2 = 14 dierent paths from 12345 to 14. Figure 7 shows the number of paths to each possible row. When we add up the number of paths to 1, 2, 3, 4, or 5, we get 42 + 105 + 135 + 105 + 42 = 429. There are 429 possible monotone triangles of size 5. This recursion can be programmed fairly easily (Mathematica code can be found in [3, pp. 6263] or downloaded from www.macalester.edu/bressoud/books/PnC/prf-n-con.nb, section 2.3). If An is the number of monotone triangles of size n, then the rst ten values are A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 = = = = = = = = = = 1, 2, 7, 42, 429, 7436, 218348, 10850216, 911835460, 129534272700,

(2 3 7), (3 11 13), (22 11 132 ), (22 132 17 19), (23 13 172 2 192 2), (22 5 172 2 193 23), (22 3 52 7 17 193 232 ).

The factorizations of these numbers are included because they are quite remarkable and suggest that something very interesting is happening. Most numbers as large as 129534272700 have large prime divisors. The numbers we have found all have small prime divisors. There is hope that there might be a nice formula for An . David Robbins next step was to work not with the numbers An , the number of monotone triangles of size n, but to use the values he had found for An,k , 1 k n, the number of monotone triangles

1 2 3 42 105 135 12 13 14 7 14 14 123 124 125 2 3 2 1234

4 5 105 42 35 45 14 7

15 23 24 25 34 7 23 26 14 23 134 4 135 3 1245 12345 145 2 1345

234 235 345 2 5 4 2345

1235

Figure 7: The number of congurations that can lie below each row of a monotone triangles of size 5. of size n with a k at the apex. As we have seen, A5,1 = 42, A5,2 = 105, A5,3 = 135, A5,4 = 105, and A5,5 = 42. We build a triangle of the values An,k :
1 1 2 7 42 429 7436 26026 1287 47320 105 2002 56784 14 135 2002 47320 3 14 105 1287 26026 1 2 7 42 429 7436

Notice that the rst entry in each row is the sum of the entries in the row above. This is easy to explain. A monotone triangle with a 1 at the apex must have all 1s down the left-hand edge. The number of ways of lling in the rest of the triangle is just the number of monotone triangles of the next smaller size. What about the second entry in each row? If we look at the ratio of the second entry to the rst, we see that the ratios increase by 1/2: 1, 3/2, 2, 5/2, 3, 7/2, . . .. There are many representations for each of the other ratios, but Robbins realized that they could be written as shown below:

7436

429 7/2

42 6/2 26026

7 5/ 2 1287 20/11

2 4/ 2 105 14/9 47320

1 3/2 14 9/7 2002 30/25

1 2/2 3 5/5 135 16/16 56784

1 2/3 14 7/9 2002 25/30

2 2/4 105 9/14 47320

7 2/5 1287 11/20

42 2/6 26026

429 2/7

7436

Take a moment to look at those ratios and see if you can pick out the pattern. Once we know the values of An1,k for 1 k n 1, we know that
n1

An,1 =
k=1

An1,k ,

(1)

so we know the rst entry in the next row. If we know the values of the ratios, then the rst entry uniquely determines the remaining entries in that row. We can compute any value of An,k . Isolating just the numerators of our ratios, we get yet another triangle,
2 3 4 5 6 7 20 14 30 9 16 25 5 7 9 11 2 2 2 2 2

The denominators are simply the vertical reection of these numerators. Each numerator is the sum of the two numerators lying directly above it, which suggests that Pascals triangle has appeared once again. In fact, the triangle of numerators can be represented as
1+1 1+2 1+3 1+4 1+5 1+6 5 + 15 4 + 10 10 + 20 3+6 6 + 10 10 + 15 2+3 3+4 4+5 5+6 1+1 1+1 1+1 1+1 1+1

Each numerator and each denominator is a sum of two binomial coecients, An,k+1 = An,k
n2 nk1 n2 k 1

+ +

n1 nk1 n1 k 1

(2)

We have not proven equation 2. In fact, its proof would turn out to be very dicult, not completed until 1996 [11]. But it should be clear that it must be true. Equipped with equations (1) and (2), we can nd an explicit formula for An , the number of monotone triangles of size n. 10

We rst express An in terms of An1 and the ratios: An = An,1 + An,2 + An,3 + + An,n = An,1 1 + An,2 An,2 An,3 An,2 An,n + + + An,1 An,1 An,2 An,1 An,n1 An,2 An,2 An,3 An,2 An,n + + + An,1 An,1 An,2 An,1 An,n1 . (3)

= An1 1 +

Our next step is to simplify the ratio An,k+1 /An,k , An,k+1 An,k
n2 nk1 n2 k 1

+ +

n1 nk1 n1 k 1

(n2)! (n1)! (nk1)!(k1)! + (nk1)!k! (n2)! (n1)! (nk1)!(k1)! + (k1)!(nk)! (n2)! (nk1)!k! (k + n 1) (n2)! (nk)!(k1)! (n k + n

1) (4)

(n k )(n + k 1) . k (2n k 1)

Now we simplify the product of ratios,


t k=1

An,k+1 An,k

(n 1)(n 2) (n t) n(n + 1) (n + t 1) 1 2 t (2n 2)(2n 3) (2n t 1) (n + t 1)!(2n t 2)! t! (n t 1)! (2n 2)! (n 1)!2 (n + t 1)! (2n t 2)! (2n 2)! t! (n 1)! (n t 1)!(n 1)! (n 1)!2 (2n 2)! n+t1 n1 2n t 2 n1 (5)

= = =

Combining this with equation (3), we have that


n1

An = An1
t=0

(n 1)!2 (2n 2)!


n1 t=0

n+t1 n1 n+t1 n1

2n t 2 n1 2n t 2 n1 (6)

= An1

(n 1)!2 (2n 2)!

11

We next prove that 3n 2 2n 1


n1

=
t=0

n+t1 n1

2n t 2 n1

(7)

The left side of this equation counts the number of ways of choosing 2n 1 objects from a set of 3n 2. Let the set from which we are choosing consist of the integers {1, 2, 3, . . . , 3n 2}. What is the nth integer that we choose? It cannot be smaller than n or larger than 2n 1 (because we still have to choose n 1 more integers). Let the nth integer that we choose be n + t where 0 t n 1. For this choice of t, we still need to choose n 1 integers from rst n + t 1 and n 1 integers from the last 2n t 2. That is precisely what the tth summand counts. We now use equation (7) to nish the formula for An : An = An1 = An1 = An1 We know that A1 = 1, and so An = = = =
j =0

(n 1)!2 3n 2 (2n 2)! 2n 1 (n 1)!2 (3n 2)! (2n 2)! (2n 1)! (n 1)! (n 1)! (3n 2)! . (2n 2)! (2n 1)!

(8)

1! 4! 2! 7! 3! 10! (n 1)! (3n 2)! 2! 3! 4! 5! 6! 7! (2n 2)! (2n 1)! 1! 2! (n 1)! 4! 7! (3n 2)! 1! 2! 3! (2n 1)! 4! 7! (3n 2)! n! (n + 1)! (2n 1)!
n1

(3j + 1)! . (n + j )!

(9)

And there it is! We have found a simple formula for the number of monotone triangles of size n. For example, A5 = 1! 4! 7! 10! 13! 9 10 10 11 12 13 = = 3 11 13 = 429. 5! 6! 7! 8! 9! 234556

For more on this problem and an explanation of the proof of equation (2), see [3]. Again, I leave you with several questions to explore: 1. In Figure 7, count the number of paths by starting at the top. For each possible row, nd the numbers of paths from 1, 2, 3, 4, or 5 to that row. 2. Every time we have a vertical molecule, its position is marked by an integer that appears in one row of a monotone triangle but not in the row below. When we trace the path that corresponds to this monotone triangle, we will have a path segment for which the row at the 12

upper end has at least one integer that does not appear in the row at the bottom end. We assign a weight to each path segment, equal to the number of integers in the row above that do not appear in the row below. The number of vertical molecules in the sheet of square ice is the sum of the weights along the corresponding path. In Figure 7, nd all paths of weight 4. 3. In Figure 7, instead of nding the total number of paths from 12345 to each row, break it down so that at each row you record the number of paths of each possible weight. How many of the monotone triangles of size 5 correspond to paths of weight 0, 1, 2, 3? 4. For any size monotone triangle, how many paths of weight 0 are there? 5. Let Mn denote the set of monotone triangles of size n. For each M in Mn , let w(M ) be the weight of the corresponding path. Calculate the sum 2w(M )
M Mn

for n = 1, 2, 3, 4, and 5. Guess the general formula for this sum.

References
[1] Gerald L. Alexanderson and John E. Wetzel. Simple partitions of space. Mathematics Magazine, 51:220225, 1978. [2] Gerald L. Alexanderson and John E. Wetzel. Arrangements of planes in space. Discrete Mathematics, 34:219240, 1981. [3] David M. Bressoud. Proofs and Conrmations: The Story of the Alternating Sign Matrix Conjecture. Mathematical Association of America, Washington, DC, 1999. [4] Charles L. Dodgson. Condensation of determinants. Proceedings of the Royal Society, London, 15:150155, 1866. [5] Joseph Needham. Science and Civilisation in China, volume 3. Cambridge University Press, 1959. [6] Jean Pederson. Platonic divisions of space. In David F. Hayes and Tatiana Shubin, editors, Mathematical adventures for students and amateurs, pages 117133. Mathematical Association of America, Washington, DC, 2004. [7] George P olya. Let Us Teach Guessing. video. The Mathematical Association of America, Washington, DC, 1965. [8] David P. Robbins. The story of 1, 2, 7, 42, 429, 7436, . . .. The Mathematical Intelligencer, 13:1219, 1991. [9] Joel Spencer, editor. Paul Erd os: The art of counting, selected writings. MIT Press, Cambridge, MA, 1973.

13

[10] J. Steiner. Einige gesetze u ber die theilung der ebene und des raumes. J. reine angew. Math., 1:349364, 1826. [11] Doron Zeilberger. Proof of the rened alternating sign matrix conjecture. New York Journal of Mathematics, 2:5968, 1996.

14

Вам также может понравиться