Concept

What is a permutation, and how is the factorial used to count permutations?

Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk / Chapter 1

"When we’re counting things, we often run into permutations. A permutation of n distinct objects is an arrangement of them in a sequence. For instance, suppose all three Davies kids need to brush their teeth, but only one of them can use the sink at a time. What order will they brush in? One possibility is Lizzy, then T.J., then Marina. Another possibility is T.J., then Lizzy, then Marina. Another is Marina, then Lizzy, then T.J. These are all different permutations of the Davies kids. Turns out there are six of them (find all 6 for yourself!) Counting the number of permutations is just a special application of the Fundamental Theorem of Counting. For the teeth brushing example, we have n = 3 different “parts” to the problem, each of which has nᵢ choices to allocate to it. There are three different Davies kids who could brush their teeth first, so n₁ = 3. Once that child is chosen, there are then two remaining children who could brush second, so n₂ = 2. Then, once we’ve selected a first-brusher and a second-brusher, there’s only one remaining choice for the third-brusher, so n₃ = 1. This means the total number of possible brushing orders is: 3 × 2 × 1 = 6.\n\nThis pattern comes up so much that mathematicians have established a special notation for it: n × (n − 1) × (n − 2) × · · · × 1 = n! (“n-factorial”). We say there are “3-factorial” different brushing orders for the Davies kids. For our purposes the notion of factorial will only apply for integers, so there’s no such thing as 23.46! or π!. (In advanced computer science applications, however, mathematicians sometimes do define factorial for non-integers.) We also define 0! to be 1, which might surprise you. This comes up a heck of a lot. If I give you a jumbled set of letters to unscramble, like “KRIBS” (think of the Jumble® word game in the newspaper), how many different unscramblings are there? The answer is 5!, or 120, one of which is BRISK. Let’s say I shuffle a deck of cards before playing War. How many different games of War are there? The answer is 52!, since any of the cards in the deck might be shuffled on top, then any but that top card could be second, then any but those two could be third, etc. Ten packets arrive near-simultaneously at a network router. How many ways can they be queued up for transmission? 10! ways, just like a larger Davies family. The factorial function grows really, really fast, by the way, even faster than exponential functions. A five letter word like “BRISK” has 120 permutations, but “AMBIDEXTROUSLY” has 87,178,291,200, ten times the population of the earth. The number of ways to shuffle a deck is 80,658,175,170,944,942,408,940,349,866,698,506,766,127,860,028,660,283,290,685,487,972,352 so I don’t think my boys will end up playing the same War game twice any time soon, nor my wife and I the same bridge hand."

Related Ideas

What is a permutation, and how is the factorial used to count permutations? | Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk | Bifalgorithm | Bifalgorithm