LonghandMath calculators

Permutation and Combination Calculator

Work out how many ways you can arrange or choose items. Enter n and r to get permutations (order matters) and combinations (order does not), with the working, and with repetition too.

n items, r chosen at a time

Permutations vs combinations

Ask one question: does the order of the chosen items matter? If it does, you want a permutation, such as the first, second and third places in a race. If it does not, you want a combination, such as choosing a committee. A second question decides the formula: can an item be used more than once?

Formulas

CaseFormula
Permutations, no repetitionnPr = n! ÷ (n − r)!
Combinations, no repetitionnCr = n! ÷ (r! × (n − r)!)
Permutations, repetition allowednʳ
Combinations, repetition allowedC(n + r − 1, r)
Link between themnPr = nCr × r!

A factorial, written n!, multiplies every whole number from n down to 1, so 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition 0! = 1.

Worked examples

Podium places: 8P3

Eight runners compete for gold, silver and bronze, and order matters. 8P3 = 8 × 7 × 6 = 336.

A committee: 10C3

Choose 3 people from 10, and order does not matter. 10C3 = (10 × 9 × 8) ÷ (3 × 2 × 1) = 120.

Lottery odds: 49C6

Choosing 6 numbers from 49 gives 13,983,816 combinations, so a single ticket has about a 1 in 14 million chance.

A PIN code: repetition allowed

Each of 4 digits can be any of 10, and order matters, so there are 10⁴ = 10,000 possible PINs.

Ice cream scoops: combinations with repetition

Choosing 2 scoops from 3 flavours, where repeats are allowed and order does not matter, gives C(3 + 2 − 1, 2) = C(4, 2) = 6.

How to decide which one to use

First, decide whether order matters. Second, decide whether items can repeat. Third, check whether you are choosing all of the items or only some. A “combination lock” is really a permutation, because the order of the digits matters. Arranging all n items is the special case nPn = n!, so 5 books on a shelf can be ordered in 120 ways.

Common mistakes

The most common mistake is using a permutation when order does not matter, which overcounts by a factor of r!. Another is forgetting that without repetition r cannot exceed n. People also add where they should multiply: independent choices multiply. For very large answers, the calculator uses exact whole-number arithmetic, so results such as 49C6 are not rounded. For powers like nʳ, the exponent and root calculator shows the working.

Frequently asked questions

What is the difference between a permutation and a combination?

A permutation counts arrangements, where order matters, so ABC and CBA are different. A combination counts selections, where order does not matter, so ABC and CBA are the same group. For the same n and r, there are always at least as many permutations as combinations.

What is the formula for nCr?

The number of combinations is nCr = n! ÷ (r! × (n − r)!). Choosing 3 people from 10 gives 10! ÷ (3! × 7!) = 120. It equals the permutation count divided by r!, which removes the different orderings of the same group.

Why does 0! equal 1?

Factorial counts the ways to arrange items, and there is exactly one way to arrange nothing. It also keeps formulas consistent: nCn = n! ÷ (n! × 0!) must equal 1, which only works if 0! = 1.

How do you calculate lottery odds?

Count the combinations, because the order of drawn numbers does not matter. Choosing 6 numbers from 49 gives 49C6 = 13,983,816, so the chance of matching all six is 1 in about 14 million.

What changes when repetition is allowed?

Each choice can reuse an item. Ordered selections become n to the power r, so a 4-digit PIN has 10⁴ = 10,000 options. Unordered selections become C(n + r − 1, r), as when choosing scoops of ice cream.

More Statistics calculators

Browse every statistics calculator.

Other calculators

Related topics on this page: nPr, nCr, factorial, arrangements, selections, repetition, lottery odds, counting principle