Permutation & Combination Calculator
Find the number of ways to choose r items from n, as permutations (nPr, order matters) and combinations (nCr, order does not matter).
Permutations and combinations
- Permutations (nPr) count the ways to choose r items from n and arrange them. A different order counts as a different arrangement. nPr = n × (n−1) × … × (n−r+1) = n! ÷ (n−r)!
- Combinations (nCr) count the ways to choose r items from n. The order does not matter. nCr = nPr ÷ r! = n! ÷ (r! × (n−r)!)
- Example: choosing 3 of 10 people for 1st, 2nd and 3rd place gives 720 permutations. Choosing 3 of 10 people for a committee gives 120 combinations.
- Relationship: nPr = nCr × r! (arranging the r chosen items in every order turns a combination into a permutation).
Examples
- 10P3 = 720, 10C3 = 120
- 52C5 = 2,598,960 (5-card hands from a 52-card deck)
- 49C6 = 13,983,816 (choosing 6 numbers out of 49)
- 20P2 = 380, 20C2 = 190
- 5P5 = 120, 5C5 = 1
- 1000C500 is a number with 300 digits
When n or r is 0, or r is greater than n
- n = 0 or r = 0: there is exactly one way to choose nothing, so the result is 1 (0P0 = 0C0 = 1, nP0 = nC0 = 1, 0! = 1).
- n = r: nPn = n!, and nCn = 1 (the one way to choose everything).
- r greater than n: you cannot choose more items than you have, so the result is 0 ways (it is not an error).
- Negative numbers, decimals and non-numbers are errors.
How it is calculated, and the limits
- Results are exact whole numbers, so there are no rounding errors.
- n can be up to 1,000 (r is a whole number of 0 or more). 1,000! has 2,568 digits. When a result has 16 or more digits, the calculator shows an approximation and the number of digits, such as "about 4.023873 × 10^2567 (2,568 digits)", and keeps the full number in a collapsed section.
- Permutations with repetition (n to the power r) and combinations with repetition are not covered.
Notes
- To write a probability as a fraction, use the Fraction Calculator (for example, the number of winning combinations ÷ the number of all combinations).
Frequently asked questions
Should I use nPr or nCr?
Use nPr when order matters (rankings, arrangements, PIN codes) and nCr when order does not matter (choosing a committee, the set of winners in a draw).
Why is 0! equal to 1?
Defining it as 1 (there is one way to arrange nothing) keeps the formulas for nPr and nCr working when n = r or r = 0.
Why is nC0 equal to 1?
There is exactly one way to choose 0 items: choose nothing.