Combination and Permutation Calculator (nCr & nPr)

Compute combinations and permutations for any valid n and r, with or without repetition. Get exact values, number of digits, and step-by-step factorial breakdowns to support homework, exams, and professional probability calculations.

This tool is designed for students, teachers, engineers, data scientists, and anyone working with counting principles and discrete probability.

Enter n and r to compute combinations and permutations

n is the total number of distinct objects. Recommended range: 0–500. For step-by-step factorials, keep n ≤ 50.

r is how many items you select or arrange. Without repetition, r cannot exceed n.

Type of counting
Repetition

With repetition: permutations use \( n^r \); combinations use \( \binom{n+r-1}{r} \).

Results

Enter values for n and r, choose the options above, then click Calculate to see combinations and permutations.

Definition: combinations vs permutations

In discrete mathematics and probability, permutations and combinations are two fundamental ways of counting arrangements and selections.

  • A permutation is an ordered arrangement of objects. Changing the order gives a different permutation.
  • A combination is an unordered selection of objects. Two selections that contain the same elements are considered identical, regardless of order.

Standard formulas (no repetition)

Permutations (nPr)

If order matters and repetition is not allowed, the number of permutations of \( r \) objects out of \( n \) distinct objects is:

\[ {}_nP_r = P(n, r) = \frac{n!}{(n-r)!} \]

Combinations (nCr)

If order does not matter and repetition is not allowed, the number of combinations of \( r \) objects out of \( n \) is:

\[ {}_nC_r = C(n, r) = \binom{n}{r} = \frac{n!}{r!(n-r)!} \]

Formulas with repetition allowed

Permutations with repetition

If you can reuse each symbol and there are \( n \) possible symbols for each of the \( r \) positions, the number of permutations is:

\[ P_{\text{rep}}(n, r) = n^r \]

Combinations with repetition

Selections with repetition allowed (multisets) are counted by the classical "stars and bars" formula:

\[ C_{\text{rep}}(n, r) = \binom{n + r - 1}{r} = \frac{(n + r - 1)!}{r!(n - 1)!} \]

Worked example

Suppose you have \( n = 10 \) different books and you want to choose \( r = 3 \) of them.

  1. Permutations (ordered): \[ {}_{10}P_3 = \frac{10!}{(10-3)!} = \frac{10!}{7!} = 10 \cdot 9 \cdot 8 = 720 \] There are 720 possible ordered arrangements of 3 books.
  2. Combinations (unordered): \[ {}_{10}C_3 = \frac{10!}{3! \cdot 7!} = \frac{10 \cdot 9 \cdot 8}{3 \cdot 2 \cdot 1} = 120 \] There are 120 distinct groups of 3 books, ignoring order.

Typical use cases

  • Combinations (nCr): lottery tickets, committees, subsets of features in a model, portfolios where only the set of elements matters.
  • Permutations (nPr): seating arrangements, ordering tasks, PIN codes without repeated digits, rank-based assignments.

FAQ – Combinations & permutations

What is the difference between a permutation and a combination?
A permutation counts ordered arrangements of \( r \) objects chosen from \( n \) distinct objects. If you swap the order, you get a different permutation. A combination counts unordered selections of \( r \) objects from \( n \); the same elements in a different order are considered the same combination.
When should I use permutations instead of combinations?
Use permutations when order matters: rankings, seatings, sequences, codes, or passwords where position is important. Use combinations when you only care which items are included, not how they are arranged—committee selection, subsets, or card hands.
How large can n and r be in this calculator?
For numerical stability and browser performance, the calculator accepts values up to about n = 500. Results are computed using big integers where necessary, but for very large n and r the integers can be extremely long. For textbook-style step-by-step factorial expansion, you will usually get the cleanest output for n ≤ 50.
Why are combinations smaller than permutations for the same n and r?
Every combination of r objects can be arranged in \( r! \) different ways. When you count permutations, you count each of these arrangements separately. When you count combinations, you collapse all \( r! \) permutations of the same set into a single outcome. That is why \( {}_nP_r = {}_nC_r \cdot r! \).