Order Matters - The Math Behind Bookshelf Arrangements
Intex and Certex find themselves standing in front of a bookshelf filled with books. Intex, while gazing at the row of volumes, wonders how many different ways they could be rearranged. So, as the two friends pause to reflect, they begin to explore the possibilities together—discovering that even something as simple as organizing books on a shelf can reveal some surprises…
Intex: $\quad$ Hi, Certex! Did you ever wonder in how many ways one can arrange books in a bookshelf?
Certex: $\quad$ Well, actually one can arrange them in a lot of ways—by subject, by author, by date, to name a few. But eventually, the answer to your question depends on what your needs are.
Intex: $\quad$ Hmm, I see! But what if I didn’t care about any particular order, just about how many different ways I could arrange books on the shelf, how would I figure that out? Since there are only so many books, the possibilities to rearrange them can’t be infinite, right?
Certex: $\quad$ Exactly. Since you have a finite set of books, you also have a finite number of possible arrangements. This kind of counting problem is part of a branch of mathematics called combinatorics.
Intex: $\quad$ Combinatorics?
Certex: $\quad$ Combinatorics is the study of counting, arranging, and combining objects. It helps us answer questions like How many different ways can things be organized? It’s widely used in mathematics, computer science, probability, and many other fields.
Intex: $\quad$ Ok, cool. But now let’s get back to my question: in how many ways can I arrange books in a bookshelf? Assuming that I had $3$ books. Here are my thoughts on that: let’s say book $\bigstar$, book $\heartsuit$, and book $\clubsuit$. Then the possibilities to arrange them would be:
\[1. \quad \bigstar \quad \heartsuit \quad \clubsuit \] \[2. \quad \bigstar \quad \clubsuit \quad \heartsuit \] \[3. \quad \heartsuit \quad \bigstar \quad \clubsuit \] \[4. \quad \heartsuit \quad \clubsuit \quad \bigstar \] \[5. \quad \clubsuit \quad \heartsuit \quad \bigstar \] \[6. \quad \clubsuit \quad \bigstar \quad \heartsuit \]
Certex: $\quad$ Yes, exactly. So, in how many ways can one arrange $3$ books in a bookshelf?
Intex: $\quad$ In $6$ ways!
Certex: $\quad$ Did you understand why it’s $6$, and not more or less than $6$? $\;3$ choices for the first, multiplied by $2$ choices for the second, multiplied with $1$ choice for the last. That is $3 \times 2 \times 1 = 6$ ways.
Intex: $\quad$ Wait! Why should one multiply the possible choices for each book? Why not add them up? Look, in our example with $3$ books, one gets $3 + 2 + 1 = 6$ ways one can arrange three books! Huh! Maybe you are not right with your assumption of wanting to multiply! Sometimes it feels like your theories come out of the blue, and nobody really understands them!
Certex: $\quad$ Oh, I see that you don’t believe me! That’s a good attitude in mathematics! Never believe - even if deep in your heart you know that I am always right! Let’s analyze this again! If your assumption of adding was right, then how about the possibilities to arrange $2$ books? Suppose you have $2$ books: $\clubsuit$ and $\bigstar$. How can you arrange them on a shelf? Put $\clubsuit$ first, then $\bigstar$, and you get $\clubsuit\bigstar$. Or, put $\bigstar$ first, and then $\clubsuit$. This time you get $\bigstar\clubsuit$. So, there are 2 ways. Do you see?
Intex: $\quad$ Of course I see! But where do you want to get with that?
Certex: $\quad$ Well, you said that instead of multiplying the possible choices, you wanted to add them up. Let’s do it: $\;2$ choices for the first book, and $1$ choice for the second book. But if we add up $2 + 1$, we don’t get $2$ possible arrangements, but rather $3$, because $2 + 1 = 3$. But you discovered that with $3$ books, there are $6$ possible arrangements, right?
Intex: $\quad$ Yep, I see how my intuition led me towards the wrong path! But even so, I still do not understand why we should multiply!
Certex: $\quad$ Ok, let’s try to arrange $4$ books in the bookshelf! Let’s say that we have four books: $\clubsuit$, $\bigstar$, $\heartsuit$, and $\blacklozenge$. Let’s find out how many possible arrangements we get by doing so. Starting from your previous analysis, we keep the $3$ books where they were placed and add the fourth book, which we put in a box to better see what’s going on:
\[1. \quad \boxed{\blacklozenge} \quad \bigstar \quad \heartsuit \quad \clubsuit \] \[2. \quad \boxed{\blacklozenge} \quad \bigstar \quad \clubsuit \quad \heartsuit \] \[3. \quad \boxed{\blacklozenge} \quad \heartsuit \quad \bigstar \quad \clubsuit \] \[4. \quad \boxed{\blacklozenge} \quad \heartsuit \quad \clubsuit \quad \bigstar \] \[5. \quad \boxed{\blacklozenge} \quad \clubsuit \quad \heartsuit \quad \bigstar \] \[6. \quad \boxed{\blacklozenge} \quad \clubsuit \quad \bigstar \quad \heartsuit \]
This is the arrangement we get if we place the fourth book $\blacklozenge$ in the first position. But actually, there are $4$ different positions where we could place $\blacklozenge$—the first, second, third, or fourth position—and in each new position of $\blacklozenge$, we will get $6$ additional arrangements of the books. So, for each position that $\blacklozenge$ takes, the other three books can be arranged in $6$ different ways—just like before.
\[1. \quad \bigstar \quad \boxed{\blacklozenge} \quad \heartsuit \quad \clubsuit \] \[2. \quad \bigstar \quad \boxed{\blacklozenge} \quad \clubsuit \quad \heartsuit \] \[3. \quad \heartsuit \quad \boxed{\blacklozenge} \quad \clubsuit \quad \bigstar \] \[\vdots\]
Now, if we pick up what I already told you, namely that the possible arrangements with $3$ books is $3 \times 2 \times 1 = 6$, since there are $4$ possible positions for the new book, each leading to $6$ additional arrangements, we get $4 \times 6 = 24$ possible arrangements in total.
Intex: $\quad$ Okay, right, now I know why one has to multiply instead of adding up! Thank you! By the way: If we had not only $4$ books but a whole library of thousands of books, the notation you use is pretty space-consuming. Isn’t there a shorter and more elegant way to express this?
Certex: $\quad$ You’re right! Assuming that we had not only $4$ books, but $1,582$ books instead, we would not write down $1,582 \times 1,581 \times \dots \times 1$, but in the much shorter form $1,582!$, which is read ‘$1,582$ factorial. So, if $n$ is the number of books you have, you calculate the total number of possible arrangements using the formula $n!$. Do you know how many arrangements you get with $1,582$ books?
Intex: $\quad$ No, and I won’t calculate this, because my intuition tells me that my calculator will not be able to compute this…
Certex: $\quad$ Yep, you’re right, hahaha.