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.
