Permutation and Combination Calculator
Calculate nPr permutations, nCr combinations, and their repetition variants (n^r and (n+r−1)Cr), with the factorial working shown.
Tool guide
What this tool does
Permutation and Combination Calculator computes nPr (permutations, order matters, no repeats), nCr (combinations, order doesn’t matter, no repeats), and the two repetition variants: n^r for permutations where repeats are allowed, and (n+r−1)Cr for combinations where repeats are allowed. Every result shows the factorial formula behind it.
Permutations and combinations answer the same underlying question, how many ways can you select or arrange r items from a set of n, but the exact count depends on two separate choices: does order matter, and can an item be chosen more than once. Mixing up which of the four resulting formulas applies is the single most common combinatorics mistake.
This calculator covers all four cases directly: nPr for arrangements where order matters and nothing repeats, nCr for selections where order doesn’t matter and nothing repeats, n^r for arrangements where repeats are allowed, and the combinations-with-repetition formula (n+r−1)Cr for selections where repeats are allowed. Every result shows the exact factorial formula used, computed with exact integer (BigInt) arithmetic so even large n and r produce an exact, not approximated, answer.
How to use Permutation and Combination Calculator
- Choose a Calculation: permutations, combinations, permutations with repetition, or combinations with repetition.
- Enter n, the total number of items available.
- Enter r, the number of items being chosen or arranged.
- Read the resulting count and the factorial formula used to compute it.
- Switch modes to compare how the count changes depending on whether order matters and whether repeats are allowed.
Tips for better results
- If arranging contestants on a podium (order matters, no repeats), use permutations; if simply picking a committee from a group (order doesn’t matter, no repeats), use combinations.
- Permutations with repetition is the right formula for passwords or PINs where the same character can appear in multiple positions, such as a 4-digit PIN with n = 10 possible digits.
- nCr always equals nPr divided by r!, since choosing r items and then separately arranging them in every possible order recovers every permutation exactly once.
- For large n and r, the counts grow extremely fast; this calculator uses exact BigInt arithmetic rather than floating-point numbers so results stay exact rather than rounding at very large values.
Common use cases
- Working out how many ways a set of runners can finish in the top three positions (a permutation problem).
- Calculating how many different 5-card hands can be dealt from a 52-card deck (a combination problem).
- Counting how many possible 4-digit PINs exist, where digits can repeat (permutations with repetition).
- Teaching the four combinatorics cases side by side with the same n and r to see how dramatically the count changes.
Common mistakes to avoid
- Using nPr when the problem actually doesn’t care about order, which overcounts every valid selection by r! because it also counts every reordering of the same group.
- Forgetting that nPr and nCr require r ≤ n, since you cannot choose or arrange more items than exist without allowing repetition.
- Confusing the combinations-with-repetition formula with simple combinations; they produce very different counts once repeats are genuinely allowed.
Frequently asked questions
What is the difference between nPr and nCr?
nPr counts arrangements where the order of the chosen items matters, while nCr counts selections where order does not matter; nCr is always nPr divided by r!, since it collapses every reordering of a group into a single count.
When should I use the repetition variants?
Use permutations with repetition (n^r) when the same item can be chosen more than once and order matters, such as a PIN code; use combinations with repetition when the same item can be chosen more than once and order does not matter, such as scoops of ice cream from a set of flavours where repeats are allowed.
Why does r have to be at most n for the no-repetition modes?
Without allowing repeats, you cannot select or arrange more items than actually exist in the set of n; the repetition variants remove that restriction because the same item can be reused.
Are the results exact for large numbers?
Yes, factorials and the final results are computed using exact BigInt integer arithmetic rather than floating-point numbers, so there is no rounding error even for very large n and r.
Feedback & suggestions
Help us improve Permutation and Combination Calculator. We read every message.