Permutation and Combination Calculator
Calculate permutations P(n, r) and combinations C(n, r) with or without repetition, factorials, and combinatorics.
All formulas and computation matrices for this calculator execute directly in your browser with zero latency. Enter your parameters to see instant results.
Who Uses This Calculation & Why Accuracy Matters
Computer scientists, lottery players, poker players, cryptographers, discrete mathematicians, and event planners use this Permutation and Combination calculator to calculate the total number of subsets and arrangements of n items taken r at a time (nPr and nCr), with or without repetition.
Calculating the total combinations of choosing 5 white balls from 69 numbers, multiplied by choosing 1 red Powerball from 26 numbers.
A cybersecurity engineer calculating the total keyspace of a 4-digit numeric ATM PIN code (10 digits, r = 4, repetition allowed).
Electing a President, Vice President, and Treasurer from a committee of 12 members (n = 12, r = 3, order matters).
Permutations vs. Combinations: Decision Matrix
Classifying counting problems based on order significance and element repetition.
| Combinatorial Type | Does Order Matter? | Repetition Allowed? | Mathematical Formula | Classic Example |
|---|---|---|---|---|
| Permutation without Repetition | YES (Order Matters) | NO (Unique elements) | nPr = n! / (n - r)! | First, second, third place race podium |
| Permutation with Repetition | YES (Order Matters) | YES (Can reuse elements) | nʳ | Numeric combination padlock, ATM PIN code |
| Combination without Repetition | NO (Order Irrelevant) | NO (Unique elements) | nCr = n! / [ r! (n - r)! ] | Dealing a 5-card poker hand, lottery numbers |
| Combination with Repetition | NO (Order Irrelevant) | YES (Can reuse elements) | (n + r - 1)! / [ r! (n - 1)! ] | Picking 6 donuts from 4 different bakery varieties |
* nCr is also called the Binomial Coefficient ("n choose r") written as (ⁿ_r).
Factorial, Permutation & Binomial Combination Equations
Permutations count ordered arrangements. Combinations divide permutations by r! to eliminate duplicate orderings.
Total population set size.
Sample subset size (0 ≤ r ≤ n).
Product of all positive integers up to n.
Step-by-Step Worked Examples with Real Numbers
Worked Example 1: 5-Card Poker Hands from 52-Card Deck
Order in hand does not matter.
Product of 5 largest numbers.
Total possible 5-card hands.
Worked Example 2: Permutation Ranking (8 Runners in a Race)
Order on podium matters.
336 distinct medal outcomes.
Assumptions, Edge Cases & Common Calculation Mistakes
ℹ Underlying Algorithm Assumptions
- Inputs n and r are non-negative integers.
- For problems without repetition, subset size must satisfy 0 ≤ r ≤ n.
- 0! is statutorily defined as 1.
⚠ 3 Common Mistakes to Avoid
- Confusing permutations with combinations; a combination padlock is actually a permutation lock because order matters.
- Attempting to compute factorials of large numbers without cancellation (e.g., computing 100! / 98! by evaluating 100! directly causes memory overflow).
- Forgetting the symmetry property: ₁₀₀C₉₈ is identical to ₁₀₀C₂ = (100 × 99) / 2 = 4,950.