Bifalgorithm post · Brisk · Chapter 1

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

What is a permutation, and how is the factorial used to count permutations? (Brisk · Chapter 1) — "When we’re counting things, we often run into permutations.…

Ideas in this flowchart

  • Permutations count the possible arrangements of distinct objects in sequence.
  • A permutation of n distinct objects is an arrangement of those objects in an ordered sequence.
  • The number of permutations is a special application of the Fundamental Theorem of Counting.
  • In the Davies children’s teeth-brushing example, each child must occupy one position in the order.
  • The successive choices are 3 for the first child, 2 for the second, and 1 for the third.
  • The total number of brushing orders is 3 × 2 × 1 = 6.
  • The repeated product n × (n − 1) × (n − 2) × · · · × 1 is written as n!, called n-factorial.
  • For the purposes described, factorial applies to integers; non-integer factorials are treated only in advanced applications.
  • By definition, 0! = 1.
  • Factorials count arrangements in word letters, card decks, and queues of network packets.
  • The letters in KRIBS have 5! = 120 different unscramblings.
  • A shuffled deck of 52 cards has 52! possible orders.
  • Ten packets arriving at a router can be queued in 10! different ways.
  • The factorial function grows extremely rapidly, even faster than exponential functions.
  • Examples include 87,178,291,200 permutations for AMBIDEXTROUSLY and an enormous number of possible deck shuffles.
Feed/

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

Channel

Brisk

1 page

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

Flowchart preview
Series cover
👍
0
0 comments0 shares

Sign in to view and post comments.