Calculator

Permutations and combinations calculator

Count arrangements and selections: P(n, r), C(n, r) and n factorial, computed exactly.

  • No account needed
  • Nothing leaves your browser
  • Works offline

What is in here

7topics
534problems
54formulas
60proof tasks
0 learned0 saved0 practice attempts0% accuracy0 proof checks

Calculators

Discrete math tools

Six calculators that run entirely in this browser. Inputs are validated, so a rejected entry says what is wrong instead of returning a confident wrong answer.

Counting

Combinatorics

Permutations and combinations of r items drawn from n, in exact arbitrary-precision arithmetic.

Whole numbers with 0 ≤ r ≤ n ≤ 200. Blank fields and exponent notation are refused, not read as zero.

Try
n!
3628800
P(n,r)n! / (n-r)!
720
C(n,r)n! / (r!(n-r)!)
120

About the permutations and combinations calculator

A permutation counts ordered arrangements. P(n, r) is the number of ways to pick r items out of n when the order you pick them in matters, and equals n factorial divided by (n minus r) factorial. Choosing a president and a treasurer from a club is a permutation, because swapping the two people gives a different outcome.

A combination counts unordered selections. C(n, r), read n choose r, is the number of ways to pick r items out of n when order does not matter, and equals P(n, r) divided by r factorial. Choosing a two-person committee is a combination, because the same two people are the same committee either way.

Combinations are symmetric: C(n, r) equals C(n, n minus r), since choosing which r to include is the same as choosing which n minus r to leave out. Results are computed in arbitrary precision integers, so a value like C(200, 100) comes back exact rather than in floating point notation.

Worked example

Worked example

Inputn = 5, r = 2
ResultP(5, 2) = 20, C(5, 2) = 10

There are 20 ordered pairs and 10 unordered pairs, and 20 divided by 2 factorial is 10.

Questions

Frequently asked

What is the difference between a permutation and a combination?

A permutation counts arrangements where order matters; a combination counts selections where it does not. P(n, r) is always at least as large as C(n, r), and P(n, r) divided by r factorial gives C(n, r).

When do I use n choose r?

Use C(n, r) when you are picking a subset and the order of the picks is irrelevant: committees, hands of cards, or which questions to answer on an exam.

Why does C(n, r) equal C(n, n - r)?

Choosing which r items to take is the same decision as choosing which n minus r items to leave behind, so the two counts have to agree. That is why C(10, 3) and C(10, 7) are both 120.