hasibai

Math

Permutation and combination calculator

One question decides the formula: does the order matter? Everything else follows from that.

Ways
Enter your figures to see the breakdown.

The question that decides it

Does order matter? That single test picks the formula.

A useful check on the language: a "combination lock" is misnamed. The order of the digits absolutely matters, so it is really a permutation lock.

The four formulas

The relationship between the first two is worth internalising: nPr = nCr × r!. Every unordered group of r items can be arranged r! ways, so permutations always exceed combinations by exactly that factor. 720 = 120 × 6.

Working an example

A lottery draws 6 numbers from 49, order irrelevant. That is 49C6 = 13,983,816. One ticket therefore has about a 1 in 14 million chance.

If the same lottery required the numbers in the drawn order, it would be 49P6 = 10,068,347,520 — 720 times harder, since 6! = 720. Same draw, radically different odds, decided entirely by whether order counts.

The symmetry of combinations

nCr always equals nC(n−r). Choosing 3 people from 10 to include is the same act as choosing 7 to exclude, so both give 120. This is not a coincidence but a genuine identity, and it is also a computational shortcut: to find 100C98, compute 100C2 = 4,950 instead.

This calculator uses that shortcut internally, along with incremental big-integer arithmetic rather than computing three enormous factorials and dividing. Naive implementations overflow at surprisingly small inputs; 200C100 is a 59-digit number but the factorials involved have hundreds of digits each.

Common questions

What is the difference between a permutation and a combination?

Permutations count ordered arrangements, combinations count unordered groups. Picking gold, silver and bronze is a permutation; picking three committee members is a combination. nPr is always at least nCr.

When do I use "with repetition"?

When the same item can be picked more than once. A PIN can repeat digits, so it is a permutation with repetition. Dealing cards from a deck cannot repeat, so it is not.

Why does nCr equal nC(n-r)?

Because choosing which r items to include is the same decision as choosing which n-r items to leave out. Selecting 3 from 10 to keep and selecting 7 to discard both give 120.

Can r be larger than n?

Only with repetition. Without it, you cannot choose 5 items from 3 distinct ones, so the calculator rejects it. With repetition allowed, picking 5 scoops from 3 flavours is perfectly valid.