Permutation & Combination Calculator

Calculate permutations (nPr) and combinations (nCr) for counting problems.

Permutation nPr
—
Combination nCr
—
Permutation: nPr = n! / (n−r)!
Combination: nCr = n! / [r!(n−r)!]

Quick Examples

Permutations vs Combinations

Permutation (Order Matters)

nPr = n! / (n−r)!

Example: How many ways to arrange 3 people from a group of 10 in a line?

¹⁰P₃ = 10! / 7! = 10 × 9 × 8 = 720 ways

Combination (Order Doesn't Matter)

nCr = n! / [r!(n−r)!]

Example: How many ways to choose 3 people from a group of 10?

¹⁰C₃ = 10! / (3! × 7!) = 120 ways

What Are Permutations and Combinations?

Both count how many ways you can select items from a group — the difference is whether order matters. Permutations count arrangements: awarding gold, silver, and bronze medals to 10 runners is a permutation, because swapping two runners changes the result. Combinations count selections: choosing any 3 committee members from 10 people is a combination, because the same three people in a different order are still the same committee. This single distinction drives everything else: for the same n and r, permutations always give an equal or larger count than combinations, because each combination fans out into r! different orderings.

Related Formulas

Two extensions come up constantly. When repetition is allowed, ordered selections become nʳ — a 4-digit PIN has 10⁴ = 10,000 possibilities. Combinations with repetition (the “stars and bars” method) use C(n+r−1, r): choosing 3 scoops from 5 ice-cream flavors, repeats allowed, gives C(7, 3) = 35 possibilities.

nʳ (permutations with repetition)    C(n+r−1, r) (combinations with repetition)

A handy symmetry also saves work: nCr = nC(n−r), so choosing 3 from 10 is the same count as choosing 7. Always compute with the smaller r.

Step-by-Step Calculation

Step 1: Ask the key question — does rearranging the selected items create a genuinely different outcome? If yes, you need permutations; if no, combinations.

Step 2: Identify n (the total pool you choose from) and r (how many you pick).

Step 3: For permutations, compute n!/(n−r)! — equivalently, multiply r terms counting down from n: n × (n−1) × … × (n−r+1).

Step 4: For combinations, divide that result by r!: n!/[r!(n−r)!].

Step 5: If repetition is allowed, switch formulas: nʳ for ordered picks, C(n+r−1, r) for unordered.

Step 6: Sanity-check the answer: combinations can never exceed permutations for the same n and r, and every count must be a whole number.

Worked Examples

Example 1: Race medals (permutation)

Gold, silver, and bronze from 8 runners — order matters. ⁸P₃ = 8 × 7 × 6 = 336 possible podium finishes.

Example 2: Lottery (combination)

Choose 6 numbers from 49, order irrelevant: ⁴⁵C₆ = 49!/(6!×43!) = 13,983,816. That enormous count is exactly why jackpots are so rare.

Example 3: PIN codes

A 4-digit PIN with repetition allowed: 10⁴ = 10,000 codes. Without repetition it is ¹⁰P₄ = 10 × 9 × 8 × 7 = 5,040 — roughly half as many.

Example 4: Pizza toppings (combination)

Choose 3 toppings from 10, order irrelevant: ¹⁰C₃ = (10 × 9 × 8)/(3 × 2 × 1) = 720/6 = 120 possible pizzas.

Common Mistakes

  • Using permutations when order does not matter: the classic error. Always ask “does rearranging change anything?” before choosing a formula.
  • Forgetting r! in the denominator: n!/(n−r)! alone is the permutation count, not the combination count.
  • Treating “at least one” as a single case: these problems need several cases added together — or the complement (total minus “none”) — not one plug into the formula.
  • Swapping n and r: n is the pool you choose from, r is how many you take. r can never exceed n.

Frequently Asked Questions

What is 0! and why? 0! = 1 by definition — it is the convention that makes formulas like nCn = 1 work, since there is exactly one way to choose everything.

When are permutations and combinations equal? When r = 0 or r = 1. With a single item there is nothing to reorder, so nP₁ = nC₁ = n.

Can r be larger than n? No — you cannot choose 5 items from 3. Both formulas yield zero in that case.

Why do combinations divide by r!? Because each unordered selection of r items can be arranged in r! different orders, and permutations count every one of those orders separately. Dividing strips the ordering out.

Which Counting Method Do You Need?

Two questions decide the formula. First: does rearranging the selected items create a genuinely different outcome? Second: can the same item be picked more than once?

Order Matters?Repetition Allowed?UseFormula
YesNoPermutationn! / (n−r)!
YesYesPermutation with repetitionn^r
NoNoCombinationn! / (r!(n−r)!)
NoYesCombination with repetition(n+r−1)! / (r!(n−1)!)

Word Permutations: When Items Are Identical

The standard formulas assume all items are distinct. When some items are identical — letters in a word, for example — divide by the factorial of each repeated item's count:

n! / (a! × b! × c! × …)

Example: how many distinct arrangements of the letters in MISSISSIPPI? Counts: M=1, I=4, S=4, P=2, total n=11. Arrangements = 11! / (1! × 4! × 4! × 2!) = 39,916,800 / 1,152 = 34,650. Without the division the formula would overcount every rearrangement of the identical letters as distinct.

Counting in Spreadsheets

CalculationExcel / Google SheetsPython
Permutation without repetition=PERMUT(n, r)math.perm(n, r)
Permutation with repetition=PERMUTATIONA(n, r)n ** r
Combination without repetition=COMBIN(n, r)math.comb(n, r)
Combination with repetition=COMBINA(n, r)math.comb(n + r − 1, r)

PERMUTATIONA and COMBINA need Excel 2013 or later. For very large results, spreadsheets cap out around 10^307 and return errors, while Python's integers have no such limit.

From Counting to Probability

Counting and probability are two sides of the same coin: a probability is the count of favorable outcomes divided by the count of all equally likely outcomes. The lottery example above gives the odds of a 6-from-49 jackpot directly: 1 / 13,983,816 ≈ 7.15 × 10⁻⁸, about 1 in 14 million. A bag with 3 red balls out of 4 gives a red-ball probability of 3/4 = 75% on a single draw — three favorable combinations out of four total.

Pascal's Triangle Connection

Each row of Pascal's triangle lists the combinations C(n, 0), C(n, 1), …, C(n, n) for a fixed n — the same numbers the combination formula produces. The symmetry C(n, r) = C(n, n−r) is the triangle's mirror symmetry, and the binomial theorem, (a + b)ⁿ = Σ C(n, k) aᵏbⁿ⁻ᵏ, is why C(n, r) is also called the binomial coefficient: it is the coefficient that appears in binomial probabilities too.