Permutations & Combinations Calculator
Calculate nPr and nCr with step-by-step factorial expansion. Toggle repetition on or off with real-world examples like lottery and PIN codes.
About Permutations & Combinations Calculator
Calculate permutations (nPr) and combinations (nCr) with and without repetition. Enter the total items and items chosen, and see the result with full factorial expansion and step-by-step working. Supports BigInt for exact results even with very large numbers.
Permutations vs Combinations - Which Do I Need?
The distinction comes down to two questions: does order matter, and can items repeat?
| Order Matters (Permutation) | Order Does Not Matter (Combination) | |
|---|---|---|
| No repetition | nPr = n! / (n-r)! | nCr = n! / (r!(n-r)!) |
| With repetition | n^r | (n+r-1)! / (r!(n-1)!) |
Quick rule: If rearranging the same items gives a different outcome (like a PIN code), use permutations. If the selection is the same regardless of order (like a lottery draw), use combinations.
Permutations Without Repetition (nPr)
Used when you are arranging r items from n, each item used at most once, and the order of arrangement matters.
nPr = n! / (n - r)!
Worked example: How many ways can 3 runners finish first, second, and third from a race of 10?
- n = 10, r = 3
- 10P3 = 10! / (10-3)! = 10! / 7!
- = 10 × 9 × 8 = 720
More examples:
| Scenario | n | r | nPr |
|---|---|---|---|
| Arranging 5 books on a shelf from 8 | 8 | 5 | 6,720 |
| Assigning president, VP, secretary from 12 | 12 | 3 | 1,320 |
| 4-letter codes from 26 letters (no repeats) | 26 | 4 | 358,800 |
| Seating 6 people in 6 chairs | 6 | 6 | 720 |
Combinations Without Repetition (nCr)
Used when you are selecting r items from n, each item used at most once, and the order does not matter.
nCr = n! / (r! × (n - r)!)
Worked example: How many 5-card poker hands can be dealt from a standard 52-card deck?
- n = 52, r = 5
- 52C5 = 52! / (5! × 47!)
- = (52 × 51 × 50 × 49 × 48) / (5 × 4 × 3 × 2 × 1)
- = 311,875,200 / 120 = 2,598,960
More examples:
| Scenario | n | r | nCr |
|---|---|---|---|
| Choosing 3 toppings from 10 | 10 | 3 | 120 |
| Lottery: 6 numbers from 49 | 49 | 6 | 13,983,816 |
| Selecting a committee of 4 from 15 | 15 | 4 | 1,365 |
| Choosing 2 desserts from a menu of 8 | 8 | 2 | 28 |
Permutations With Repetition
When items can be reused and order matters, the formula is simply:
n^r
Example: A 4-digit PIN using digits 0-9 (each digit can repeat):
- n = 10, r = 4
- 10^4 = 10,000 possible PINs
| Scenario | n | r | n^r |
|---|---|---|---|
| Binary strings of length 8 | 2 | 8 | 256 |
| 3-letter codes (A-Z, repeats ok) | 26 | 3 | 17,576 |
| Coin flips, 10 tosses | 2 | 10 | 1,024 |
| 6-character password (lowercase only) | 26 | 6 | 308,915,776 |
Combinations With Repetition
When items can be reused and order does not matter (also called "multiset coefficients"):
(n + r - 1)! / (r! × (n - 1)!)
Example: Choosing 3 scoops from 5 ice cream flavours (same flavour can be picked again):
- n = 5, r = 3
- (5 + 3 - 1)! / (3! × 4!) = 7! / (6 × 24) = 5,040 / 144 = 35
Pascal's Triangle and nCr
Every entry in Pascal's triangle is a combination value. Row n, position r gives nCr:
| Row (n) | Values (nC0 through nCn) |
|---|---|
| 0 | 1 |
| 1 | 1, 1 |
| 2 | 1, 2, 1 |
| 3 | 1, 3, 3, 1 |
| 4 | 1, 4, 6, 4, 1 |
| 5 | 1, 5, 10, 10, 5, 1 |
| 6 | 1, 6, 15, 20, 15, 6, 1 |
Each number is the sum of the two numbers directly above it. This gives us useful identities like nCr = (n-1)C(r-1) + (n-1)Cr.
Real-World Probability Connection
Combinations are the foundation of probability calculations. The probability of an event is often (favourable outcomes) / (total outcomes), and both counts use nCr.
Example: Probability of winning a 6/49 lottery:
- Total outcomes: 49C6 = 13,983,816
- Winning outcomes: 1
- Probability: 1/13,983,816 ≈ 0.0000000715 (about 1 in 14 million)
For more probability calculations, the probability calculator handles events, conditional probability, and Bayes' theorem. For computing individual factorial values, the factorial calculator provides exact BigInt results.
All calculations run in your browser. No data is sent to any server.
Frequently Asked Questions
What is the difference between permutations and combinations?
Permutations count arrangements where order matters (like rankings or PIN codes). Combinations count selections where order does not matter (like lottery numbers or committees).
What does repetition mean?
With repetition, items can be chosen more than once (like digits in a PIN - you can use 3 twice). Without repetition, each item can only be chosen once.
How large can n be?
The calculator supports n up to 1000 using BigInt for exact results. Factorials grow extremely fast, so results for large n can have hundreds of digits.
How do I know which formula to use?
Ask two questions: Does order matter? (Yes = permutation, No = combination). Can items repeat? (Yes = with repetition, No = without). This gives you one of four formulas.
What are some real-world examples?
Permutation: arranging books on a shelf, race finishing order. Combination: choosing lottery numbers, selecting a team from a group. Click the example buttons to try them.
Related Tools
Link to this tool
Copy this HTML to link to this tool from your website or blog.
<a href="https://toolboxkit.io/tools/permutations-combinations-calculator/" title="Permutations & Combinations Calculator - Free Online Tool">Try Permutations & Combinations Calculator on ToolboxKit.io</a>