Permutations and Combinations
Calculate the number of permutations (nPr) and combinations (nCr) for choosing r items from a set of n items. Permutations count ordered arrangements; combinations count unordered selections.
- Permutations (nPr)
- 720
Requires n >= r >= 0 and whole numbers. Permutations count ordered arrangements; combinations count unordered selections.
What This Permutation and Combination Calculator Does
This calculator finds two related counts: the number of permutations (nPr) and the number of combinations (nCr) when you choose r items from a set of n distinct items. A permutation counts arrangements where order matters, while a combination counts selections where order does not.
It is useful for students working through probability and statistics, teachers building examples, and anyone solving real counting problems: lottery odds, seating arrangements, committee selection, password possibilities, or the number of ways to pick a team. You enter n and r, and the calculator returns both nPr and nCr.
How It Works: The nPr and nCr Formulas
Both formulas are built on the factorial, written n! which means the product of all positive integers up to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition, 0! = 1.
The two formulas are:
Because every combination of r items can be arranged in r! different orders, nPr is always r! times larger than nCr (except when r is 0 or 1). The inputs must satisfy n ≥ r ≥ 0, and both n and r must be whole numbers.
- Permutations (order matters): nPr = n! / (n − r)!
- Combinations (order does not matter): nCr = n! / (r! × (n − r)!)
Worked Example: Choosing 3 from 5
Suppose you have 5 runners (n = 5) and want to know the outcomes for the top 3 places (r = 3).
Permutations: nPr = 5! / (5 − 3)! = 120 / 2! = 120 / 2 = 60. There are 60 ways to assign gold, silver, and bronze, because order matters.
Combinations: nCr = 5! / (3! × (5 − 3)!) = 120 / (6 × 2) = 120 / 12 = 10. There are only 10 ways to pick a group of 3 runners when you ignore their order. Notice that 60 = 10 × 3!, which confirms the relationship between the two results.
Permutation vs Combination: Which One to Use
The single deciding question is whether order matters. If rearranging the same items produces a different valid outcome, use a permutation. If rearranging them gives the same outcome, use a combination.
- Use nPr (permutation): finishing positions in a race, assigning distinct roles like president and treasurer, forming PIN codes from distinct digits, seating people in a row.
- Use nCr (combination): selecting a committee with no titles, choosing lottery numbers, picking a hand of cards, forming a study group.
Tips and Common Mistakes
These formulas assume items are distinct and that each item is used at most once (selection without repetition). If repetition is allowed, such as digits in a typical PIN, the count is different and these formulas do not apply.
A few things to watch for so your result stays accurate:
- Keep n ≥ r. If r exceeds n, you cannot choose more items than exist, and the formula is undefined.
- Do not confuse the two: nCr is always less than or equal to nPr, so a combination result larger than a permutation signals an input error.
- Edge cases are valid: nCr with r = 0 equals 1 (one way to choose nothing), and nCr with r = n also equals 1.
- Factorials grow extremely fast, so large values of n can produce very large numbers; the calculator handles the arithmetic for you.
Frequently asked questions
What is the difference between a permutation and a combination?
A permutation counts ordered arrangements, so the order of the chosen items matters. A combination counts unordered selections, where order does not matter. There are always at least as many permutations as combinations for the same n and r.
What do n and r mean?
n is the total number of distinct items available, and r is the number of items you select or arrange from that set. You must have n greater than or equal to r.
Why must n and r be whole numbers?
Permutations and combinations count discrete arrangements and selections, so they only make sense for non-negative integers. Fractional values have no combinatorial meaning.
What happens when r equals 0?
There is exactly 1 way to choose nothing and 1 way to arrange nothing, so both nCr and nPr equal 1 when r is 0.