विकी

Permutations & Combinations: Counting Without Listing

How to calculate permutations (nPr) and combinations (nCr) using factorial formulas. Worked examples for order-matters vs order-doesn't-matter.

Verified against NIST/SEMATECH e-Handbook of Statistical Methods on 20 Feb 2025 Updated 20 February 2025 4 min read
कैलकुलेटर खोलें

Translation unavailable - this article is shown in English. View English version

Summary

Permutations and combinations are the two fundamental ways of counting how items can be selected from a group. A permutation counts arrangements where order matters (e.g., ranking, seating, passwords). A combination counts selections where order does not matter (e.g., lottery picks, committee membership, card hands). Both rely on the factorial function, which multiplies a number by every positive integer below it.

How it works

The calculator computes three values:

  1. Factorial (n!) — the product of all positive integers from 1 to n. By definition, 0! = 1.
  2. Permutations (nPr) — the number of ordered arrangements of r items chosen from n. Each different ordering counts as a separate permutation.
  3. Combinations (nCr) — the number of unordered selections of r items chosen from n. Rearranging the same items does not create a new combination.

The key insight: nCr = nPr / r! because every combination of r items can be arranged in r! different orders.

The formulas

n! = n * (n-1) * (n-2) * ... * 1

Where

n!= n factorial -- the product of all positive integers up to n
0!= Defined as 1 (the empty product)
nPr = n! / (n - r)!

Where

n= Total number of items
r= Number of items being chosen
nPr= Number of ordered arrangements
nCr = n! / (r! * (n - r)!)

Where

n= Total number of items
r= Number of items being chosen
nCr= Number of unordered selections (also written C(n,r) or 'n choose r')

Worked examples

How many 3-letter arrangements from A, B, C, D, E?

1

Identify n and r

n = 5 letters, r = 3 positions

= n = 5, r = 3

2

Apply permutation formula

5P3 = 5! / (5-3)! = 120 / 2

= 60

Result

There are 60 different 3-letter arrangements (ABC, ACB, BAC, ... are all distinct)

How many 5-card hands from a 52-card deck?

1

Identify n and r

n = 52 cards, r = 5 cards drawn

= n = 52, r = 5

2

Apply combination formula (order doesn't matter)

52C5 = 52! / (5! * 47!) = (52 * 51 * 50 * 49 * 48) / (5 * 4 * 3 * 2 * 1)

= 311,875,200 / 120

3

Simplify

311,875,200 / 120

= 2,598,960

Result

There are 2,598,960 possible 5-card poker hands

10! (factorial of 10)

1

Multiply all integers from 1 to 10

10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1

= 3,628,800

Result

10! = 3,628,800

Practical uses

  • Lottery odds — the number of ways to choose 6 numbers from 49 is 49C6 = 13,983,816, giving odds of roughly 1 in 14 million.
  • Passwords — the number of possible 8-character passwords from 62 characters (a-z, A-Z, 0-9) is 62P8 with replacement = 62^8 = 218 trillion.
  • Tournament brackets — the number of ways to seed n teams is n! (a permutation of all teams).
  • Committee selection — choosing a 4-person committee from 20 candidates is 20C4 = 4,845 possible groups.

Assumptions & limitations

  • Non-negative integers only — factorial is defined for non-negative integers. The gamma function extends it to real and complex numbers, but this calculator uses the integer definition.
  • Overflow for large n — factorials grow extremely fast (20! = 2.4 quintillion). The calculator handles large values but may show results in scientific notation.
  • r cannot exceed n — you cannot choose more items than are available. nPr and nCr are zero (or undefined) when r > n.
  • No replacement — these formulas assume each item is used at most once. For sampling with replacement, the formulas differ (n^r for ordered, C(n+r-1, r) for unordered).

स्रोत

permutation combination factorial probability counting math