How to use the Combinations & Permutations
- Enter n, the total number of items available.
- Enter r, the number being chosen or arranged.
- Decide whether order matters — if yes use nPr, if no use nCr.
- State whether repetition is allowed and read the matching result.
How the calculation works
nPr = n! ÷ (n − r)! counts ordered arrangements. nCr = n! ÷ (r!(n − r)!) divides that by the r! ways of ordering each selection, because those orderings are the same combination. So nCr is always ≤ nPr, and the ratio between them is exactly r!.
Repetition changes the formulas entirely. With repetition allowed and order mattering — PIN codes, for instance — the count is nʳ. With repetition allowed and order irrelevant, the count is C(n + r − 1, r), the 'stars and bars' result used for distributing identical items into distinct groups. Deciding whether order matters and whether repetition is allowed, in that sequence, resolves nearly every counting problem.
nPr = n!/(n−r)! ; nCr = n!/(r!(n−r)!) ; with repetition: nʳ or C(n+r−1, r)Source: Standard combinatorics definitions of permutations, combinations and multiset selection.
Worked example
From 12 candidates, pick a committee of 4, then instead pick a chair, vice-chair, secretary and treasurer.
- Committee (order irrelevant): 12C4 = 12!/(4!·8!) = 495.
- Officers (order matters): 12P4 = 12·11·10·9 = 11,880.
- Ratio = 11,880 / 495 = 24.
- 24 = 4!, the number of ways to assign roles within any chosen four.
495 committees but 11,880 officer slates — exactly 4! times more, because roles are distinguishable.
Frequently asked questions
How do I tell which one to use?+
Ask whether swapping two chosen items produces a different outcome. If yes, order matters and you need permutations.
Why is nCr smaller than nPr?+
Because it treats all r! orderings of the same selection as one outcome.
What is 0! and why is it 1?+
There is exactly one way to arrange nothing, and defining 0! = 1 keeps the formulas consistent.
How do lottery odds work?+
They are one over nCr — order does not matter on a lottery ticket, so 6 from 49 gives 1 in 13,983,816.
Last reviewed August 31, 2026. We review this page whenever the underlying formula, tax year, published rate or standard changes.