MathPermutation and Combination Calculator

Permutation and Combination Calculator

Use our permutation and combination calculator to find nPr and nCr from n and r. Order matters for permutations; combinations ignore order.

Input Values
Enter your values for permutation and combination calculations
The total number of objects to choose from (0-170)
The number of objects to select (must be ≤ n)
Calculation Results

Ready to Calculate

Enter values for n and r to see permutation and combination results

Tucked inside a branch of mathematics called combinatorics, the study of finite, discrete structures, sit two ideas people mix up constantly: permutations and combinations. After years of tutoring this exact topic, I've found the fastest way to make it click is a real lock. A typical combination lock should honestly be called a permutation lock by mathematical standards, since the order of the numbers entered is important; punch in 1-2-9 and you're in, but 2-9-1 leaves you locked out. For an actual combination, any order of those three numbers would suffice. That single distinction, order versus no order, is the whole game.

This permutation and combination calculator is built as a mathematical tool that automates the process of figuring out the number of permutations and combinations possible in any given scenario. Rather than leaning on manual calculations or documentation, you're inputting the total number of elements in a set of objects or data set, then the number of elements you wish to select or arrange, and the result appears instantly. The two advantages are hard to overstate: it lets you compute across larger data sets that would otherwise be prone to errors, and it saves the time normally lost to tedious arithmetic. Most versions run on the basic principles of factorials, while some advanced ones fold in repetitions and restrictions to cover wider statistical scenarios. There are several types of permutations and combinations, but this one considers only the case without replacement, also called without repetition, so it won't compute a lock reading 3-3-3 with repeated values. From students to statisticians and mathematicians, anyone needing speedy, accurate calculation lands in the right place.

Permutation (order matters)

ABC is different from ACB. Think passwords and race podiums.

Combination (order ignored)

ABC equals ACB. Think lottery picks and team rosters.

What Are Permutations And Combinations?

Given the sample size, a permutation is the number of ways a certain number of objects can be arranged in sequential order, while a combination is the number of ways a certain number of items can be grouped together. Both feed straight into probabilities. Ever wondered about your chances of winning a lottery? You need the correct numbers in the right sequence, which is pure permutation thinking; a similar concept stretches to combinations too.

This calculator handles one of the most typical concepts of permutations: arrangements of a fixed number of elements r taken from a given set n. You'll see it written as r-permutations of n or partial permutations, denoted nPr, P(n,r), among others. Working without replacement, every way the elements can be listed in a particular order counts, but the number of choices reduces each time an element is chosen, unlike a combination lock where a value can occur multiple times like 3-3-3. Picture picking a team captain and goalkeeper from a soccer team of 11 members, labeled A through K. They cannot be the same person, so once A is chosen, A is removed from the set. If every position mattered, the total possibilities would be 11 Ɨ 10 Ɨ 9 Ɨ 8 Ɨ 7 Ɨ ... Ɨ 2 Ɨ 1, or 11 factorial, written 11!. But only the first two choices matter here, 11 Ɨ 10 = 110, so the equation removes the rest, 9 Ɨ 8 Ɨ 7 Ɨ ... Ɨ 2 Ɨ 1, or 9!. That gives the generalized equation below. For the curious, permutations with replacement follow nPr = nr instead.

Permutation formula
nPr = n! / (n āˆ’ r)!

Strip away the lock and think of a race: out of three students A, B, and C, how many ways can they come 1st, 2nd, 3rd? Because the order is crucial, ABC is different from ACB. Here n is the total number of elements, r is the number of elements to arrange, and "!" is the factorial, the product of all positive integers up to that number. The calculated value is the unique ways you can arrange r objects from a set of n objects.

Combinations

Combinations are really permutations with all the redundancies removed, since order is not important. They're denoted nCr, C(n,r), or most commonly the binomial coefficient written as (n over r), and again the case here is without replacement, not with replacement. Back to the soccer team: find the number of ways to choose 2 strikers from a team of 11. Unlike picking the captain first then the goalkeeper, the order does not matter because both end up strikers, so whether it's A and then B, or B and then A, only that they're chosen counts. The arrangements for all n people is n!, exactly as in the permutations section. To get the combinations, you remove the redundancies from the total number of permutations (the 110 from earlier) by dividing out 2!, since order no longer matters and A then B equals B then A, that's 2 ways, or 2!. So the permutation equation gets reduced by its redundancies, yielding the formula below. Naturally there are fewer choices for a combination than a permutation. For the curious, combinations with replacement run nCr = (r + n āˆ’ 1)! / (r! Ɨ (n āˆ’ 1)!).

Combination formula
nCr = n! / (r! Ɨ (n āˆ’ r)!)

Selection of items where the order doesn't matter shows up everywhere, like forming a team of three out of students A, B, and C, where ABC is the same as ACB because order doesn't influence who is part of the team. That's the different formula at work, nCr = n! / [(r!) * (n āˆ’ r)!], where n and r mean the same as before, returning the total number of ways to choose r objects from a set of n objects without considering order.

How To Calculate Permutations And Combinations

Permutation example

  1. Determine the total number of objects you possess, here n is 6.
  2. Determine the sample size, the size of the permutations you wish to compute, r is 3.
  3. Apply the permutation formula nPr = n! / (nāˆ’r)!.
nPr = 6! / (6 āˆ’ 3)! = 120

Combination example

  1. Determine the total number of objects, here n is 7.
  2. Determine the sample size, the size of the combinations you want, r is 4.
  3. Apply the combination formula nCr = n! / (r!(nāˆ’r)!).
nCr = 7! / 4! * (7 āˆ’ 4)! = 35

A couple of worked examples make the calculation concrete, and the steps stay the same no matter how large the numbers get. If the formula still feels confusing, just use our calculator, it even surfaces the permutation and combinations examples for you.

What Is The Difference Between Permutation And Combination?

With the definitions settled, the contrast between permutations and combinations comes down to two main differences. First, because permutation calculates the number of possible ways to arrange a certain number of items, different sequences of the same items are considered different, so ABC and BCA are two different permutations, whereas for combination they're considered the same. Second, the two solve different probability problems: permutation deals with sequential problems like the lottery, while combinations solve problems that ignore sequence.

AspectPermutationCombination
OrderMatters (ABC ≠ BCA)Ignored (ABC = BCA)
Formulan! / (nāˆ’r)!n! / (r!(nāˆ’r)!)
Typical usePasswords, podiums, lottery sequenceTeams, committees, lottery picks
Result sizeUsually largerUsually smaller

Power Users: Rules That Reduce The List

For anyone pushing past the basics, you can add Rules that reduce the List. The "has" rule says certain items must be included for an entry to be included, so has 2,a,b,c means an entry must hold at least two of the letters a, b and c. The "no" rule means some items must not occur together, so no 2,a,b,c means an entry must not have two or more of a, b and c. The "pattern" rule lets you impose a pattern on each entry, so pattern c,* means the letter c must be first and anything else can follow. Drop each rule on its own line. As a quick demo, a,b,c,d,e,f,g has 2,a,b returns the combinations that carry at least 2 of a, b or c.

The "has" Rule

The format is the word "has", a space, a number, then a comma and a list of items separated by commas. The number sets how many (minimum) from the list are needed for a result to be allowed. Take has 1,a,b,c: it will allow an a, or b, or c, or a and b, or a and c, or b and c, or all three a, b and c, simply insisting there be an a or b or c in the result, so {a,e,f} is accepted but {d,e,f} is rejected. Tighten it to has 2,a,b,c and it allows a and b, a and c, b and c, or all three, demanding at least 2 of a or b or c, so {a,b,f} is accepted while {a,e,f} is rejected.

The "no" Rule

Same shape, the word "no", a space, a number, a comma, then a list of items separated by commas, but now the number sets how many (minimum) from the list trigger a rejection. With n=5, r=3, Order=no, Replace=no, the run normally produces ten sets. Add a "no" rule as a,b,c,d,e,f,g no 2,a,b and the entries that hold 2 from the list a,b disappear (having an a or b is fine, just not together). Switch to no 2,a,b,c and only {a,d,e} {b,d,e} {c,d,e} survive, rejecting any pairing of a and b, a and c, or b and c, or all three, so {a,d,e} is allowed with only one of a,b,c present, but {b,c,d} is rejected for holding 2 from the list. Loosen it to no 3,a,b,c and nearly everything passes, with only {a,b,c} missing, the lone entry holding 3 from the list.

The "pattern" Rule

Here you write the word "pattern", a space, then a list of items separated by commas, and you can fold in special items: the ? (question mark) means any item, a wildcard, while the * (asterisk) means any number of items (0, 1, or more), a super wildcard. So pattern ?,c,*,f reads "any item, followed by c, followed by zero or more items, then f": {a,c,d,f} is allowed, {b,c,f,g} is allowed too since no items between c and f is fine, but {c,d,e,f} is not allowed because there's no item before c. A practical case: how many ways can Alex, Betty, Carol and John be lined up, with John after Alex? Use n=4, r=4, order=yes, replace=no and pattern *,Alex,*,John, and the result is twelve arrangements.

Frequently Asked Questions

Common questions about permutations, combinations, and their formulas

What is a combination?

A combination is the number of ways it is possible to group n objects in r size, where the order of the items in the group does not matter. Choosing {A, B} is the same as choosing {B, A}.

What is a permutation?

A permutation is the number of possible ways of arranging n object in r size, where the order of the items matters. The arrangement ABC is different from ACB.

How do you calculate a combination?

You can calculate a combination in three steps: determine the total number of objects n, determine the sample size r, then apply the combination formula nCr = n! / (r!(nāˆ’r)!).

How do you calculate a permutation?

You can calculate a permutation in three steps: determine the total number of objects n, determine the sample size r, then apply the formula nPr = n! / (nāˆ’r)!.

Can a combination or permutation be negative?

No, combination and permutation cannot be negative. Even with one sample, the combination and permutation should be at least 1.

When should I use a permutation instead of a combination?

Use a permutation when order matters, such as passwords, race finishing positions, and seating arrangements. Use a combination when order does not matter, such as lottery numbers or picking team members.