EthicalFusion

Permutation & Combination Calculator

Calculate nPr (permutations) and nCr (combinations) for any n and r.

Was this tool helpful?

Thanks for the feedback!

Enter n (the total number of items) and r (how many you pick) and this calculator returns the number of combinations (nCr), the number of permutations (nPr) and n factorial. It covers the counting questions in Class 11 maths, probability homework and the aptitude sections of exams like CAT and bank PO tests.

The two formulas

nPr = n! ÷ (n − r)!
nCr = n! ÷ (r! × (n − r)!) = nPr ÷ r!

For n = 10 and r = 3: 10P3 = 10 × 9 × 8 = 720, and 10C3 = 720 ÷ 3! = 720 ÷ 6 = 120. The third line shows 10! = 3,628,800. Combinations are always smaller than or equal to permutations, because each group of r items can be arranged in r! different orders.

Does order matter? Choosing the right one

QuestionUseAnswer
Pick a president, vice-president and secretary from 10 members10P3720
Pick a 3-person committee from 10 members10C3120
Choose a playing XI from a 15-player squad15C111,365
Arrange the XI into a batting order11P1139,916,800
Pick 6 numbers from 49 in a lottery49C613,983,816
Deal a 5-card hand from 52 cards52C52,598,960

Ask yourself whether swapping two chosen items creates a different outcome. If a committee of Asha, Ben and Chitra is the same as Chitra, Ben and Asha, order does not matter and you need nCr. If Asha as president differs from Asha as secretary, you need nPr.

Limits of the calculator

  • n can be at most 170, because 171! is larger than the biggest number standard floating-point arithmetic can hold (about 1.8 × 10³⁰⁸).
  • Very large answers are approximate. Results are exact up to roughly 15 or 16 significant digits. 100C50, for example, shows the correct leading digits followed by zeros, while the exact value ends in …497,256.
  • r must be between 0 and n, and decimals are rounded down. Since 0! = 1, choosing 0 items gives exactly one combination.

Counting problems this does not cover directly

  • Repetition allowed: a 4-digit PIN where digits can repeat has 10⁴ = 10,000 possibilities, calculated as nʳ rather than nPr. The PIN generator creates such codes.
  • Combinations with repetition: picking 3 scoops from 5 ice-cream flavours, repeats allowed, is C(n + r − 1, r). Enter n = 7 and r = 3 to get 35.
  • Identical items: the letters of BANANA can be arranged in 6! ÷ (3! × 2!) = 60 distinct ways, dividing out the repeated A's and N's.
  • Circular seating: n people around a round table can sit in (n − 1)! ways, since rotations count as the same arrangement.

If you need to actually split people into random groups rather than count the possibilities, the team generator does that.

Frequently asked questions

What is the difference between a permutation and a combination?
A permutation counts ordered arrangements, so ABC and CBA are different. A combination counts selections, so ABC and CBA are the same group.
What is 0 factorial?
0! equals 1 by definition. That is why nC0 and nCn both equal 1.
Why is n limited to 170?
Factorials above 170! exceed the largest number JavaScript can store, so the result would overflow to infinity.
Why do very large results end in many zeros?
Numbers with more than about 16 significant digits are stored approximately, so the digits after that point are shown as zeros.
How do I count arrangements when repetition is allowed?
Raise n to the power r. For example, a 3-letter code using 26 letters with repeats has 26 cubed, or 17,576, options.

Related tools

Embed this tool on your site

Paste it into any blog or website. Free, with a credit link.