Skip to main content
\( \def\negchoose#1#2{\genfrac{[}{]}{0pt}{}{#1}{#2}_{-1}} \newcommand{\mchoose}[2]{\left(\!\binom{#1}{#2}\!\right)} \newcommand{\cycle}[1]{\arraycolsep 5 pt \left(\begin{array}#1\end{array}\right)} \newcommand{\importantarrow}{\Rightarrow} \newcommand{\qchoose}[2]{\left[{#1\atop#2}\right]_q} \newcommand{\bp}{ \begin{enumerate}{\setcounter{enumi}{\value{problemnumber}}}} \newcommand{\ep}{\setcounter{problemnumber}{\value{enumi}} \end{enumerate}} \newcommand{\ignore}[1]{} \renewcommand{\bottomfraction}{.8} \renewcommand{\topfraction}{.8} \newcommand{\apple}{\text{🍎}} \newcommand{\ap}{\apple} \newcommand{\banana}{\text{🍌}} \newcommand{\ba}{\banana} \newcommand{\pear}{\text{🍐}} \newcommand{\pe}{\pear} \DeclareMathOperator{\Fix}{Fix} \DeclareMathOperator{\Orb}{Orb} \newcommand{\F}{\mathcal{F}} \newcommand{\alert}{\fbox} \def\d{\displaystyle} \def\course{Math 228} \newcommand{\f}[1]{\mathfrak #1} \newcommand{\s}[1]{\mathscr #1} \def\N{\mathbb N} \def\B{\mathbf{B}} \def\circleA{(-.5,0) circle (1)} \def\Z{\mathbb Z} \def\circleAlabel{(-1.5,.6) node[above]{$A$}} \def\Q{\mathbb Q} \def\circleB{(.5,0) circle (1)} \def\R{\mathbb R} \def\circleBlabel{(1.5,.6) node[above]{$B$}} \def\C{\mathbb C} \def\circleC{(0,-1) circle (1)} \def\F{\mathbb F} \def\circleClabel{(.5,-2) node[right]{$C$}} \def\A{\mathbb A} \def\twosetbox{(-2,-1.5) rectangle (2,1.5)} \def\X{\mathbb X} \def\threesetbox{(-2,-2.5) rectangle (2,1.5)} \def\E{\mathbb E} \def\O{\mathbb O} \def\U{\mathcal U} \def\pow{\mathcal P} \def\inv{^{-1}} \def\nrml{\triangleleft} \def\st{:} \def\~{\widetilde} \def\rem{\mathcal R} \def\sigalg{$\sigma$-algebra } \def\Gal{\mbox{Gal}} \def\iff{\leftrightarrow} \def\Iff{\Leftrightarrow} \def\land{\wedge} \def\And{\bigwedge} \def\entry{\entry} \def\AAnd{\d\bigwedge\mkern-18mu\bigwedge} \def\Vee{\bigvee} \def\VVee{\d\Vee\mkern-18mu\Vee} \def\imp{\rightarrow} \def\Imp{\Rightarrow} \def\Fi{\Leftarrow} \def\var{\mbox{var}} \def\Th{\mbox{Th}} \def\entry{\entry} \def\sat{\mbox{Sat}} \def\con{\mbox{Con}} \def\iffmodels{\bmodels\models} \def\dbland{\bigwedge \!\!\bigwedge} \def\dom{\mbox{dom}} \def\rng{\mbox{range}} \def\isom{\cong} \DeclareMathOperator{\wgt}{wgt} \newcommand{\vtx}[2]{node[fill,circle,inner sep=0pt, minimum size=4pt,label=#1:#2]{}} \newcommand{\va}[1]{\vtx{above}{#1}} \newcommand{\vb}[1]{\vtx{below}{#1}} \newcommand{\vr}[1]{\vtx{right}{#1}} \newcommand{\vl}[1]{\vtx{left}{#1}} \renewcommand{\v}{\vtx{above}{}} \def\circleA{(-.5,0) circle (1)} \def\circleAlabel{(-1.5,.6) node[above]{$A$}} \def\circleB{(.5,0) circle (1)} \def\circleBlabel{(1.5,.6) node[above]{$B$}} \def\circleC{(0,-1) circle (1)} \def\circleClabel{(.5,-2) node[right]{$C$}} \def\twosetbox{(-2,-1.4) rectangle (2,1.4)} \def\threesetbox{(-2.5,-2.4) rectangle (2.5,1.4)} \def\ansfilename{practice-answers} \def\shadowprops{{fill=black!50,shadow xshift=0.5ex,shadow yshift=0.5ex,path fading={circle with fuzzy edge 10 percent}}} \newcommand{\hexbox}[3]{ \def\x{-cos{30}*\r*#1+cos{30}*#2*\r*2} \def\y{-\r*#1-sin{30}*\r*#1} \draw (\x,\y) +(90:\r) -- +(30:\r) -- +(-30:\r) -- +(-90:\r) -- +(-150:\r) -- +(150:\r) -- cycle; \draw (\x,\y) node{#3}; } \newcommand{\card}[1]{\left| #1 \right|} \newcommand{\twoline}[2]{\begin{pmatrix}#1 \\ #2 \end{pmatrix}} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section2.3Counting with Equivalence

So far we have been able to solve our counting problems simply by use of the sum and product principles, together with the fact that the number of \(k\)-element subsets of an \(n\)-element set is \(\binom{n}{k}\) (the values of which can be found in Pascal's triangle). This means that we have always built up the set of outcomes by combining smaller sets of outcomes combined in various ways.

It is often useful to go the other way. We could purposely over count the number of outcomes, but in a way that we can recover the correct set.

Subsection2.3.1The Quotient Principle

In Activity 93, you showed proved the algebraic formula \(\binom{n}{k} = \frac{n!}{(n-k)!k!}\text{.}\) However, this was done rather indirectly. First you proved the binomial identity \(P(n,k) = \binom{n}{k}k!\) and then wrote \(P(n,k) = \frac{n!}{(n-k)!}\) and solved for \(\binom{n}{k}\text{.}\)

This approach has the advantage of illustrating the connection between combinations and permutations, but the combinatorial argument that both sides of the identity are equal asked you to count the number of permutations in two ways. It is instructive to think of this equation in terms of combinations instead. Let's start with a concrete example.

Activity108

Let's count the number of subsets of \(\{a,b,c,d,e\}\) of size 3. Of course we already know the answer should be \(\binom{5}{3}\text{,}\) which we can see in Pascal's triangle is equal to 10. What might you try if you didn't already know this?

(a)

You might first guess that the answer is \(5\cdot 4 \cdot 3\) since there are 5 choices for which element you put in your subset first, then 4 choices for the next element, and 3 choices for the last element. Write down all 60 of the outcomes you get by counting the “subsets” this way. 1 This might seem like a lot of busy work, but your efforts will be rewarded.

(b)

One of the subsets we are actually interested in is \(\{a,c,d\}\text{.}\) How many of the outcomes you listed above correspond to this set? How many outcomes correspond to the set \(\{c,d,e\}\text{?}\)

(c)

Explain why every subset corresponds to the same number of permutations. Then use this to count the total number of subsets correctly.

Let's look carefully at what we did above. We had a set of permutations (all 60 of the 3-permutations of the set \(\{a,b,c,d,e\}\)). Then we noticed that some of these permutations corresponded the the same subset. Saying that these permutations were related like this feels like defining a equivalence relation.

Activity109

Refer back to your list of 60 3-permutations of \(\{a,b,c,d,e\}\text{.}\)

(a)

Define an equivalence relation on the permutations you listed so that permutations that “correspond” to the same subset are equivalent. That is, give a rule that specifies when two permutations are “equivalent”.

Hint

One rule of this type would be, two permutations are equivalent if they start with the same letter. This is not the one you want though.

(b)

In any set \(S\text{,}\) if you have an equivalence relation \(\sim\text{,}\) you can partition \(S\) into equivalence classes: sets of elements that are equivalent under \(\sim\) (i.e., sets of the form \(\{x \in S \st x \sim a\} \) for a particular element \(a\)).

Write out the equivalence classes generated by the equivalence relation you gave above. Explain why these all have the same size. How many equivalence classes do you have (and how does this relate to the fact that they all have the same size)?

(c)

Find a bijection between the set of equivalence classes and the set of subsets of \(\{a,b,c,d,e\}\text{.}\) Why is this important?

Hint

You might think about the usual way you would write a subset. Essentially what this question is asking is for you to pick a representative for each equivalence class.

This suggests a general approach to solving a counting problem. Say we want to count the number of elements in a set \(S\text{.}\) Suppose we can count the size of some set \(T\text{,}\) perhaps containing many more elements than we are actually interested in counting. Then define an equivalence relation \(\sim\) on \(T\) so that there is a bijection between \(S\) and the set of equivalence classes \(T/\sim\text{.}\) Then if we know the size of \(T/\sim\text{,}\) we have the size of \(S\text{.}\)

Look at the notation \(T/\sim\) that we used to denote the set of equivalence classes of \(T\) under \(\sim\text{.}\) This set is sometimes called the quotient set or quotient space of \(T\) by \(\sim\text{.}\) This is a good name, as you are dividing up a set into parts. It is also a good name because sometimes we can conclude

\begin{equation*} |T/\sim| = |T|/|A| \end{equation*}

where \(A\) is one of the equivalence classes under \(\sim\text{.}\) When can you do this?

Note this is exactly what we did when we counted subsets: we divided the number of permutations by the number of permutations equivalent to each other. That worked precisely because all the equivalence classes had the same size!

This justifies the quotient principle we now state.

The Quotient Principle

If we partition a set of size \(p\) into \(q\) blocks, each of size \(r\text{,}\) then \(q = p/r\text{.}\)

Like the product principle, the quotient principle is really just a statement about how division works. Here are a few examples of how you can use it in counting. In each of the following activities, make sure you can say exactly how the quotient principle could be used.

Activity110

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, 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, especially the one that uses the quotient principle.

Hint1

The problem suggests that you think about how to get a list from a seating arrangement. Could every list of n distinct people come from a seating chart? How many lists of n distinct people are there? How many lists could we get from a given seating chart by taking different starting places?

Hint2

For a different way of doing the problem, suppose that you have chosen one person, say the first one in a list of the people in alphabetical order by name. Now seat that person. Does it matter where they sit? In how many ways can you seat the remaining people? Does it matter where the second person in alphabetical order sits?

Activity111

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.)

Hint1

How could we get a list of beads from a necklace?

Hint2

When we cut the necklace and string it out on a table, there are \(2n\) lists of beads we could get. Why is it \(2n\) rather than \(n\text{?}\)

Activity112

We first gave this problem as Activity 86. 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.

(a)

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 Activity 86. (You may not have done Activity 86. In that case, see if you can find three solutions.)

Hint

You might first choose the pairs of people. You might also choose to make a list of all the people and then take them by twos from the list.

(b)

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.

Hint

You might first choose ordered pairs of people, and have the first person in each pair serve first. You might also choose to make a list of all the people and then take them by twos from the list in order.

Activity113

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?

Hint

It might be helpful to just draw some pictures of the possible configurations. There aren't that many.

Activity114

We have used the quotient principle to explain the formula \(\binom{n}{k} = \frac{n!}{(n-k)!k!}\) by thinking of this as \(\binom{n}{k} = \frac{P(n,k)}{k!}\text{.}\) What if we don't involve \(P(n,k)\) at all?

Describe a set of outcomes that has size \(n!\) that can be partitioned into blocks of size \((n-k)!k!\) so that each block corresponds to something \(\binom{n}{k}\) counts.

Hint1

You might try the next problem first to get an idea.

Hint2

One thing that \(\binom{n}{k}\) counts is all bit strings of length \(n\) and weight \(k\text{.}\) What if instead of bit strings, we wanted all strings made up out of some number of distinct symbols that come in two types? How can you make this be counted by \(n!\text{?}\)

Activity115

How many anagrams of the word “anagram” are there? (An anagram is a rearrangement of all of the letters of a word.)

Hint

A much easier question would be, how many anagrams of the word “anbgrcm”? Then use the quotient principle.

Subsection2.3.2When does Order Matter?

One way to distinguish combinations from permutations is by asking whether “order matters”. Both \(\binom{n}{k}\) and \(P(n,k)\) count the number of ways to select \(k\) objects from \(n\) objects without repeats, but you use the combination \(\binom{n}{k}\) when “order doesn't matter” and the permutation \(P(n,k)\) when “order matters”. Despite the presence of the scare quotes, this is not a false statement, but we must understand what we mean when we say “order matters”.

Activity116

Each counting question below asks for two answers. Decide which answer is a combination and which is a permutation, and why that makes sense.

(a)

An ice-cream shop offers 31 flavors. How many 3-scoop ice-cream cones are possible, assuming each scoop must be a different flavor? How many 3-scoop milkshakes are possible, assuming each scoop must be a different flavor?

Hint

This is not intended to be a trick question. In fact, this example would be a good one for thinking about how permutations and combinations are related in general.

(b)

How many 5-digit numbers are there with distinct, non-zero digits for which the digits must be increasing? How many are there for which the digits can come in any order?

Hint

The point of this question is to push back against your conception of what “order matters” means. Since you know the answers must be \(\binom{9}{5}\) or \(P(9,5)\text{,}\) you should be able to answer correctly by deciding which set is bigger.

(c)

How many injective functions \(f:[k] \to [n]\) are there all together? How many injective functions \(f:[k] \to [n]\) are there that are (strictly) increasing?

Hint

You might as well assume that \(k \le n\) (otherwise the answers would both be 0). If you are stuck, write out some examples of each using two-line notation for the functions. What decisions do you need to make?

Activity117

The number of \(n\)-bit strings of weight \(k\) is \(\binom{n}{k}\text{,}\) so a combination. But in determining one bit string from another, all that matters is the order in which the \(k\) 1's and \(n-k\) 0's appear. So does order matter? In what sense does it not?

Hint

Think about what \(P(n,k)\) would count when building a bit string. Why does it make sense to quotient out by \(k!\text{?}\)

Activity118

Write a clear sentence or two saying specifically what we mean when we say “order matters” to distinguish between combinations and permutations.

Hint

They key here is to think about the set of outcomes that we are counting. Ask yourself, the order of what?

Understanding the role of order in distinguishing outcomes often suggests the use of the quotient principle. You might say we arrive at combinations by counting permutations and modding out by the order. Each block that corresponds to a single combination is a group of permutations that are only different because of their order. Let's see if we can apply this to other counting questions.

Activity119

The ice cream shop is down to only 3 flavors. If you wanted a 3-scoop cone or a 3-scoop shake, made without repeated flavors, there would only be 6 cones possible and only 1 shake. But what if you allowed repeated flavors?

(a)

How many 3-scoop cones are possible?

Hint

You should be able to use the multiplicative principle and nothing else here.

(b)

How many 3-scoop shakes are there? Write all of them down.

Hint

Maybe the flavors are chocolate, vanilla, and strawberry. Some of the outcomes are \(ccv\) and \(csv\text{,}\) but notice that we would not also include \(cvc\) or \(vcs\) because in the blender, order doesn't matter.

(c)

Why doesn't the quotient principle apply here? What goes wrong? You might want to list out all 3-scoop cones and form the equivalence classes of shakes to see the issue.

The previous activity illustrates that you cannot always simply apply the quotient principle to eliminate order mattering. What we are after in the 3-scoop shakes with possibly repeated flavors is a multiset, which is just like a set only we allow for elements to be in the set multiple times, but we still do not care in what order the elements are listed. So an example of an \(4\)-element multiset of \([7]\) is \(\{1,3,3,6\}\text{,}\) which is the same multiset as \(\{1,6,3,3\}\) but different from the multiset \(\{1,3,6\}\) (in particular, this multiset only has three elements).

What we tried to do above was to count multisets by first counting sequences with possibly repeated elements, and then divide out by the number of sequences that just differ by the arrangement of a particular multiset. But this didn't work, because the size of each block was not the same.

However, we would still like to be able to count the number of multisets. How can we do this? Is it an application of the quotient principle after all? To start, let's establish some notation. The number of \(k\)-element subsets of \([n]\) was given by \(n\) choose \(k\) (written \(\binom{n}{k}\)), so we will say that the number of \(k\)-element multisets of \([n]\) will be \(n\) multichoose \(k\), and write \(\mchoose{n}{k}\text{.}\) From what we have seen above, we can say,

\begin{equation*} \mchoose{n}{k} \ne \frac{n^k}{k!} \end{equation*}

despite the obvious allure of this possibility.

Our question now is, what should be in the numerator if not \(n^k\text{?}\) First let's get more comfortable with thinking of multisets as a model for counting questions.

Activity120

Explain why each of the following counting problems have an answer in the form \(\mchoose{n}{k}\) (say what \(n\) and \(k\) should be). That is, show how each of them is counting the number of \(k\)-element multisets of \([n]\) (or a different set of size \(n\)).

(a)

If you have an unlimited supply of pennies, nickles, dimes and quarters, how many handfuls of 7 coins can you grab?

(b)

You roll 10 regular 6-sided dice (because you enjoy playing two games of Yahtzee at once). Assuming the dice are indistinguishable, how many different outcomes are possible?

(c)

How many functions \(f:[5] \to [7]\) are non-decreasing? For example, one such function is \(f = \twoline{1 \amp 2 \amp 3 \amp 4 \amp 5}{2 \amp 5 \amp 5 \amp 6 \amp 7}\text{.}\)

Activity121

Explain why each of the following counting problems are also answered in the form \(\mchoose{n}{k}\) (and say what \(n\) and \(k\) are). You should be able to explain why all of these are equivalent to each other, and then find a bijection from any of them to the set of \(k\)-element multisets of \([n]\text{.}\)

(a)

How many non-negative integer solutions are there to the equation \(x_1 + x_2 + x_3 + x_4 = 10\text{?}\)

(b)

How many ways are there to distribute 7 identical cookies to 5 kids? Some kids might not get any cookies, but you should distribute all 7 cookies.

(c)

How many ways can you put 10 identical books on the 4 shelves of a bookcase? Assume each shelf could hold up to 10 books, and that all the books are always shoved all the way to the left (so we are not worried about where the books are on an individual shelf, just which shelf they go on).

The problems in Activity 121 are sometimes referred to as “distribution problems”, since we are asking for the number of ways to distribute some objects to some recipients. This is a useful model for the other counting techniques we have seen as well. For example, a permutation \(P(n,k)\) gives the number of ways to distribute \(n\) distinct objects to \(k\) distinct recipients, so that each recipient gets exactly one object.

The claim implicit in Activity 121 is that the number of ways to distribute \(n\) identical objects to \(k\) distinct recipients (now allowing each recipient to receive any number of objects, including zero) is \(\mchoose{n}{k}\text{.}\) If this is the case, then we should be able to think of the set of \(k\)-element multisets of \([n]\) as a distribution.

Activity122

Consider \(3\)-element multisets of \([5]\text{.}\) One of these is \(\{1,1,1\}\text{,}\) and another is \(\{2,4,5\}\text{.}\) How are these two multisets like distributing three objects among 5 recipients? What are the objects that you are distributing?

Now let's consider a related distribution problem, where in some way, order now matters. In fact, how is it that saying the distribution problems as in Activity 121 are ones for which order doesn't matter? Look back at our standard example of order mattering or not:

Activity123
(a)

If \(P(n,k)\) counts the number of ways to distribute \(n\) distinct objects to \(k\) distinct recipients in which each recipient receives exactly one object (do you see why this is?), then what distribution does \(\binom{n}{k}\) count? Explain what is playing the roll of “order mattering” in a distribution problem.

(b)

We claim that counting the number of ways to distribute \(n\) identical books to \(k\) distinct shelves is counted by \(\mchoose{n}{k}\text{,}\) and this is a situation in which order does not matter (since we are counting multisets). What would the distribution question be if order did matter? Explain why the answer to that question is NOT \(n^k\text{.}\) (What distribution does that expression count?)

Consider the case where the books are distinct instead of identical. Note also that in the next few activities, the usage of the variables \(k\) and \(n\) are reversed from above. As you work through these next activities, think about why that choice was made.

Activity124

Suppose we wish to place \(k\) distinct books onto the shelves of a bookcase with \(n\) shelves. For simplicity, assume for now that all of the books would fit on any of the shelves. Also, let's imagine pushing the books on a shelf as far to the left as we can, so that we are only thinking about how the books sit relative to each other, not about the exact places where we put the books. Since the books are distinct, we can think of the first book, the second book and so on.

(a)

How many places are there where we can place the first book?

(b)

When we place the second book, if we decide to place it on the shelf that already has a book, does it matter if we place it to the left or right of the book that is already there?

(c)

How many places are there where we can place the second book?

Hint

If you decide to put it on a shelf that already has a book, you have two choices of where to put it on that shelf.

(d)

Once we have \(i-1\) books placed, if we want to place book \(i\) on a shelf that already has some books, is sliding it in to the left of all the books already there different from placing it to the right of all the books already or between two books already there?

(e)

In how many ways may we place the \(i\)th book into the bookcase?

Hint

Among all the places you could put books, on all the shelves, how many are to the immediate left of some book? How many other places are there?

(f)

In how many ways may we place all the books?

The assignment of which books go to which shelves of a bookcase is simply a function from the books to the shelves. But a function does not determine which book sits to the left of which others on the shelf, and this information is part of how the books are arranged on the shelves. In other words, the order in which the shelves receive their books matters. Our function must thus assign an ordered list of books to each shelf. We will call such a function an ordered function. More precisely, an ordered function from a set \(S\) to a set \(T\) is a function that assigns an (ordered) list of elements of \(S\) to some, but not necessarily all, elements of \(T\) in such a way that each element of \(S\) appears on one and only one of the lists. 2 The phrase ordered function is not a standard one, because there is as yet no standard name for the result of an ordered distribution problem.

We often think of functions as a rule that assigns an output to each input. However, we could equally well specify a function by giving the complete inverse image of each element of the codomain. That is, to define a (non-ordered) function \(f:S \to T\text{,}\) we could give the set \(f\inv(t) = \{s \in S \st f(s) = t\}\) for each \(t \in T\text{.}\) The set of elements sent to \(t\) is a set for a function, but for an ordered function, it is a sequence.

Activity125
(a)

In some sort of manufacturing mishap, your set of magnetic letters contains only the first 7 letters of the alphabet, and for some reason 5 identical exclamation marks. How many ways can you arrange all 12 magnets in a single line? (one such line is BG!AD!!!FEC!).

(b)

What does this question have to do with placing \(7\) distinct books on \(6\) shelves?

Hint

Note, there are 5 exclamation marks, but 6 shelves.

(c)

Oh no! Your 5 year old left the 7 magnetic letters in the oven too long and now they are all identical blobs of plastic. How many strings of the 12 magnets can you make now?

Hint

One such string is *!!***!*!*!, which looks a lot like 01100010101.

(d)

What sort of distribution problem does the previous task correspond to? Write a question about books and shelves that has the same answer.

AHA! The previous activity suggests that to count multisets, which is the same as counting distributions of identical objects to distinct recipients, we should apply the quotient principle to ordered functions.

What should the equivalence relation be? Think about bookshelves. An ordered function is a distribution of distinct books to distinct shelves. A multiset is a distribution of identical books to distinct shelves. So we want two ordered functions to be equivalent if their corresponding shelves contain the same number of books (we no longer care what those books are, just how many there are).

Now, given any ordered function, how many ordered functions are in its equivalence class? We can get any other element in the class by permuting the books (but keeping the numbers in each shelf constant). There are \(k\) books, so there are \(k!\) ways to permute them. This is the same for every ordered function, so the equivalence classes all have the same size.

Applying the quotient principle, we arrive at the following.

Subsection2.3.3More Distribution Problems

Both multisets and ordered functions allowed some of the recipients to receive nothing (or for some elements of \([n]\) to not be included in the multiset). What if we didn't want to allow this?

Activity126

Suppose we wish to place the books in Activity 124 (satisfying the assumptions we made there) so that each shelf gets at least one book. Now in how many ways may we place the books? (Hint: how can you make sure that each shelf gets at least one book before you start the process described in Activity 124?)

Hint

How can you make sure that each shelf gets at least one book before you start the process described in Activity 124?

The previous activity is an example of what we might call an ordered surjection. As for ordered functions, we can apply the quotient principle to count distributions where the objects being distributed are no longer distinct.

Activity127

In how many ways may we put \(k\) identical books onto \(n\) shelves if each shelf must get at least one book?

Hint

We already know how to place \(k\) distinct books onto \(n\) distinct shelves so that each shelf gets at least one. Suppose we replace the distinct books with identical ones. If we permute the distinct books before replacement, does that affect the final outcome? There are other ways to solve this problem.

Activity128

A composition of the integer \(k\) into \(n\) parts is a list of \(n\) positive integers that add to \(k\text{.}\) How many compositions are there of an integer \(k\) into \(n\) parts?

Hint

Do you see a relationship between compositions and something else we have counted already?

Activity129

Your answer in Activity 128 can be expressed as a binomial coefficient. This means it should be possible to interpret a composition as a subset of some set. Find a bijection between compositions of \(k\) into \(n\) parts and certain subsets of some set. Explain explicitly how to get the composition from the subset and the subset from the composition.

Hint

If we line up \(k\) identical books, how many adjacencies are there in between books?

Activity130

Explain the connection between compositions of \(k\) into \(n\) parts and the problem of distributing \(k\) identical objects to \(n\) recipients so that each recipient gets at least one.

So far, we have only considered distribution problems in which the recipients are distinct. There are plenty of situations where we would want to consider recipients identical. For example, a problem we will take up in Chapter 3 is how many ways we can partition an integer. For example, we could partition 5 as \(4+1\) or \(3+1+1\text{,}\) but we would not want to also count \(1+4\) or \(1+3+1\) (doing so would be creating a composition, which we have already considered). We can think of the integer partition problem as distributing the 5 units that make up 5 into some number of identical bins.

Here is another example, which we already have the tools to address.

Activity131

In how many ways may we stack \(k\) distinct books into \(n\) identical boxes so that there is a stack in every box? There are two distinct ways to answer this question. Find them both.

Hint1

Imagine taking a stack of \(k\) books, and breaking it up into stacks to put into the boxes in the same order they were originally stacked. If you are going to use \(n\) boxes, in how many places will you have to break the stack up into smaller stacks, and how many ways can you do this?

Hint2

How many different bookcase arrangements correspond to the same way of stacking \(k\) books into \(n\) boxes so that each box has at least one book?

We can think of stacking books into identical boxes as partitioning the books and then ordering the blocks of the partition. This turns out not to be a useful computational way of visualizing the problem because the number of ways to order the books in the various stacks depends on the sizes of the stacks and not just the number of stacks. However this way of thinking actually led to the first hint in Activity 131. Instead of dividing a set up into non-overlapping parts, we may think of dividing a permutation (thought of as a list) of our \(k\) objects up into \(n\) ordered blocks. We will say that a set of ordered lists of elements of a set \(S\) is a broken permutation of \(S\) if each element of \(S\) is in one and only one of these lists. 3 The phrase broken permutation is not standard, because there is no standard name for the solution to this kind of distribution problem. The number of broken permutations of a \(k\)-element set with \(n\) blocks is denoted by \(L(k,n)\text{.}\) The number \(L(k,n)\) is called a Lah Number and, from our solution to Activity 131, is equal to \(k!\binom{k-1}{n-1}/n!\text{.}\)

The Lah numbers are the solution to the question “In how many ways may we distribute \(k\) distinct objects to \(n\) identical recipients if order matters and each recipient must get at least one?”