Permutation and Combination Calculator
nPr and nCr · With repetition · Letter arrangements · Lottery odds
🔢 Enter n and r to count permutations and combinations with full steps.
What Are Permutations and Combinations?
Permutations and combinations count the ways to choose r items from a set of n. In a permutation the order matters, so A then B is different from B then A. In a combination the order does not matter, so {A, B} is one selection no matter how it was picked.
Take the four letters A, B, C, D and choose two. There are 12 ordered pairs (AB, BA, AC, CA, and so on) but only 6 unordered pairs. Each pair of two can be ordered in 2! = 2 ways, which is why 12 ÷ 2 = 6. This relation holds in general: nCr = nPr ÷ r!.
The calculator returns exact whole numbers for n and r up to 1,000, so values with hundreds of digits are still correct, not rounded.
How to Use the Permutation and Combination Calculator
- nPr / nCr: enter the total items n and the number chosen r, then choose whether order matters and whether items can repeat. The hero shows your case, the chips show the other three, and the table compares all four.
- Arrange letters: type a word such as MISSISSIPPI or a string such as AAABBC. The calculator counts the distinct orderings, removing duplicates caused by repeated characters.
- Lottery odds: enter the size of the number pool, how many numbers are drawn, the number of matches you care about, and a bonus pool size if the game has one. You get the jackpot odds and the chance of each number of matches.
Understanding the Result
The result is a count of distinct outcomes, so it is always a whole number. Its reciprocal is the chance of one particular outcome when every outcome is equally likely: with 120 possible committees, a specific committee picked at random has a 1 in 120 chance.
Comparing the four cases shows how much each rule matters. For n = 10 and r = 3, allowing repeats raises the ordered count from 720 to 1,000, and ignoring order cuts 720 to 120. Typical uses include seating plans and race finishes (permutations), teams and card hands (combinations), passwords and PINs (ordered with repeats), and orders from a menu (unordered with repeats). Values beyond 15 digits are shown in scientific notation.
Permutation and Combination Formulas
Which Formula Should You Use?
| Situation | Formula | Example |
|---|---|---|
| Order matters, no repeats | nPr | Gold, silver, bronze from 8 runners: 336 |
| Order ignored, no repeats | nCr | Committee of 4 from 12: 495 |
| Order matters, repeats | nʳ | 4 digit PIN: 10,000 |
| Order ignored, repeats | C(n + r − 1, r) | 8 doughnuts, 5 kinds: 495 |
| All n in a row | n! | Shuffle 5 books: 120 |
| Repeated letters | n! ÷ Π(nᵢ!) | MISSISSIPPI: 34,650 |
| Any subset | 2ⁿ | Toppings from 4: 16 |
How to Calculate Permutations and Combinations Manually
- Decide if order matters. Ranks, positions, passwords, and seating are ordered. Teams, hands of cards, and pizza toppings are not.
- Decide if items can repeat. A PIN can reuse digits; a race cannot give two medals to one runner.
- Permutation: multiply r descending factors starting at n. For 10P3 that is 10 × 9 × 8 = 720.
- Combination: divide the permutation by r!. For 10C3 that is 720 ÷ (3 × 2 × 1) = 120.
Cancelling first keeps the numbers small. 52C5, the number of five card poker hands, is (52 × 51 × 50 × 49 × 48) ÷ 120 = 311,875,200 ÷ 120 = 2,598,960. Using the symmetry nCr = nC(n − r) also helps: 100C98 equals 100C2 = 100 × 99 ÷ 2 = 4,950.
Combinations With Repetition
When you can pick the same item more than once and only the final selection counts, use the stars and bars method. Write a star for each item chosen and a bar between item types. Choosing r items from n types needs r stars and n − 1 bars, so the count is the number of ways to place the bars among n + r − 1 positions: C(n + r − 1, r).
Ordering 8 doughnuts from 5 varieties gives C(12, 8) = 495 possible orders. If order matters as well, as with a code where each position can be any of n symbols, the count is nʳ.
Permutations With Repeated Letters
A word with repeated letters has fewer distinct arrangements than n!, because swapping identical letters changes nothing. Divide n! by the factorial of each letter count.
MISSISSIPPI has 11 letters with I × 4, S × 4, P × 2, and M × 1: 11! ÷ (4! × 4! × 2! × 1!) = 39,916,800 ÷ 1,152 = 34,650. BANANA gives 6! ÷ (3! × 2! × 1!) = 720 ÷ 12 = 60.
Lottery and Card Odds With Combinations
Lottery tickets are combinations because the order of the drawn numbers does not matter. A game drawing 6 of 49 numbers has C(49, 6) = 13,983,816 possible tickets. If a separate bonus ball is drawn from its own pool, multiply by that pool size: drawing 5 of 69 plus 1 of 26 gives 11,238,513 × 26 = 292,201,338 combinations.
To match exactly j numbers, choose j of the k winning numbers and the rest from the N − k losing ones. For 3 matches in a 6 of 49 game, the ways are C(6, 3) × C(43, 3) = 20 × 12,341 = 246,820, so the probability is 246,820 ÷ 13,983,816 = 0.01765, about 1 in 56.7. The same method gives the chance of being dealt a specific type of card hand.
Factorial and Combination Reference Table
| n | n! | nC2 | nC3 | 2ⁿ subsets |
|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 1 |
| 3 | 6 | 3 | 1 | 8 |
| 4 | 24 | 6 | 4 | 16 |
| 5 | 120 | 10 | 10 | 32 |
| 6 | 720 | 15 | 20 | 64 |
| 7 | 5,040 | 21 | 35 | 128 |
| 8 | 40,320 | 28 | 56 | 256 |
| 9 | 362,880 | 36 | 84 | 512 |
| 10 | 3,628,800 | 45 | 120 | 1,024 |
| 12 | 479,001,600 | 66 | 220 | 4,096 |
Common Mistakes
- Using a permutation for a group. Picking 3 friends for a trip is 10C3 = 120, not 720. Ask whether swapping two chosen items gives a new outcome.
- Calling a lock a combination lock. A lock code depends on order and allows repeats, so a 3 dial lock with digits 0 to 9 has 10³ = 1,000 codes.
- Forgetting repeated letters. BOOK has 4! ÷ 2! = 12 arrangements, not 24.
- Choosing r larger than n without repetition. You cannot pick 5 different items from 4, so the count is 0.
- Computing huge factorials on a basic calculator. 70! already exceeds 10¹⁰⁰. Cancel terms first or use exact arithmetic, as this calculator does.
Frequently Asked Questions
Sources & References
- NIST. Digital Library of Mathematical Functions, §26.3 Binomial Coefficients dlmf.nist.gov
- NIST. Digital Library of Mathematical Functions, §26.4 Multinomial Coefficients dlmf.nist.gov
- OpenStax. College Algebra 2e, 9.5 Counting Principles openstax.org
- Joy Morris, University of Lethbridge. Combinatorics, 5.1 Unlimited Repetition opentext.uleth.ca
Results are for educational use. Odds assume a fair, random draw. Methodology reviewed: 2026.