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
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.
- 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.
- 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.