In the previous section, we were counting things that essentially occurred once. For example, we picked one outfit (one shirt, one pair of pants, one hat). In this section weβll add complexity. Instead of picking an outfit for a day, how many different ways can our bag be packed for a weekend trip? Weβll answer it at the end of the section.
Intuitively, the permutation of the five books is just the multiplication principle. There are five choices for the first, four for the second, ... until thereβs only one choice. We found it was \(5\cdot 4 \cdot 3 \cdot 2 \cdot 1 = 5!\text{.}\)
This is still just the multiplication principle. There are five choices for the first, four for the second, but this time three choices for the third is our last book we take. Here we found it was \(5 \cdot 4 \cdot 3\text{.}\) But this suggests a pattern that is established in the following theorem and its useful corollary.
If \(n\) is a positive integer and \(r\) is an integer such that \(1 \le r \le n\text{,}\) then there are \(P(n,r) = n\cdot (n-1) \cdot (n-2) \cdot \dots \cdot (n-(r-1))\)\(r\)-permutations of a set of \(n\) elements.
How many functions \(f: \{1,2,3,4\} \to \{1,2,3,4,5,6\}\) are injective? [Recall a function is injective \(\forall a, \forall b ( f(a) = f(b)) \to ( a = b )\)]
Permutations count those situations in which order matters, such as arranging books on a shelf. If the order of items doesnβt matter, we need to account for it as a combination.
One way we can think about solving this previous example is that we solved the permutation question, but then we divided out the possible orderings. We started with \(P(n,r)\text{,}\) and divide by \(r!\text{,}\) the number of ways to arrange the \(r\) objects. This gives us a very convenient formula:
Two of your ten friends, Tim and Tammy just broke up. They canβt stand to be in a room together. How many ways are there to choose five out of ten friends to invite to dinner, ensuring that Tim and Tammy are not both invited?
Coming back to our packing for the weekend scenario from the introduction, letβs say, like in ExampleΒ 5.1.3, that our closet has five ironic t-shirts, three pairs of pants, and three collegiate hats. We want to pack for our weekend trip, picking out three shirts, two pants, and two hats for our suitcase. How many ways can we do this?
Just like when I pack, Iβll take one topic at a time:
Picking shirts -- there are \(3\) shirts Iβm picking from 5, so \(\binom{5}{3}\) Although the shirts are all different, the order I put them into the suitcase doesnβt matter, so itβs a combination.
A combination lock consists of a dial with 40 numbers on it. To open the lock, you turn the dial to the right until you reach a first number, then to the left until you get to second number, then to the right again to the third number. The numbers must be distinct. How many different combinations are possible?
Despite its name, we are not looking for a combination here. The order in which the three numbers appears matters. There are \(P(40,3) = 40\cdot 39 \cdot 38\) different possibilities for the βcombinationβ. This is assuming you cannot repeat any of the numbers (if you could, the answer would be \(40^3\)).
An anagram of a word is just a rearrangement of its letters. How many different anagrams of βuncopyrightableβ are there? (This happens to be the longest common English word without any repeated letters.)
After the first letter (a), we must rearrange the remaining 7 letters. There are only two letters (s and e), so this is really just a bit-string question (think of s as 1 and e as 0). Thus there \({7 \choose 2} = 21\) anagrams starting with βaβ.
\({20 \choose 4}{16 \choose 4}{12 \choose 4}{8 \choose 4}{4 \choose 4}\) ways. Pick 4 out of 20 people to be in the first foursome, then 4 of the remaining 16 for the second foursome, and so on (use the multiplicative principle to combine).
\(5!{15 \choose 3}{12 \choose 3}{9 \choose 3}{6 \choose 3}{3 \choose 3}\) ways. First determine the tee time of the 5 board members, then select 3 of the 15 non board members to golf with the first board member, then 3 of the remaining 12 to golf with the second, and so on.