Permutations vs Combinations: How to Tell Which Formula to Use

Decide whether order matters and whether items can repeat, then pick the right counting formula. Worked examples for nPr, nCr, PINs and stars and bars.

Updated September 29, 2026 7 min read

Use the free Permutation & Combination CalculatorExact nPr and nCr, with or without repetition, and list every arrangement

"How many ways can we…?" sounds like a simple question until you try to answer it. How many three-person project teams can you form from eight staff? How many ways can you fill the roles of chair, deputy and secretary from the same eight? The numbers are 56 and 336, and the only difference is whether the order of selection means anything.

This guide gives you a two-question test that tells you which of the four counting formulas to use, explains why each formula works, and walks through examples you can check. It finishes with the mistakes that most often lead to answers that are off by a factor of 2, 6 or more.

The two questions that decide everything

Every basic counting problem comes down to two yes/no questions:

  1. Does order matter? If swapping two chosen items gives a different outcome (a different role, a different PIN, a different finishing place), it is a permutation. If you only care about which items end up in the group, it is a combination.
  2. Can items repeat? Can the same item be chosen more than once (a digit in a PIN, a flavour in a bowl of ice cream) or is each item used at most once (a person on a committee)?

That gives four cases, with n items to choose from and r chosen:

No repetition Repetition allowed
Order matters P(n, r) = n! ÷ (n − r)! nʳ
Order doesn't matter C(n, r) = n! ÷ (r! (n − r)!) C(n + r − 1, r)

The exclamation mark means factorial: 5! = 5 × 4 × 3 × 2 × 1 = 120, and by convention 0! = 1.

Permutations without repetition (nPr)

Choose a chair, deputy and secretary from 8 people. The chair can be any of 8, the deputy any of the remaining 7, the secretary any of the remaining 6:

P(8, 3) = 8 × 7 × 6 = 336

The factorial formula says the same thing: 8! ÷ 5! cancels everything below 6. With n = 10 and r = 3 you get 10 × 9 × 8 = 720. When r = n, you are ordering the whole set, so P(5, 5) = 5! = 120 ways to arrange five books on a shelf.

Combinations without repetition (nCr)

Now choose a three-person team from the same 8 people, with no roles. Each team of three appears 3! = 6 times in the permutation count (ABC, ACB, BAC, BCA, CAB, CBA), so you divide:

C(8, 3) = P(8, 3) ÷ 3! = 336 ÷ 6 = 56

This "count the ordered arrangements, then divide by the orders each group can appear in" idea is the whole reason the combination formula has an extra r! underneath. Other standard results:

  • C(10, 3) = 720 ÷ 6 = 120
  • Five-card hands from a 52-card deck: C(52, 5) = 2,598,960
  • A 6-from-49 lottery draw: C(49, 6) = 13,983,816

A useful symmetry: C(n, r) = C(n, n − r). Choosing 3 people to include from 10 is the same as choosing 7 to leave out, so C(10, 7) is also 120.

Permutations with repetition (nʳ)

A four-digit PIN has 10 choices for each of 4 positions, and digits may repeat:

10⁴ = 10,000

The same rule counts passwords, licence plates and binary strings: an 8-bit byte has 2⁸ = 256 possible values. With n = 10 and r = 3 there are 1,000 codes, from 000 to 999.

Combinations with repetition (stars and bars)

A customer picks 3 scoops from 5 flavours, repeats allowed, and the order in the bowl does not matter. The count is:

C(n + r − 1, r) = C(5 + 3 − 1, 3) = C(7, 3) = 35

Why? Write each order as 3 stars (the scoops) and 4 bars (dividers between the 5 flavours). For example ★★||★|| means two of flavour 1 and one of flavour 3. Every bowl corresponds to exactly one arrangement of 3 stars among 7 symbols, which is C(7, 3). This "stars and bars" method also counts ways to distribute identical items, such as 3 identical bonuses among 5 teams.

Worked comparison: the same n and r, four answers

With n = 10 and r = 3, the four formulas give very different results:

Case Answer
Permutations, no repetition 720
Combinations, no repetition 120
Permutations with repetition 1,000
Combinations with repetition 220

Seeing all four together is a good sanity check: repetition always gives at least as many outcomes, and ignoring order always gives fewer (or the same).

How to count with the calculator

The Permutation & Combination Calculator asks exactly the two questions above.

  1. Enter n — total items and r — items chosen.
  2. Set Does order matter? to No — combination or Yes — permutation.
  3. Set Can items repeat? to No repetition or Repetition allowed.
  4. Read the result. The other three cases for the same n and r are listed underneath, so you can see how much the answer depends on your choices.
  5. Optionally, type the actual items into List the items, separated by commas (for example red, green, blue, yellow). The tool sets n from your list and, when there are 500 results or fewer, lists every arrangement or group. With those four colours and r = 2 you see the 6 pairs, or the 12 ordered pairs if order matters.

Answers are exact whole numbers, even when they run to thousands of digits; very large results switch to scientific notation with the digit count shown. The steps panel shows the cancellation, for example "P(n, r) ÷ r!", so you can follow the reasoning rather than just the number.

Other ways to count

  • Spreadsheets: Excel, LibreOffice Calc and Google Sheets have PERMUT(n, r), COMBIN(n, r), COMBINA(n, r) for combinations with repetition, and FACT(n). These are convenient for a column of values, but results beyond about 15 significant digits lose precision because spreadsheets use floating-point numbers.
  • Scientific calculators usually have nPr and nCr keys. Our Scientific Calculator handles factorials for quick checks.
  • Python: math.perm(10, 3) and math.comb(10, 3) return exact integers of any size.
  • By hand: for small numbers, listing outcomes systematically is the best way to build intuition, and it is how you catch a wrong formula.

Common mistakes

Using a permutation when roles are identical

If the three people on a team have no distinct roles, ordering them overcounts by 3!. Ask: "If I swap two chosen items, is it a different outcome?"

Forgetting that "combination lock" is a misnomer

A lock code of 3-7-1 is different from 1-7-3, and digits can repeat, so the count is nʳ, a permutation with repetition.

Repeated letters in words

Arrangements of the letters in LEVEL are not 5! = 120, because swapping the two Ls or the two Es changes nothing. Divide by the repeats: 5! ÷ (2! × 2!) = 30. This "multiset permutation" needs a manual division; it is not one of the four standard cases.

Adding when you should multiply

Independent stages multiply: choosing 1 of 3 shirts and 1 of 4 ties gives 3 × 4 = 12 outfits, not 7. Add only when the choices are alternatives ("either a shirt or a tie").

From counting to probability

Counting is often the first half of a probability problem. The chance that a particular 6-number ticket wins a 6-from-49 draw is 1 ÷ 13,983,816. For more on this, see Lottery Odds Explained, and use the Probability Calculator for binomial questions, where C(n, k) counts the positions successes can take. The factorial post What Is a Factorial? covers n! itself in more depth.

Frequently asked questions

What is the easiest way to remember permutation vs combination?

Permutation means position: order matters, like a ranking or a code. Combination means committee: you only care who is in the group.

Why is nCr always smaller than or equal to nPr?

Each group of r items can be ordered in r! ways, and nPr counts every one of those orders separately. Dividing by r! merges them, so nCr = nPr ÷ r!.

What does C(n, 0) equal?

It equals 1. There is exactly one way to choose nothing, which is why 0! is defined as 1.

How many combinations does a 4-digit code have?

With digits 0 to 9 that may repeat, there are 10⁴ = 10,000 codes. If no digit may repeat, there are 10 × 9 × 8 × 7 = 5,040.

When do I use combinations with repetition?

When you pick several items from a set of types, the same type can be picked more than once, and order is irrelevant, such as choosing scoops, coins or bulk items. The formula is C(n + r − 1, r).

Try it now: Permutation & Combination Calculator

Loading tool…