How to use the calculator
Enter the total number of items n and the number you choose r. You get four counts:
- Combinations C(n, r): unordered selections without repetition, such as lottery numbers or a committee.
- Permutations P(n, r): ordered arrangements without repetition, such as first, second and third place.
- Permutations with repetition nʳ: ordered sequences where items can repeat, such as PIN codes.
- Combinations with repetition: unordered selections where items can repeat, such as buying several donuts from a few varieties.
Results with more than 30 digits are shown in scientific notation, with the full number in a table below.
The formulas
| Count | Formula |
|---|---|
| Permutations | P(n, r) = n! ÷ (n − r)! |
| Combinations | C(n, r) = n! ÷ (r! × (n − r)!) |
| Permutations with repetition | nʳ |
| Combinations with repetition | C(n + r − 1, r) |
Here n! (n factorial) is n × (n − 1) × … × 1, and 0! = 1. The two main results are linked: P(n, r) = C(n, r) × r!, because each unordered group of r items can be put in order in r! ways.
The calculator uses exact integer arithmetic. It never forms the huge factorials directly. It multiplies only the r factors it needs, and builds C(n, r) step by step so that every intermediate value is itself a whole number.
Worked example
With the defaults, n = 10 and r = 3:
- Permutations: P(10, 3) = 10 × 9 × 8 = 720. That is the number of ways to award gold, silver and bronze among 10 runners.
- Combinations: C(10, 3) = 720 ÷ 3! = 720 ÷ 6 = 120. That is the number of ways to pick 3 runners for a team, ignoring order.
- With repetition, ordered: 10³ = 1,000, like 3-digit codes from 000 to 999.
- With repetition, unordered: C(10 + 3 − 1, 3) = C(12, 3) = 220.
Familiar examples
- A 6-from-49 lottery has C(49, 6) = 13,983,816 possible tickets, so one ticket has about a 1 in 14 million chance.
- A 5-card poker hand from a 52-card deck has C(52, 5) = 2,598,960 possibilities.
- A full shuffle of a deck is P(52, 52) = 52!, a 68-digit number of about 8.07 × 10⁶⁷.
To turn a count into a probability, divide the number of favorable outcomes by the total. For large powers or factorial-sized values, the exponent calculator and scientific notation calculator are useful companions.
Limitations
- n and r must be whole numbers from 0 to 1,000.
- The formulas assume all n items are distinct. Arrangements of letters with repeats, such as the letters of “BANANA”, need a different formula that divides by the factorial of each repeat count.
- Circular arrangements, such as seating around a round table, are not covered.
Frequently asked questions
What is the difference between a permutation and a combination?
In a permutation the order matters, so ABC and CBA count as different. In a combination only the group matters, so they count once. That is why there are always at least as many permutations as combinations.
What does "with repetition" mean?
It means an item can be picked more than once. A 4-digit PIN uses digits with repetition and order matters, so there are 10⁴ = 10,000 PINs. Choosing 3 scoops from 10 flavors where you may repeat a flavor is a combination with repetition, C(12, 3) = 220.
What happens if r is larger than n?
Without repetition you cannot pick more distinct items than exist, so nPr and nCr are 0. With repetition there is no such limit, so those results are still shown.
How large can the numbers be?
The calculator works with exact whole numbers for n and r up to 1,000. Long results are summarized in scientific notation, and every digit appears in an expandable table.
Last reviewed: