Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Permutation and Combination Calculator

Count arrangements and selections with nPr, nCr, permutations with repetition and combinations with repetition, using exact arithmetic and clear factorial steps.

Examples

About the Permutation and Combination Calculator

Many counting questions come down to one decision: does the order of the chosen items matter? Arranging runners on a podium is a permutation, because gold-silver-bronze differs from bronze-silver-gold. Choosing three people for a committee is a combination, because the same three people form the same committee in any order.

This calculator covers the four standard cases: permutations and combinations without repetition, permutations with repetition (like PIN codes) and combinations with repetition (like choosing scoops of ice cream from a set of flavours). It works with exact whole numbers, so even very large counts such as the number of poker hands are shown in full rather than rounded.

What are permutations and combinations?

A permutation is an ordered arrangement of rr items chosen from nn distinct items. The count is P(n,r)=n!(n−r)!P(n, r) = \frac{n!}{(n-r)!}, the product of the first rr factors of n!n!. A combination is an unordered selection, counted by C(n,r)=(nr)=n!r! (n−r)!C(n, r) = \binom{n}{r} = \frac{n!}{r!\,(n-r)!}.

The two are linked: every combination of rr items can be ordered in r!r! ways, so P(n,r)=C(n,r)×r!P(n, r) = C(n, r) \times r!. The calculator uses this identity as a check on every nPr and nCr answer.

How to use the Permutation and Combination Calculator

  1. Choose what to count: combinations, permutations, permutations with repetition or combinations with repetition.
  2. Enter the total number of items n.
  3. Enter the number of items chosen r.
  4. Press Calculate.
  5. Read the count, the formula used and the cancellation steps.

Formulas

Permutations

P(n,r)=n!(n−r)!P(n, r) = \frac{n!}{(n-r)!}

Combinations

C(n,r)=n!r! (n−r)!C(n, r) = \frac{n!}{r!\,(n-r)!}

Permutations with repetition

nrn^r

Combinations with repetition

(n+r−1r)\binom{n + r - 1}{r}

Worked example: C(10, 3)

The example finds C(10,3)C(10, 3), the number of ways to choose 3 items from 10 when order does not matter. First count ordered choices: P(10,3)=10×9×8=720P(10, 3) = 10 \times 9 \times 8 = 720.

Each group of three appears 3!=63! = 6 times in that list, once for every ordering, so C(10,3)=7206=120C(10, 3) = \frac{720}{6} = 120. The check confirms 120×6=720120 \times 6 = 720.

The solution below is generated by the same engine that powers the calculator above.

Final answer

120120

How we read your problem

Combinations nCr (order does not matter)

Step-by-step solution

  1. Use the combination formula

    C(10,3)=10!3! 7!C(10, 3) = \frac{10!}{3!\,7!}
  2. Divide the permutations by r! because order does not matter

    P(10,3)3!=7206=120\frac{P(10, 3)}{3!} = \frac{720}{6} = 120

Formulas used

  • Combinations nCr (order does not matter)

    C(n,r)=(nr)=n!r! (n−r)!C(n, r) = \binom{n}{r} = \frac{n!}{r!\,(n-r)!}

There are 120 ways to choose 3 items from 10 when order does not matter.

Verification

  • Check: P(10, 3) = C(10, 3) × 3! = 120 × 6 = 720.

Detailed explanation

Why the factorials cancel

Writing n!(n−r)!\frac{n!}{(n-r)!} looks like it requires huge numbers, but most factors cancel. For P(8,3)P(8, 3) only 8×7×6=3368 \times 7 \times 6 = 336 remains: eight choices for first place, seven for second and six for third. The calculator shows this shortcut instead of computing full factorials.

Combinations divide out the r!r! orderings of each selection. That is why C(n,r)C(n, r) is always smaller than or equal to P(n,r)P(n, r), and why C(n,r)=C(n,n−r)C(n, r) = C(n, n - r): choosing which rr items to take is the same as choosing which n−rn - r to leave behind.

Counting with repetition

When items can be reused and order matters, each of the rr positions has nn options, giving nrn^r. A four-digit PIN has 104=10,00010^4 = 10{,}000 possibilities.

When items can be reused but order does not matter, the stars-and-bars method gives (n+r−1r)\binom{n + r - 1}{r}. Choosing 4 scoops from 3 flavours, with repeats allowed, can be done in (64)=15\binom{6}{4} = 15 ways. In this mode rr may be larger than nn.

Large numbers and edge cases

The number of five-card poker hands is C(52,5)=2,598,960C(52, 5) = 2{,}598{,}960, and the calculator keeps such answers exact using whole-number arithmetic. By convention C(n,0)=1C(n, 0) = 1, since there is exactly one way to choose nothing.

Without repetition you cannot choose more items than exist. Asking for C(3,5)C(3, 5) produces a clear message suggesting a repetition mode or a smaller rr, rather than a meaningless zero.

Combinations and Pascal's triangle

The values C(n,r)C(n, r) form Pascal's triangle, where each entry is the sum of the two above it: C(n,r)=C(n−1,r−1)+C(n−1,r)C(n, r) = C(n - 1, r - 1) + C(n - 1, r). The identity has a counting explanation. Fix one particular item; every selection either includes it, leaving r−1r - 1 more to choose from the other n−1n - 1, or excludes it, leaving all rr to choose from the other n−1n - 1.

The same numbers are the coefficients in the binomial expansion (a+b)n=∑r=0n(nr)an−rbr(a + b)^n = \sum_{r=0}^{n} \binom{n}{r} a^{n-r} b^r, which is why they are called binomial coefficients. Adding a full row gives 2n2^n, the total number of subsets of an nn-item set, since each item is either in or out.

Common mistakes

  • Using permutations when order does not matter, which overcounts by a factor of r!r!.
  • Using combinations for arrangements such as passwords, rankings or seatings.
  • Forgetting that repetition changes the formula entirely.
  • Computing full factorials by hand instead of cancelling, which invites arithmetic errors.
  • Choosing r larger than n in a problem where items cannot repeat.

Tips

  • Ask 'would swapping two chosen items give a different outcome?' If yes, use permutations.
  • Use C(n,r)=C(n,n−r)C(n, r) = C(n, n - r) to simplify calculations by hand.
  • Break complex problems into stages and multiply the counts for each stage.
  • Divide a count by the total number of outcomes to turn it into a probability.
  • Use the probability calculator's binomial mode when you need probabilities of k successes rather than raw counts.
  • Estimate first: if a selection count comes out larger than the matching arrangement count, something has gone wrong.

Frequently asked questions

What is the difference between a permutation and a combination?

A permutation counts ordered arrangements; a combination counts unordered selections. Choosing 3 of 10 items gives 720 permutations but only 120 combinations.

How do you calculate nCr?

Use n! ÷ (r!(n − r)!). In practice, multiply the first r factors of n! and divide by r!. For C(10, 3) that is 720 ÷ 6 = 120.

How do you calculate nPr?

Multiply the first r factors of n!: P(8, 3) = 8 × 7 × 6 = 336.

How many five-card poker hands are there?

C(52, 5) = 2,598,960, because the order in which you receive the cards does not matter.

What does 'with repetition' mean?

Each item can be chosen more than once, like digits in a PIN. Ordered selections with repetition number nʳ; unordered ones number C(n + r − 1, r).

Why is C(n, 0) equal to 1?

There is exactly one way to choose no items: the empty selection. The same reasoning gives 0! = 1.

Can r be bigger than n?

Only when repetition is allowed. Without repetition the calculator explains that you cannot choose more items than there are.

Count your arrangements

Choose a counting mode above and enter n and r to get the exact number with steps.

More math calculators