Calculate the number of ordered permutations (nPr) when choosing r items from a set of n.
A permutation is an ordered arrangement of items. Unlike combinations, the sequence matters: the arrangement A-B-C is different from B-A-C, which is different from C-A-B. P(n,r) = n! / (n-r)! counts all possible ordered arrangements when choosing r items from n, where every different ordering is counted as a distinct permutation.
Real-world permutation questions: how many ways can 3 runners finish first, second, and third in a race of 10? How many unique 4-digit PINs can be formed from the digits 1-9 without repetition? How many ways can a playlist of 8 songs be ordered from a library of 50? Each of these involves ordered selection where different orders represent genuinely different outcomes.
A full permutation arranges all n items (r = n): P(n,n) = n!. The number of ways to arrange 5 books on a shelf is 5! = 120. A partial permutation selects and arranges r items from n: P(n,r) = n! / (n-r)!. The number of ways to award gold, silver, and bronze from 10 athletes is P(10,3) = 10! / 7! = 10 × 9 × 8 = 720.
Notice that partial permutations can be computed without fully calculating the factorials: P(10,3) = 10 × 9 × 8 (just the first 3 terms of 10!). This shortcut is worth remembering for manual calculation and helps build intuition: you have 10 choices for first, then 9 remaining for second, then 8 for third.
The formula P(n,r) = n!/(n-r)! assumes no item can be chosen twice (sampling without replacement). If repetition is allowed (sampling with replacement), the count is simply n^r. A 4-digit PIN from 10 digits (0-9) with repetition allowed: 10^4 = 10,000 possible PINs. A 4-digit PIN from 10 digits without repetition: P(10,4) = 10×9×8×7 = 5,040.
License plates often illustrate this: a plate with 3 letters followed by 4 digits (repetition allowed) has 26^3 × 10^4 = 175,760,000 possible combinations — enough to serve a moderately sized state. Without repetition, the count would be P(26,3) × P(10,4) = 15,600 × 5,040 = 78,624,000 — still large but noticeably smaller.
Generating all permutations of a set is a fundamental algorithm in computer science, used in brute-force problem solving, combinatorial optimization, and cryptography. Algorithms like Heap's algorithm generate all n! permutations with O(n!) time complexity — which becomes prohibitively slow for large n (20! ≈ 2.4 × 10^18). For n ≥ 20, smarter approaches like dynamic programming and heuristic optimization are necessary. Understanding permutation counting helps set realistic expectations for algorithm performance.