Skip to main content
$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$

# 1.2: Basic Counting Principles

• • Contributed by Kenneth P. Bogart
• Professor (Mathematics) at Dartmouth University

$$\newcommand{\vecs}{\overset { \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

$$\circ$$ 1. Five schools are going to send their baseball teams to a tournament, in which each team must play each other team exactly once. How many games are required? Online hint.

$$\bullet$$ 2. Now some number $$n$$ of schools are going to send their baseball teams to a tournament, and each team must play each other team exactly once. Let us think of the teams as numbered 1 through $$n$$.

1. How many games does team 1 have to play in?
2. How many games, other than the one with team 1, does team two have to play in?
3. How many games, other than those with the first $$i − 1$$ teams, does team i have to play in?
4. In terms of your answers to the previous parts of this problem, what is the total number of games that must be played?

$$\bullet$$ 3. One of the schools sending its team to the tournament has to send its players from some distance, and so it is making sandwiches for team members to eat along the way. There are three choices for the kind of bread and five choices for the kind of filling. How many different kinds of sandwiches are available? Online hint.

$$+$$ 4. An ordered pair (a, b) consists of two things we call a and b. We say a is the first member of the pair and b is the second member of the pair. If M is an $$m$$-element set and N is an n-element set, how many ordered pairs are there whose first member is in M and whose second member is in N? Does this problem have anything to do with any of the previous problems?

$$\circ$$ 5. Since a sandwich by itself is pretty boring, students from the school in Problem 3 are offered a choice of a drink (from among five different kinds), a sandwich, and a fruit (from among four different kinds). In how many ways may a student make a choice of the three items now?

$$\bullet$$ 6. The coach of the team in Problem 3 knows of an ice cream parlor along the way where she plans to stop to buy each team member a triple decker cone. There are 12 different flavors of ice cream, and triple decker cones are made in homemade waffle cones. Having chocolate ice cream as the bottom scoop is different from having chocolate ice cream as the top scoop. How many possible ice cream cones are going to be available to the team members? How many cones with three different kinds of ice cream will be available? Online hint.

$$\bullet$$ 7. The idea of a function is ubiquitous in mathematics. A function $$f$$ from a set $$S$$ to a set $$T$$ is a relationship between the two sets that associates exactly one member $$f(x)$$ of T with each element $$x$$ in $$S$$. We will come back to the ideas of functions and relationships in more detail and from different points of view from time to time. However, the quick review above should probably let you answer these questions. If you have difficulty with them, it would be a good idea to go now to Appendix A and work through Section A.1.1 which covers this definition in more detail. You might also want to study Section A.1.3 to learn to visualize the properties of functions. We will take up the topic of this section later in this chapter as well, but in less detail than is in the appendix.

1. Using $$f, g, \dotsb,$$ to stand for the various functions, write down all the different functions you can from the set $$\{1, 2\}$$ to the set $$\{a, b\}$$. For example, you might start with the function f given by $$f(1) = a$$, $$f(2) = b$$. How many functions are there from the set $${1, 2}$$ to the set $$\{a, b\}$$? Online hint.
2. How many functions are there from the three element set $$\{1, 2, 3\}$$ to the two element set $${a, b}$$? Online hint.
3. How many functions are there from the two element set $$\{a, b\}$$ to the three element set $$\{1, 2, 3\}$$? Online hint.
4. How many functions are there from a three element set to a 12 element set?
5. A function $$f$$ is called one-to-one or an injection if whenever $$x$$ is different from $$y$$, $$f(x)$$ is different from $$f(y)$$. How many one-to-one functions are there from a three element set to a 12 element set?
6. Explain the relationship between this problem and Problem 6.

$$\bullet$$ 8. A group of hungry team members in Problem 6 notices it would be cheaper to buy three pints of ice cream for them to split than to buy a triple decker cone for each of them, and that way they would get more ice cream. They ask their coach if they can buy three pints of ice cream.

1. In how many ways can they choose three pints of different flavors out of the 12 flavors? Online hint.
2. In how many ways may they choose three pints if the flavors don’t have to be different? Online hint.

$$\bullet$$ 9. Two sets are said to be disjoint if they have no elements in common. For example, $$\{1, 3, 12\}$$ and $$\{6, 4, 8, 2\}$$ are disjoint, but $$\{1, 3, 12\}$$ and $$\{3, 5, 7\}$$ are not. Three or more sets are said to be mutually disjoint if no two of them have any elements in common. What can you say about the size of the union of a finite number of finite (mutually) disjoint sets? Does this have anything to do with any of the previous problems?

$$\bullet$$ 10. Disjoint subsets are defined in Problem 9. What can you say about the size of the union of $$m$$ (mutually) disjoint sets, each of size $$n$$? Does this have anything to do with any of the previous problems?

## 1.2.1 The sum and product principles

These problems contain among them the kernels of many of the fundamental ideas of combinatorics. For example, with luck, you just stated the sum principle (illustrated in Figure 1.1), and product principle (illustrated in Figure 1.2) in Problems 9 and 10. These are two of the most basic principles of combinatorics. These two counting principles are the basis on which we will develop many other counting principles.

Figure 1.1: The union of these two disjoint sets has size 17. Figure 1.2: The union of four disjoint sets of size five. You may have noticed some standard mathematical words and phrases such as set, ordered pair, function and so on creeping into the problems. One of our goals in these notes is to show how most counting problems can be recognized as counting all or some of the elements of a set of standard mathematical objects. For example, Problem 4 is meant to suggest that the question we asked in Problem 3 was really a problem of counting all the ordered pairs consisting of a bread choice and a filling choice. We use $$A \times B$$ to stand for the set of all ordered pairs whose first element is in $$A$$ and whose second element is in $$B$$ and we call $$A \times B$$ the Cartesian product of A and B. Thus you can think of Problem 4 as asking you for the size of the Cartesian product of $$M$$ and $$N$$, that is, asking you to count the number of elements of this Cartesian product.

When a set $$S$$ is a union of disjoint sets $$B_{1}, B_{2}, \dotsc , B_{m}$$ we say that the sets $$B_{1}, B_{2}, \dotsc , B_{m}$$ are a partition of the set $$S$$. Thus a partition of $$S$$ is a (special kind of) set of sets. So that we don’t find ourselves getting confused between the set $$S$$ and the sets $$B_{i}$$ into which we have divided it, we often call the sets $$B_{1}, B_{2}, \dotsc , B_{m}$$ the blocks of the partition. In this language, the sum principle says that

if we have a partition of a finite set $$S$$, then the size of $$S$$ is the sum of the sizes of the blocks of the partition.

The product principle says that if we have a partition of a finite set $$S$$ into $$m$$ blocks, each of size $$n$$, then S has size $$mn$$.

You’ll notice that in our formal statement of the sum and product principle we talked about a partition of a finite set. We could modify our language a bit to cover infinite sizes, but whenever we talk about sizes of sets in what follows, we will be working with finite sets. So as to avoid possible complications in the future, let us agree that when we refer to the size of a set, we are implicitly assuming the set is finite. There is another version of the product principle that applies directly in problems like Problem 5 and Problem 6, where we were not just taking a union of $$m$$ disjoint sets of size $$n$$, but rather m disjoint sets of size $$n$$, each of which was a union of $$m'$$ disjoint sets of size $$n'$$. This is an inconvenient way to have to think about a counting problem, so we may rephrase the product principle in terms of a sequence of decisions:

$$\bullet$$ 11. If we make a sequence of m choices for which

• there are $$k_{1}$$ possible first choices, and
• for each way of making the first $$i - 1$$ choices, there are $$k_{i}$$ ways

to make the $$i$$th choice, then in how many ways may we make our sequence of choices? (You need not prove your answer correct at this time.) The counting principle you gave in Problem 11 is called the general product principle. We will outline a proof of the general product principle from the original product principle in Problem 80. Until then, let us simply accept it as another counting principle. For now, notice how much easier it makes it to explain why we multiplied the things we did in Problem 5 and Problem 6.

$$\rightarrow$$ 12. A tennis club has $$2n$$ members. We want to pair up the members by twos for singles matches.

1. In how many ways may we pair up all the members of the club? (Hint: consider the cases of 2, 4, and 6 members.) Online hint.
2. Suppose that in addition to specifying who plays whom, for each pairing we say who serves first. Now in how many ways may we specify our pairs? Online hint.

$$+$$ 13. Let us now return to Problem 7 and justify—or perhaps finish—our answer to the question about the number of functions from a three-element set to a 12-element set.

1. How can you justify your answer in Problem 7 to the question “How many functions are there from a three element set (say $$ = \{1, 2, 3\})$$ to a twelve element set (say )? ”
2. Based on the examples you’ve seen so far, make a conjecture about how many functions there are from the set $$[m] = \{1, 2, 3,\dotsc ,m\}$$ to $$[n] = \{1, 2, 3,\dotsc, n\}$$ and prove it.
3. A common notation for the set of all functions from a set $$M$$ to a set $$N$$ is $$N^{M}$$. Why is this a good notation?

$$+$$ 14. Now suppose we are thinking about a set $$S$$ of functions f from [$$m$$] to some set $$X$$. (For example, in Problem 6 we were thinking of the set
of functions from the three possible places for scoops in an ice-cream cone to 12 flavors of ice cream.) Suppose there are $$k_{1}$$ choices for $$f(1)$$. (In Problem 6, $$k_{1}$$ was 12, because there were 12 ways to choose the first scoop.) Suppose that for each choice of $$f(1)$$ there are $$k_{2}$$ choices for f(2). (For example, in Problem 6 $$k_{2}$$ was 12 if the second flavor could be the same as the first, but $$k_{2}$$ was 11 if the flavors had to be different.) In general, suppose that for each choice of $$f(1), f(2), \dotsc, f(i − 1)$$, there are $$k_{i}$$ choices for $$f(i)$$. (For example, in Problem 6, if the flavors have to be different, then for each choice of $$f(1)$$ and $$f(2)$$, there are 10 choices for $$f(3)$$.)

What we have assumed so far about the functions in $$S$$ may be summarized as
• There are $$k_{1}$$ choices for $$f(1)$$.
• For each choice of $$f(1), f(2), \dotsc , f(i − 1)$$, there are $$k_{i}$$ choices for $$f(i)$$.

How many functions are in the set $$S$$? Is there any practical difference between the result of this problem and the general product principle? The point of Problem 14 is that the general product principle can be stated informally, as we did originally, or as a statement about counting sets of standard concrete mathematical objects, namely functions.

$$\rightarrow$$ 15. A roller coaster car has $$n$$ rows of seats, each of which has room for two people. If $$n$$ men and $$n$$ women get into the car with a man and a woman in each row, in how many ways may they choose their seats? Online hint.

$$+$$ 16. How does the general product principle apply to Problem 6?

17. In how many ways can we pass out $$k$$ distinct pieces of fruit to $$n$$ children (with no restriction on how many pieces of fruit a child may get)?

$$\bullet$$ 18. How many subsets does a set $$S$$ with $$n$$ elements have? Online hint.

$$\circ$$ 19. Assuming $$k \leq n$$, in how many ways can we pass out $$k$$ distinct pieces of fruit to $$n$$ children if each child may get at most one? What is the number if $$k > n$$? Assume for both questions that we pass out all the fruit. Online hint.

$$\bullet$$ 20. Another name for a list, in a specific order, of $$k$$ distinct things chosen from a set $$S$$ is a $$k$$-element permutation of $$S$$. We can also think of a $$k$$-element permutation of $$S$$ as a one-to-one function (or, in other words, injection) from $$k = \{1, 2,\dotsc, k\}$$ to $$S$$. How many $$k$$-element permutations does an $$n$$-element set have? (For this problem it is natural to assume $$k \leq n$$. However, the question makes sense even if $$k > n$$.) What is the number of $$k$$-element permutations of an $$n$$-element set if $$k > n$$?

There are a variety of different notations for the number of $$k$$-element permutations of an $$n$$-element set. The one we shall use was introduced by Don Knuth; namely $$n^{\underline{k}}$$, read “n to the k falling” or “n to the k down.” In Problem 20 you may have shown that

$n^{\underline{k}} = n(n - 1) \dotsm (n - k + 1) = \prod^{k}_{i = 1}(n - i + 1)$. (1.1)

It is standard to call $$n^{\underline{k}}$$ the $$k$$-th falling factorial power of $$n$$, which explains why we use exponential notation. We call it a factorial power since $$n^{\underline{n}} = n(n - 1) \dotsm 1$$, which we call $$n$$-factorial and denote by $$n!$$. If you are unfamiliar with the Pi notation, or product notation we introduced for products in Equation 1.1, it works just like the Sigma notation works for summations.

$$\bullet$$ 21. Express $$n^{\underline{k}}$$ as a quotient of factorials.

$$\rightarrow$$ 22. How should we define $$n^{\underline{k}}$$?

## 1.2.2 Functions and directed graphs

As another example of how standard mathematical language relates to counting problems, Problem 7 explicitly asked you to relate the idea of counting functions to the question of Problem 6. You have probably learned in algebra or calculus how to draw graphs in the cartesian plane of functions from a set of numbers to a set of numbers. You may recall how we can determine whether a graph is a graph of a function by examining whether each vertical straight line crosses the graph at most one time. You might also recall how we can determine whether such a function is one-to-one by examining whether each horizontal straight line crosses the graph at most one time. The functions we deal with will often involve objects which are not numbers, and will often be functions from one finite set to another. Thus graphs in the cartesian plane will often not be available to us for visualizing functions. However, there is another kind of graph called a directed graph or digraph that is especially useful when dealing with functions between finite sets. We take up this topic in more detail in Appendix A, particularly Section A.1.2 and Section A.1.3. In Figure 1.3 we show several examples of digraphs of functions. If we have a function $$f$$ from a set $$S$$ to a set $$T$$, we draw a

Figure 1.3: What is a digraph of a function? line of dots or circles, called vertices to represent the elements of $$S$$ and another (usually parallel) line of vertices to represent the elements of $$T$$. We then draw an arrow from the vertex for $$x$$ to the vertex for $$y$$ if $$f(x) = y$$. Sometimes, as in part (e) of the figure, if we have a function from a set $$S$$ to itself, we draw only one set of vertices representing the elements of $$S$$, in which case we can have arrows both entering and leaving a given vertex. As you see, the digraph can be more enlightening in this case if we experiment with the function to find a nice placement of the vertices rather than putting them in a row. Notice that there is a simple test for whether a digraph whose vertices represent the elements of the sets $$S$$ and $$T$$ is the digraph of a function from $$S$$ to $$T$$. There must be one and only one arrow leaving each vertex of the digraph representing an element of $$S$$. The fact that there is one arrow means that $$f(x)$$ is defined for each $$x$$ in $$S$$. The fact that there is only one arrow means that each $$x$$ in $$S$$ is related to exactly one element of $$T$$. (Note that these remarks hold as well if we have a function from S to S and draw only one set of vertices representing the elements of $$S$$.) For further discussion of functions and digraphs see Sections A.1.1 and A.1.2 of Appendix A.

$$\circ$$ 23. Draw the digraph of the function from the set {Alice, Bob, Dawn, Bill} to the set {A, B, C, D, E} given by
$f(X) = \text{the first letter of the name X}$.

$$\bullet$$ 24. A function $$f : S \longrightarrow T$$ is called an onto function or surjection if each element of $$T$$ is $$f(x)$$ for some $$x \in S$$. Choose a set $$S$$ and a set $$T$$ so that you can draw the digraph of a function from $$S$$ to $$T$$ that is one-to-one but not onto, and draw the digraph of such a function.

$$\circ$$ 25. Choose a set $$S$$ and a set $$T$$ so that you can draw the digraph of a function from $$S$$ to $$T$$ that is onto but not one-to-one, and draw the digraph of such a function.

$$\bullet$$ 26. Digraphs of functions help us visualize the ideas of one-to-one functions and onto functions. Online hint.

1. What does the digraph of a one-to-one function (injection) from a finite set $$X$$ to a finite set $$Y$$ look like? (Look for a test somewhat similar to the one we described for when a digraph is the digraph of a function.)
2. What does the digraph of an onto function look like?
3. What does the digraph of a one-to-one and onto function from a finite set $$S$$ to a set $$T$$ look like?

$$\bullet$$ 27. The word permutation is actually used in two different ways in mathematics. A permutation of a set $$S$$ is a one-to-one function from $$S$$ onto $$S$$. How many permutations does an $$n$$-element set have?

Notice that there is a great deal of consistency between the use of the word permutation in Problem 27 and the use in the Problem 20. If we have some way $$a_{1}, a_{2},\dotsc, a_{n}$$ of listing our set $$S$$, then any other list $$b_{1}, b_{2},\dotsc, b_{n}$$ gives us the permutation of $$S$$ whose rule is $$f(a_{i}) = b_{i}$$, and any permutation of $$S$$, say the one given by $$g(a_{i}) = c_{i}$$ gives us a list $$c_{1}, c_{2},\dotsc, c_{n}$$ of $$S$$. Thus there is really very little difference between the idea of a permutation of $$S$$ and an $$n$$-element permutation of $$S$$ when $$n$$ is the size of $$S$$.

## 1.2.3 The bijection principle

Another name for a one-to-one and onto function is bijection. The digraphs marked (a), (b), and (e) in Figure 1.3 are digraphs of bijections. The description in Problem 26c of the digraph of a bijection from $$X$$ to $$Y$$ illustrates one of the fundamental principles of combinatorial mathematics, the bijection principle:

Two sets have the same size if and only if there is a bijection between them.

It is surprising how this innocent sounding principle guides us into finding insight into some otherwise very complicated proofs.

## 1.2.4 Counting subsets of a set

28. The binary representation of a number $$m$$ is a list, or string, $$a_{1} a_{2} \dotsb a_{k}$$ of zeros and ones such that $$m = a_{1}2^{k−1} + a_{2}2^{k−2} + \dotsb + a_{k}2^{0}$$. Describe a bijection between the binary representations of the integers between $$0$$ and $$2^{n} − 1$$ and the subsets of an $$n$$-element set. What does this tell you about the number of subsets of the $$n$$-element set [$$n$$]? Online hint.

Notice that the first question in Problem 8 asked you for the number of ways to choose a three element subset from a 12 element subset. You may have seen a notation like $$\binom{n}{k}, C(n, k)$$, or n$$C$$k which stands for the number of ways to choose a $$k$$-element subset from an $$n$$-element set. The number $$\binom{n}{k}$$ is read as “n choose k” and is called a binomial coefficient for reasons we will see later on. Another frequently used way to read the binomial coefficient notation is “the number of combinations of $$n$$ things taken $$k$$ at a time.” We won’t use this way of reading the notation. You are going to be asked to construct two bijections that relate to these numbers and figure out what famous formula they prove. We are going to think about subsets of the $$n$$-element set $$[n] = \{1, 2, 3, . . . , n\}$$. As an example, the set of two-element subsets of  is

$\{\{1, 2\}, \{1, 3\}, \{1, 4\}, \{2, 3\}, \{2, 4\}, \{3, 4\}\}$.

This example tells us that $$\binom{4}{2} = 6$$.

$$\bullet$$ 29. Let $$C$$ be the set of $$k$$-element subsets of $$[n]$$ that contain the number $$n$$, and let $$D$$ be the set of $$k$$-element subsets of $$[n]$$ that don’t contain $$n$$.

1. Let $$C'$$ be the set of $$(k − 1)$$-element subsets of $$[n − 1]$$. Describe a bijection from C to C0. (A verbal description is fine.)
2. Let $$D'$$ be the set of $$k$$-element subsets of $$[n − 1] = \{1, 2, \dotsc, n − 1}$$. Describe a bijection from $$D$$ to $$D'$$. (A verbal description is fine.)
3. Based on the two previous parts, express the sizes of $$C$$ and $$D$$ in terms of binomial coefficients involving $$n − 1$$ instead of $$n$$.
4. Apply the sum principle to $$C$$ and $$D$$ and obtain a formula that expresses $$\binom{n}{k}$$ in terms of two binomial coefficients involving $$n − 1$$. You have just derived the Pascal Equation that is the basis for the famous Pascal’s Triangle.

## 1.2.5

The Pascal Equation that you derived in Problem 29 gives us the triangle in Figure 1.4. This figure has the number of $$k$$-element subsets of an $$n$$-element set as the $$k$$th number over in the $$n$$th row (we call the top row the zeroth row and the beginning entry of a row the zeroth number over). You’ll see that your formula doesn’t say anything about $$\binom{n}{k}$$ if $$k = 0$$ or $$k = n$$, but otherwise it says that each entry is the sum of the two that are above it and just to the left or right.

30. Just for practice, what is the next row of Pascal’s triangle?

Figure 1.4: Pascal’s Triangle $$\rightarrow$$ 31. Without writing out the rows completely, write out enough of Pascal’s triangle to get a numerical answer for the first question in Problem 8. Online hint.

It is less common to see Pascal’s triangle as a right triangle, but it actually makes your formula easier to interpret. In Pascal’s Right Triangle, the element in row $$n$$ and column $$k$$ (with the convention that the first row is row zero and the first column is column zero) is $$\binom{n}{k}$$. In this case your formula says each entry in a row is the sum of the one above and the one above and to the left, except for the leftmost and right most entries of a row, for which that doesn’t make sense. Since the leftmost entry is $$\binom{n}{0}$$ and the rightmost entry is $$\binom{n}{n}$$, these entries are both one (to see why, ask yourself how many $$0$$-element subsets and how many n-element subsets an n-element set has), and your formula then tells how to fill in the rest of the table.

Figure 1.5: Pascal’s Right Triangle Seeing this right triangle leads us to ask whether there is some natural way to extend the right triangle to a rectangle. If we did have a rectangular table of binomial coefficients, counting the first row as row zero (i.e., $$n = 0$$) and the first column as column zero (i.e., $$k = 0$$), the entries we don’t yet have are values of $$\binom{n}{k}$$ for $$k > n$$. But how many $$k$$-element subsets does an n-element set have if $$k > n$$? The answer, of course, is zero, so all the other entries we would fill in would be zero, giving us the rectangular array in Figure 1.6. It is straightforward to check that Pascal’s Equation now works for all the entries in the rectangle that have an entry above them and an entry above and to the left.

Figure 1.6: Pascal’s Rectangle $$\rightarrow$$ 32. Because our definition told us that $$\binom{n}{k}$$ is $$0$$ when $$k > n$$, we got a rectangular table of numbers that satisfies the Pascal Equation.

1. Is there any other way to define $$\binom{n}{k}$$ when $$k > n$$ in order to get a rectangular table that agrees with Pascal’s Right Triangle for $$k \leq n$$ and satisfies the Pascal Equation? Online hint.
2. Suppose we want to extend Pascal’s Rectangle to the left and define $$\binom{n}{k}$$ for $$n \geq k$$ and $$k > 0$$ so that $$−k < 0$$. What should we put into row n and column $$−k$$ of Pascal’s Rectangle in order for the Pascal Equation to hold true? Online hint.
3. *What should we put into row $$−n$$ (assume n is positive) and column $$k$$ or column $$−k$$ in order for the Pascal Equation to continue to hold? Do we have any freedom of choice? Online hint.

33. There is yet another bijection that lets us prove that a set of size $$n$$ has $$2^{n}$$ subsets. Namely, for each subset S of $$[n] = \{1, 2, . . . , n\}$$, define a function (traditionally denoted by $$\chi_{S}$$) as follows.

$\chi_{S}(i)= \begin{cases} 1, & \text{if}\ i \in S \\ 0, & \text{if}\ i \notin S \end{cases}$

The function $$\chi_{S}$$ is called the characteristic function of $$S$$. Notice that the characteristic function is a function from $$[n]$$ to $$\{0, 1\}$$.

1. For practice, consider the function $$\chi_{\{1,3\}}$$ for the subset $$\{1, 3\}$$ of the set $$\{1, 2, 3, 4\}$$. What are
1. $$\chi_{\{1,3\}}(1)$$?
2. $$\chi_{\{1,3\}}(2)$$?
3. $$\chi_{\{1,3\}}(3)$$?
4. $$\chi_{\{1,3\}}(4)$$?
2. We define a function f from the set of subsets of $$[n] = \{1, 2, . . . , n\}$$ to the set of functions from [n] to {0, 1} by f(S) = S. Explain why f is a bijection.
3. Why does the fact that $$f$$ is a bijection prove that $$[n]$$ has $$2^{n}$$ subsets?

In Problems 18, 28, and 33 you gave three proofs of the following theorem.

## Theorem 1

The number of subsets of an $$n$$-element set is $$2^{n}$$.

The proofs in Problem 28 and 33 use essentially the same bijection, but they interpret sequences of zeros and ones differently, and so end up being different proofs. We will give yet another proof, using bijections similar to those we used in proving the Pascal Equation, at the beginning of Chapter 2.

## 1.2.6 The quotient principle

$$\bullet$$ 34. As we noted in Problem 29, the first question in Problem 8 asked us for the number of three-element subsets of a twelve-element set. We were able to use the Pascal Equation to get a numerical answer to that question. Had we had twenty or thirty flavors of ice cream to choose from, using the Pascal Equation to get our answer would have entailed a good bit more work. We have seen how the general product
principle gives us an answer to Problem 6. Thus we might think that the number of ways to choose a three element set from 12 elements is the number of ways to choose the first element times the number of ways to choose the second element times the number of ways to choose the third element, which is $$12 \cdot 11 \cdot 10 = 1320$$. However, our result in Problem 29 shows that this is wrong.

1. What is it that is different between the number of ways to stack ice cream in a triple decker cone with three different flavors of ice cream and the number of ways to simply choose three different flavors of ice cream?
2. In particular, how many different triple decker cones use vanilla, chocolate, and strawberry? (Of course any three distinct flavors could substitute for vanilla, chocolate and strawberry without changing the answer.)
3. Using your answer from part 34b, compute the number of ways to choose three different flavors of ice cream (out of twelve flavors) from the number of ways to choose a triple decker cone with three different flavors (out of twelve flavors).

$$\bullet$$ 35. Based on what you observed in Problem 34c, how many $$k$$-element
subsets does an $$n$$-element set have?

$$\rightarrow$$ 36. The formula you proved in Problem 35 is symmetric in k and n−k; that is, it gives the same number for $$n \choose k$$ as it gives for $$n \choose n-k$$. Whenever two quantities are counted by the same formula it is good for our insight to find a bijection that demonstrates the two sets being counted have the same size. In fact this is a guiding principle of research in combinatorial mathematics. Find a bijection that proves that $$n \choose k$$ equals $$n \choose n-k$$. Online hint.

$$\bullet$$ 37. In how many ways can we pass out $$k$$ (identical) ping-pong balls to n
children if each child may get at most one?

$$\bullet$$ 38. In how many ways may n people sit around a round table? (Assume that when people are sitting around a round table, all that really matters is who is to each person’s right. For example, if we can get one arrangement of people around the table from another by having everyone get up and move to the right one place and sit back down, then we get an equivalent arrangement of people. Notice that you can get a list from a seating arrangement by marking a place at the table, and then listing the people at the table, starting at that place and moving around to the right.) There are at least two different ways of doing this problem. Try to find them both. Online hint.

We are now going to analyze the result of Problem 35 in more detail in order to tease out another counting principle that we can use in a wide variety of situations.

Table 1.2: The 3-element permutations of $$\{a, b, c, d, e\}$$ organized by which 3-element set they permute. In Table 1.2 we list all three-element permutations of the 5-element set $$\{a, b, c, d, e\}$$. Each row consists of all 3-element permutations of some subset of $$\{a, b, c, d, e\}$$. Because a given k-element subset can be listed as a $$k$$-element permutation in $$k!$$ ways, there are $$3! = 6$$ permutations in each row. Because each 3-element permutation appears exactly once in the table, each row is a block of a partition of the set of 3-element permutations of $$\{a, b, c, d, e\}$$. Each block has size six. Each block consists of all 3-element permutations of some three element subset of $$\{a, b, c, d, e\}$$. Since there are ten rows, we see that there are ten 3-element subsets of $${a, b, c, d, e}$$. An alternate way to see this is to observe that we partitioned the set of all 60 three-element permutations of $$\{a, b, c, d, e\}$$ into some number $$q$$ of blocks, each of size six. Thus by the product principle, $$q \cdot 6 = 60$$, so $$q = 10$$.

$$\bullet$$ 39. Rather than restricting ourselves to $$n = 5$$ and $$k = 3$$, we can partition the set of all $$k$$-element permutations of an $$n$$-element set $$S$$ up into blocks. We do so by letting $$B_{K}$$ be the set (block) of all $$k$$-element permutations of $$K$$ for each $$k$$-element subset $$K$$ of $$S$$. Thus as in our preceding example, each block consists of all permutations of some subset $$K$$ of our $$n$$-element set. For example, the permutations of {a, b, c} are listed in the first row of Table 1.2. In fact each row of that table is a block. The questions that follow are about the corresponding partition of the set of $$k$$-element permutations of $$S$$, where $$S$$ and $$k$$ are arbitrary.

1. How many permutations are there in a block? Online hint.
2. Since $$S$$ has $$n$$ elements, what does Problem 20 tell you about the total number of $$k$$-element permutations of $$S$$?
3. Describe a bijection between the set of blocks of the partition and the set of $$k$$-element subsets of $$S$$. Online hint.
4. What formula does this give you for the number $$n \choose k$$ of $$k$$-element subsets of an $$n$$-element set? Online hint.

$$\rightarrow$$ 40. A basketball team has 12 players. However, only five players play at any given time during a game.

1. In how may ways may the coach choose the five players?
2. To be more realistic, the five players playing a game normally consist of two guards, two forwards, and one center. If there are five guards, four forwards, and three centers on the team, in how many ways can the coach choose two guards, two forwards, and one center? Online hint.
3. What if one of the centers is equally skilled at playing forward? Online hint.

$$\bullet$$ 41. In Problem 38, describe a way to partition the $$n$$-element permutations of the $$n$$ people into blocks so that there is a bijection between the set of blocks of the partition and the set of arrangements of the $$n$$ people around a round table. What method of solution for Problem 38 does this correspond to?

$$\bullet$$ 42. In Problems 39d and 41, you have been using the product principle in a new way. One of the ways in which we previously stated the product principle was “If we partition a set into $$m$$ blocks each of size $$n$$, then the set has size $$m \cdot n$$.” In problems 39d and 41 we knew the size $$p$$ of a set $$P$$ of permutations of a set, and we knew we had partitioned $$P$$ into some unknown number of blocks, each of a certain known size $$r$$. If we let $$q$$ stand for the number of blocks, what does the product principle tell us about $$p$$, $$q$$, and $$r$$? What do we get when we solve for $$q$$?

The formula you found in Problem 42 is so useful that we are going to single it out as another principle. The quotient principle says:

If we partition a set $$P$$ of size $$p$$ into $$q$$ blocks, each of size $$r$$, then $$q = p/r$$.

The quotient principle is really just a restatement of the product principle, but thinking about it as a principle in its own right often leads us to find solutions to problems. Notice that it does not always give us a formula for the number of blocks of a partition; it only works when all the blocks have the same size. In Chapter 6, we develop a way to solve problems with different block sizes in cases where there is a good deal of symmetry in the problem. (The roundness of the table was a symmetry in the problem of
people at a table; the fact that we can order the sets in any order is the symmetry in the problem of counting k-element subsets.)

In Section A.2 of Appendix A we introduce the idea of an equivalence relation, see what equivalence relations have to do with partitions, and discuss the quotient principle from that point of view. While that appendix is not required for what we are doing here, if you want a more thorough discussion of the quotient principle, this would be a good time to work through that appendix.

$$\rightarrow \bullet$$ 43. In how many ways may we string n distinct beads on a necklace without a clasp? (Perhaps we make the necklace by stringing the beads
on a string, and then carefully gluing the two ends of the string together so that the joint can’t be seen. Assume someone can pick up the necklace, move it around in space and put it back down, giving an apparently different way of stringing the beads that is equivalent to the first.) Online hint.

$$\rightarrow$$ 44. We first gave this problem as Problem 12a. Now we have several ways to approach the problem. A tennis club has 2n members. We want to pair up the members by twos for singles matches.

1. In how many ways may we pair up all the members of the club? Give at least two solutions different from the one you gave in Problem 12a. (You may not have done Problem 12a. In that case, see if you can find three solutions.) Online hint.
2. Suppose that in addition to specifying who plays whom, for each pairing we say who serves first. Now in how many ways may we specify our pairs? Try to find as many solutions as you can. Online hint.

$$\rightarrow \cdot$$ 45. (This becomes especially relevant in Chapter 6, though it makes an important point here.) In how many ways may we attach two identical red beads and two identical blue beads to the corners of a square (with one bead per corner) free to move around in (three-dimensional) space? Online hint.

$$\rightarrow$$ 46. While the formula you proved in Problem 35 and Problem 39d is very useful, it doesn’t give us a sense of how big the binomial coefficients are. We can get a very rough idea, for example, of the size of $$2n \choose n$$ by recognizing that we can write $$(2n)^{\underline{n}}/n!$$ as $$\frac{2n}{n} \cdot \frac{2n-1}{n-1} \dotsb \frac{n+1}{1}$$, and each quotient is at least $$2$$, so the product is at least $$2^{n}$$. If this were an accurate estimate, it would mean the fraction of n-element subsets of a $$2n$$-element set would be about $$2^{n}/2^{2n} = 1/2n$$, which becomes very small as $$n$$ becomes large. However, it is pretty clear the approximation will not be a very good one, because some of the terms in that product are much larger than 2. In fact, if $$n \choose k$$ were the same for every $$k$$, then each would be the fraction $$\frac{1}{2n+1}$$ of $$2^{2n}$$. This is much larger than the fraction $$\frac{1}{2n}$$ . But our intuition suggests that $$2n \choose n$$ is much larger than $$2n \choose 1$$ and is likely larger than $$2n \choose n-1$$ so we can be sure our approximation is a bad one. For estimates like this, James Stirling developed a formula to approximate $$n!$$ when $$n$$ is large, namely $$n!$$ is about $$\left(\sqrt{2 \pi n}\right) n^{n}/e^{n}$$. In fact the ratio of $$n!$$ to this expression approaches $$1$$ as $$n$$ becomes infinite. We write this as

$n! \sim \sqrt{2 \pi n} \frac{n^{n}}{e^{n}}$.

We read this notation as n! is asymptotic to $$\sqrt{2 \pi n} \frac{n^{n}}{e^{n}}$$. Use Stirling’s formula to show that the fraction of subsets of size $$n$$ in an $$2n$$-element set is approximately $$\frac{1}{\sqrt{\pi n}}$$. This is a much bigger fraction than $$\frac{1}{2n}$$!