Skip to content
CalcWorld

Browse all tools

Permutation and Combination Calculator

The permutation and combination calculator works out nPr and nCr from n and r. A permutation counts arrangements where order matters; a combination counts selections where it does not, so 5 cards from 52 give 2,598,960 hands.

Sources: OpenStax Precalculus 2e, Wikipedia Updated

Choosing 3 from 10

nCr = 120

nPr = 720

Combinations (order does not matter)
120
Permutations (order matters)
720
Show steps Here’s how we got it
  1. Decide whether order matters

    Order matters → permutation (nPr)

    Order does not matter → combination (nCr)

    Picking a president and a deputy is a permutation. Picking two people for a committee is a combination.

  2. Count the permutations

    nPr = n!/(n − r)! = 10!/7!

    = 10 × 9 × 8 = 720

    Everything from 7 down cancels, leaving the top 3 factors.

  3. Divide by r! to remove the different orders

    nCr = n!/r!(n − r)! = nPr/r! = 720/6 = 120

    Each group of 3 items can be arranged in 3! = 6 orders, and a combination counts them once.

Permutation and combination formulas

nPr=n!(n−r)!nCr=(nr)=n!r! (n−r)!_nP_r = \frac{n!}{(n - r)!} \qquad _nC_r = \binom{n}{r} = \frac{n!}{r!\,(n - r)!}

n is the number of items to choose from and r is the number chosen. The exclamation mark is a factorial: n! = n × (n − 1) × … × 2 × 1, and 0! = 1. These are the formulas in OpenStax Precalculus.

With repetition allowed, ordered results are n to the power r, which the exponent calculator works out step by step.

Order mattersOrder does not matter
No repetitionn!(n−r)!\frac{n!}{(n-r)!}n!r! (n−r)!\frac{n!}{r!\,(n-r)!}
Repetition allowednrn^r(n+r−1)!r! (n−1)!\frac{(n+r-1)!}{r!\,(n-1)!}

How to calculate nCr: 5-card hands from a 52-card deck

How many 5-card hands can be dealt from a standard 52-card deck? The order of the cards in a hand does not matter, so this is a combination.

  1. Decide whether order matters

    Order matters → permutation (nPr)

    Order does not matter → combination (nCr)

    Picking a president and a deputy is a permutation. Picking two people for a committee is a combination.

  2. Count the permutations

    nPr = n!/(n − r)! = 52!/47!

    = 52 × 51 × 50 × 49 × 48 = 311,875,200

    Everything from 47 down cancels, leaving the top 5 factors.

  3. Divide by r! to remove the different orders

    nCr = n!/r!(n − r)! = nPr/r! = 311,875,200/120 = 2,598,960

    Each group of 5 items can be arranged in 5! = 120 orders, and a combination counts them once.

Answer: nCr = 2,598,960 nPr = 311,875,200

So the chance of being dealt one particular hand is 1 in 2,598,960. To see the actual groups for a short list instead of counting them, use the all possible combinations generator. More counting and data tools are on the statistics calculators page.

Steps for choosing 5 cards from 52: 52 × 51 × 50 × 49 × 48 = 311,875,200 ordered draws, divided by 5! = 120 orders of each hand, gives 2,598,960 combinations.
Every hand turns up 120 times among the ordered draws, once for each order of its five cards.

Permutation and combination practice question

Eight runners are in a race. In how many ways can the gold, silver and bronze medals be awarded? And how many different groups of three medal winners are possible?

Check your answer

Answer: nCr = 56 nPr = 336

  1. Decide whether order matters

    Order matters → permutation (nPr)

    Order does not matter → combination (nCr)

    Picking a president and a deputy is a permutation. Picking two people for a committee is a combination.

  2. Count the permutations

    nPr = n!/(n − r)! = 8!/5!

    = 8 × 7 × 6 = 336

    Everything from 5 down cancels, leaving the top 3 factors.

  3. Divide by r! to remove the different orders

    nCr = n!/r!(n − r)! = nPr/r! = 336/6 = 56

    Each group of 3 items can be arranged in 3! = 6 orders, and a combination counts them once.

Permutation and Combination Calculator: FAQ

What is the difference between a permutation and a combination?

In a permutation the order matters, so ABC and BAC count as two different results. In a combination the order does not matter, so they count as one. Choosing a president, a deputy and a treasurer from 10 people is a permutation. Choosing 3 people for a committee is a combination.

How do you calculate nCr?

nCr = n! ÷ (r! × (n − r)!). For 10 choose 3: 10 × 9 × 8 = 720 arrangements, divided by 3! = 6 orders of each group, gives 120 combinations.

How do you calculate nPr?

nPr = n! ÷ (n − r)!, which is the product of the r largest numbers up to n. For 10 and 3 it is 10 × 9 × 8 = 720.

Why is nPr always at least as big as nCr?

Each combination of r items can be put in r! different orders, and each order is a separate permutation. So nPr = nCr × r!.

What changes when repetition is allowed?

With repetition, an item can be picked more than once. The number of ordered results is n to the power r. The number of unordered results is (n + r − 1)! ÷ (r! × (n − 1)!). A 4-digit PIN from the digits 0 to 9 is an ordered choice with repetition: 10⁴ = 10,000.

How do I list the combinations instead of counting them?

Use the combinations generator, which writes out every combination of a list of items.

Sources