This permutation and combination calculator takes n items and r chosen items and returns both nPr, the number of ordered arrangements, and nCr, the number of unordered selections.
Permutation Combination Calculator
Number of permutations (order matters) or combinations (order doesn't matter) when choosing r items from n.
Starting values: the calculator opens with n = 10 and r = 3. That gives nPr = 720 and nCr = 120.
Permutation or combination?
The difference is whether order matters. A permutation counts different orders of the same items as different outcomes. A combination does not.
- Permutation: awarding 1st, 2nd and 3rd place among 10 runners. Gold, silver, bronze to A, B, C is different from C, B, A.
- Combination: choosing 3 people from 10 for a committee. A, B, C is the same committee as C, B, A.
Because each group of r items can be arranged in r! ways, the permutation count is always r! times the combination count. For the default, 120 × 3! = 120 × 6 = 720.
The formulas
nPr = n! ÷ (n − r)!
nCr = n! ÷ (r! × (n − r)!)
Where:
- n = the total number of distinct items
- r = how many you choose
- n! = n factorial, the product of all whole numbers from 1 to n
Limits of the calculator
Enter whole numbers. The value of n can go up to 170, because factorials beyond that exceed the largest number a standard calculation can hold, and r must not be larger than n. The formulas assume each item can be used once and items are distinct. They do not cover selections with repetition or items that repeat within the group.
Worked examples
Example 1: the default, n = 10 and r = 3
- nPr = 10 × 9 × 8 = 720.
- nCr = 720 ÷ 3! = 720 ÷ 6 = 120.
Example 2: three pool balls from sixteen
A maths education site uses this case. Choosing and ordering 3 balls from 16 gives 16 × 15 × 14 = 3,360 permutations. Ignoring order gives 3,360 ÷ 6 = 560 combinations. Set n = 16 and r = 3 and the calculator returns both.
Example 3: first and second place
How many ways can 1st and 2nd prizes go to 10 entrants? Order matters, so use nPr with n = 10, r = 2: 10 × 9 = 90.
Example 4: a hand of cards
How many different 5-card hands can be dealt from a 52-card deck? Order does not matter in a hand, so use nCr with n = 52 and r = 5. The answer is 2,598,960. The permutation figure, which counts the same hand in each of its 120 orders, is much larger and is not what you want here.
When repetition is allowed
This calculator does not handle repetition, but the standard results are worth knowing so you do not use the wrong tool. If you may reuse an item and order matters, the count is nr. A lock with three dials of 10 digits each has 10 × 10 × 10 = 1,000 possible codes, an example from a maths education site. If you may reuse an item and order does not matter, the count is (n + r − 1)! ÷ (r! × (n − 1)!). Choosing 3 scoops from 5 flavours with repeats allowed gives 35 combinations by that formula. For those cases, work the formula by hand.
Special cases to remember
- nCr with r = 0 or r = n equals 1: there is one way to choose nothing and one way to choose everything.
- nPr with r = n equals n!, the number of ways to arrange all the items.
- nCr equals nC(n − r). Choosing 3 from 10 to include is the same as choosing 7 to leave out.
For probability questions that use these counts, such as the chance of a specific hand, pair the result with the compound probability calculator.
Reading the pattern in the numbers
For a fixed n, the number of combinations rises and then falls as r grows. For n = 10 the values of nCr for r = 0 to 10 are 1, 10, 45, 120, 210, 252, 210, 120, 45, 10 and 1. The peak is at r = 5, the middle, and the list reads the same in both directions. That symmetry is the nCr = nC(n − r) rule at work, and it is a handy check on your own entries: the default r = 3 gives 120, the same as r = 7.
Large counts grow quickly. The number of ways to choose 6 numbers from 49, as in many lotteries, is 13,983,816. Try n = 49 and r = 6 to see it. Permutations grow even faster, which is why a modest list of items can have more orderings than you can list.
Turning a count into a probability
When every outcome is equally likely, probability is the number of favourable outcomes divided by the total. If you pick 3 people from 10 at random, each particular trio has a probability of 1 ÷ 120. Counting first and dividing second is the usual route, and this calculator supplies the counts.
Checking your setup before you calculate
Ask three questions. Are the items distinct? Can an item be picked twice? Does order change the outcome? If the answers are yes, no and no, you want nCr. If they are yes, no and yes, you want nPr. Any other combination of answers points to a formula this calculator does not use.
Frequently asked questions
What is the difference between nPr and nCr?
nPr counts arrangements where order matters, and nCr counts selections where order does not matter. nPr equals nCr multiplied by r!.
What is the largest n I can enter?
Up to 170, since the factorial of larger numbers is too big for a standard calculation. The value of r must not be larger than n.
Does the calculator allow repeated items?
No. It assumes distinct items used once. With repetition and order, the count is n to the power r. Other repetition cases need a different formula.
When do I use a combination?
Use a combination when the order of the chosen items does not matter, such as choosing a committee, a hand of cards or lottery numbers.
