Permutations and combinations are fundamental counting techniques in probability and statistics that determine the number of ways to select and arrange items from a set. The key distinction is order: permutations count arrangements where order matters (ABC ≠ BCA), while combinations count selections where order does not matter (ABC = BCA). The formulas — P(n,r) = n!/(n-r)! for permutations and C(n,r) = n!/[r!(n-r)!] for combinations — answer questions from lottery odds and password security to team selection and experimental design. From a group of 10 people, there are P(10,3) = 720 ways to assign president, VP, and secretary (order matters), but only C(10,3) = 120 ways to select a 3-person committee (order doesn't matter). Our permutation and combination calculator computes both values for any n and r, handles large factorials precisely, shows step-by-step solutions, and supports repetition variants for scenarios where items can be reused.
When to use permutations vs combinations
Use permutations when the order or arrangement of selected items matters: assigning ranked positions (1st, 2nd, 3rd place), arranging books on a shelf, creating passwords or PIN codes, seating arrangements, and phone numbers. Use combinations when you are simply choosing a subset and order is irrelevant: selecting team members, choosing lottery numbers, picking menu items, and forming committees. A helpful test: if swapping two selected items creates a different outcome, use permutations; if the swap doesn't matter, use combinations. Lottery numbers illustrate this perfectly — the Mega Millions drawing selects 5 numbers from 70 plus 1 from 25: C(70,5) × 25 = 302,575,350 possible tickets. If order mattered, there would be P(70,5) × 25 = 36,309,042,000 possibilities — 120 times more.
Formulas and calculation techniques
Basic permutations: P(n,r) = n!/(n-r)!. P(10,3) = 10!/7! = 10×9×8 = 720. Basic combinations: C(n,r) = n!/[r!(n-r)!]. C(10,3) = 10!/(3!×7!) = 720/6 = 120. With repetition allowed: permutations = n^r (e.g., a 4-digit PIN from digits 0-9 has 10⁴ = 10,000 possibilities). Combinations with repetition: C(n+r-1, r) — choosing 3 scoops from 5 ice cream flavors with repeats allowed gives C(7,3) = 35. For large values, use the multiplicative formula to avoid computing huge factorials: C(52,5) = (52×51×50×49×48)/(5×4×3×2×1) = 2,598,960 — the number of possible 5-card poker hands.
Real-world applications and probability
Password security: an 8-character password using uppercase, lowercase, digits, and 10 symbols (72 characters) has 72⁸ = 722 trillion permutations with repetition — taking a brute-force attack approximately 22,800 years at 1 billion attempts per second. Adding just 2 more characters (10-character password) increases this to 3.7 quadrillion — 5,140 times harder to crack. In genetics, the number of ways to choose 23 chromosome pairs from a parent's 46 chromosomes is C(46,23) ≈ 8.2 billion, explaining genetic diversity. In quality control, selecting 5 items from a batch of 100 for testing involves C(100,5) = 75,287,520 possible samples. In tournament brackets, the number of possible NCAA March Madness brackets is 2⁶³ ≈ 9.2 quintillion — which is why no one has ever correctly predicted a perfect bracket.