Probability Concepts

Permutations vs Combinations: What Is the Difference?

A permutation counts the ways to select and arrange items when the order matters; a combination counts the ways to select items when it does not. From 10 people, a team of 3 is a combination, with 120 possibilities. A president, vice president and secretary is a permutation, with 720 possibilities: every team of 3 can fill the three roles in 3! = 6 ways, so P(n, r) = C(n, r) × r!.

The difference in one question

Both count the ways to choose r items from a set of n. The only question that separates them is whether the order of the chosen items matters: would swapping two of them give a different outcome? If yes, count permutations. If no, count combinations.

PermutationCombination
Does the order matter?YesNo
NotationP(n, r) or nPrC(n, r), nCr or “n choose r”
Formulan! / (n − r)!n! / (r! × (n − r)!)
n = 10, r = 3720120
Typical questionWho finishes first, second and third?Which three people are on the team?
RelationC(n, r) × r!P(n, r) / r!

One group, six arrangements

Take one team of three people, A, B and C. As a combination it is a single outcome. As a permutation it is six different outcomes, because the three roles can be given out in 3! = 6 orders: ABC, ACB, BAC, BCA, CAB and CBA. The same happens for every one of the 120 possible teams of three from ten people, so the permutations are 120 × 6 = 720.

C(10, 3) = 10! / (3! × 7!) = 120

P(10, 3) = 10! / 7! = 10 × 9 × 8 = 720

P(10, 3) / C(10, 3) = 720 / 120 = 6 = 3!

The formulas

Permutations: P(n, r) = n! / (n − r)! = n × (n − 1) × … × (n − r + 1)

Combinations: C(n, r) = n! / (r! × (n − r)!) = P(n, r) / r!

Arranging all n items: P(n, n) = n!

Symmetry: C(n, r) = C(n, n − r), so C(10, 3) = C(10, 7) = 120

Choosing nothing or everything: C(n, 0) = C(n, n) = 1

The permutation formula multiplies the r choices in turn: n for the first place, n − 1 for the second, and so on. The combination formula divides that by r! to remove the different orders of the same group. The probability calculator shows this working with the factorials filled in for any n up to 1,000 and gives every digit of the result.

Worked examples

QuestionTypeCount
Gold, silver and bronze among 10 runnersPermutationP(10, 3) = 720
A team of 3 from 10 peopleCombinationC(10, 3) = 120
A president and a vice president from 25 membersPermutationP(25, 2) = 600
Handshakes among 25 people, one per pairCombinationC(25, 2) = 300
A five-card poker handCombinationC(52, 5) = 2,598,960
Five cards dealt in a particular orderPermutationP(52, 5) = 311,875,200
A 6/49 lottery ticket, numbers in any orderCombinationC(49, 6) = 13,983,816

The poker hands show the factor r! at work: 311,875,200 / 120 = 2,598,960. The lottery count is also the number of equally likely draws, so a single ticket wins the jackpot with probability 1/13,983,816 ≈ 7.1511e-8; see the lottery odds calculator for games with a bonus ball.

When items can repeat

The formulas above assume each item can be chosen once. If an item can be used again, for example a digit in a code, there are four cases, depending on whether the order matters and whether repetition is allowed.

Order matters?Repetition?CountExampleExcel
YesNon! / (n − r)!A 3-digit code from 0 to 9 with no digit twice: 720=PERMUT(10,3)
YesYesn^rA 4-digit PIN: 10^4 = 10,000=PERMUTATIONA(10,4)
NoNon! / (r! × (n − r)!)A team of 3 from 10 people: 120=COMBIN(10,3)
NoYes(n + r − 1)! / (r! × (n − 1)!)3 scoops from 5 flavors, repeats allowed: C(7, 3) = 35=COMBINA(5,3)

The probability calculator counts selections without repetition. The permutation calculator also has a mode for arrangements with repetition, n^r.

Arrangements of items that repeat

When some of the items are identical, swapping them does not make a new arrangement, so the count of n! orderings is divided by the factorial of each group of identical items. The word STATISTICS has 10 letters: S three times, T three times, I twice, and A and C once each.

Arrangements = 10! / (3! × 3! × 2!) = 3,628,800 / 72 = 50,400

From counting to probability

When all outcomes are equally likely, the probability of an event is the number of favorable outcomes divided by the number of possible outcomes, and combinations count both. The chance that five cards from a deck are all hearts is C(13, 5) / C(52, 5) = 1,287 / 2,598,960 = 33/66,640, about 0.000495. Enter 2598960 as the total outcomes and 1287 as the favorable outcomes in the probability calculator to get the same fraction, the percentage and the odds. For the chance of several events, see the probability of multiple events calculator; for the chance of k successes among n independent tries, the binomial distribution calculator.

Common mistakes

  • Counting permutations for an unordered selection. Counting 720 teams of three from ten people instead of 120 counts every team six times.
  • Treating a combination lock as a combination. The order of the digits matters, so its codes are counted with permutations: 10,000 for four dials of ten digits.
  • Choosing more items than there are. Without repetition r cannot be more than n: C(5, 9) has no meaning.
  • Forgetting that the items are different. The formulas count distinct items. If some are identical, divide by the factorials of the repeated groups as in STATISTICS.
  • Computing factorials with floating-point numbers. 170! is the largest factorial a double precision number can hold, and spreadsheets keep only about 15 digits of a large count. Exact integer arithmetic avoids both limits.

Permutations and combinations in Excel, Python and R

ToolPermutationsCombinations
Excel=PERMUT(10,3) gives 720; =PERMUTATIONA(10,4) gives 10000 with repetition=COMBIN(10,3) gives 120; =COMBINA(5,3) gives 35 with repetition
Pythonmath.perm(10, 3) gives 720; itertools.permutations lists themmath.comb(10, 3) gives 120; itertools.combinations lists them
Rprod(10:8) gives 720choose(10, 3) gives 120; combn(5, 3) lists the combinations

Try the Probability Calculator

Combinations, permutations and the probability of an event, all worked out exactly with the steps shown.

Try the Combination Calculator (nCr)

Count combinations and list them.

Try the Permutation Calculator (nPr)

Count ordered arrangements with or without repetition.

Frequently Asked Questions

What is the difference between permutations and combinations?

Both count the ways to select r items from n, but a permutation treats different orders as different outcomes and a combination does not. From 10 people, a team of 3 is a combination: C(10, 3) = 120. A president, vice president and secretary is a permutation: P(10, 3) = 720, because the same three people can fill the roles in 3! = 6 ways.

How do I know whether to use a permutation or a combination?

Ask whether swapping two of the chosen items gives a different result. If it does (ranking, assigning roles, a code, a race podium) count permutations. If it does not (a committee, a poker hand, a lottery ticket, a sample) count combinations. Words such as arrange, order, rank and schedule point to permutations; choose, select, pick and group point to combinations.

What are the permutation and combination formulas?

Permutations: P(n, r) = n! / (n − r)!, which is n × (n − 1) × … × (n − r + 1). Combinations: C(n, r) = n! / (r! × (n − r)!) = P(n, r) / r!. For n = 10 and r = 3 they give 10 × 9 × 8 = 720 and 720 / 6 = 120.

Why is the number of permutations larger than the number of combinations?

Every group of r items can be arranged in r! different orders, and a permutation counts each order separately while a combination counts the group once. So P(n, r) = C(n, r) × r!. For five cards from a deck, P(52, 5) = 311,875,200 is 120 = 5! times C(52, 5) = 2,598,960. The two are equal only when r is 0 or 1.

What is 0! and why is C(n, 0) equal to 1?

By definition 0! = 1, which makes the formulas work for empty selections: C(n, 0) = n! / (0! × n!) = 1. It also matches the meaning: there is exactly one way to choose nothing, the empty selection. In the same way C(n, n) = 1, one way to choose everything.

Is a combination lock a permutation or a combination?

A permutation, despite the name: the order of the digits matters, and a digit can repeat. A lock with four dials of ten digits each has 10^4 = 10,000 possible codes. If it opened for the same digits in any order it would be a real combination lock, and it would have far fewer codes.

How many ways can the letters of STATISTICS be arranged?

The word has 10 letters with S three times, T three times and I twice, so the arrangements that look different number 10! / (3! × 3! × 2!) = 3,628,800 / 72 = 50,400. Dividing by the factorial of each repeated letter removes the orderings that swap identical letters.

How do permutations and combinations relate to probability?

When all outcomes are equally likely, a probability is favorable outcomes divided by total outcomes, and combinations count both. The chance that five cards are all hearts is C(13, 5) / C(52, 5) = 1,287 / 2,598,960 = 33/66,640, about 0.000495. Use permutations instead when the order of the outcomes is part of what is being counted.