What This Calculator Does
This tool computes both permutations (nPr) and combinations (nCr) for a set of n total items from which you select r. Permutations count the number of ordered arrangements, while combinations count unordered selections. The calculator also shows the factorial of n for reference.
How to Use It
Enter the total number of items n and the number you are choosing r, where \(0 \le r \le n\). Click calculate to see nPr and nCr. If r is larger than n, the result is 0 because you cannot choose more items than exist.
The Formula Explained
A factorial \(n!\) is the product of all positive integers up to n (for example \(5! = 5\times4\times3\times2\times1 = 120\)). Permutations are $$nPr = \frac{n!}{(n - r)!}$$ — order matters, so swapping two chosen items counts as a different arrangement. Combinations are $$nCr = \frac{n!}{r!\,(n - r)!}$$ — dividing by \(r!\) removes the duplicate orderings, since order does not matter.
Worked Example
Suppose \(n = 5\) and \(r = 2\). Then $$nPr = \frac{5!}{3!} = \frac{120}{6} = 20$$ ordered pairs. And $$nCr = \frac{5!}{2! \times 3!} = \frac{120}{2 \times 6} = \frac{120}{12} = 10$$ unordered pairs. Notice nPr is always greater than or equal to nCr because every combination can be ordered in \(r!\) ways.
FAQ
When should I use permutations vs combinations? Use permutations when order matters (e.g. ranking, passwords, race finishes) and combinations when it doesn't (e.g. lottery picks, committees, card hands).
What if \(r = 0\)? Both nPr and nCr equal 1 — there is exactly one way to choose nothing.
What is the largest n allowed? Factorials grow extremely fast, so this calculator supports n up to 170 before exceeding the floating-point range.