Article
Combinations Formula: How to Calculate C(n, k) and nCr
Combinations are the ways to choose k items from n when the order does not matter. The number of combinations is written C(n, k) or nCr and is found with the formula n! ÷ (k! · (n − k)!). This article gives the formula, the difference between combinations and permutations, Pascal’s triangle and four worked examples. You can check your own numbers in the combinations calculator. For n = 10 and k = 3 the result is 120.
Last updated:
Work out combinations in the combinations calculator. When the order matters, use the permutations calculator.
The combinations formula
A combination is a subset of k items chosen from n items in which the order does not matter. The number of such subsets is called the binomial coefficient, or n choose k.
C(n, k) = n! ÷ (k! · (n − k)!)
example: C(10, 3) = 3,628,800 ÷ (6 · 5,040) = 120
C(n, k) = C(n, n − k)
C(n, 0) = C(n, n) = 1
| n | k = 1 | k = 2 | k = 3 | k = 4 | k = 5 |
|---|---|---|---|---|---|
| 4 | 4 | 6 | 4 | 1 | — |
| 5 | 5 | 10 | 10 | 5 | 1 |
| 6 | 6 | 15 | 20 | 15 | 6 |
| 7 | 7 | 21 | 35 | 35 | 21 |
| 8 | 8 | 28 | 56 | 70 | 56 |
| 10 | 10 | 45 | 120 | 210 | 252 |
| 12 | 12 | 66 | 220 | 495 | 792 |
You can work out the factorial n! in the factorial calculator. For large n it is easier to cancel factors than to compute three factorials separately.
Try it with an example
Example: choosing 3 items from 10. Both numbers are already stored in the link to the calculator.
- Number of items n
- 10
- Number chosen k
- 3
- Result
- C(10, 3) = 120, permutations P(10, 3) = 720
Open the calculator with these numbers
The calculator reads the values from the page address and shows the result right away. You can change them freely.
How the calculator works
The calculator finds the binomial coefficient C(n, k) by multiplying successive factors and reducing them by the GCF, so that the result is exact. It uses the symmetry C(n, k) = C(n, n − k). Next to the result it shows the permutations without repetition P(n, k), the form with factorials and the symmetric value. Non-integer inputs are rounded down, and the result is blank when k is larger than n. Results above 2^53 are given as approximations.
Combinations versus permutations
When the order does not matter you count combinations. When it matters you count permutations without repetition, P(n, k) = n! ÷ (n − k)!. For n = 10 and k = 3 there are 720 permutations and 120 combinations. The ratio 720 ÷ 120 = 6 is the number of ways to arrange the three chosen items, which is 3!.
Full permutations are the case where all items are chosen: P(n, n) = n!. You can compute permutations in the permutations calculator and the full permutations calculator, and the factorial in the factorial calculator.
Pascal’s triangle and symmetry
The numbers C(n, k) form Pascal’s triangle: each number is the sum of the two numbers above it, so C(n, k) = C(n − 1, k − 1) + C(n − 1, k). For C(5, 2) we have C(4, 1) + C(4, 2) = 4 + 6 = 10. Row n holds all the coefficients of the expansion of the binomial (a + b)ⁿ, which is why they are called binomial coefficients.
The symmetry C(n, k) = C(n, n − k) follows from the fact that choosing k items is the same as choosing the n − k items to leave out. For n = 10 we have C(10, 3) = C(10, 7) = 120. The calculator shows this value next to the main result.
Where combinations are used
Combinations count groups, committees, sets and draws without order. Choosing 5 cards from a deck of 52 gives C(52, 5) = 2,598,960 possible poker hands. In a group of 5 people there are C(5, 2) = 10 pairs, which is the number of handshakes when everybody shakes hands with everybody else.
Percentages, proportions and means, which often appear in such problems, can be worked out in the percentage calculator and the mean calculator. A related article is How to Calculate a Percentage of a Number.
Four worked examples
You can repeat each example in the combinations calculator.
1. Handshakes in a group of 5 people
Choosing 2 people from 5.
- Enter n = 5 and k = 2.
- Compute 5! ÷ (2! · 3!) = 120 ÷ (2 · 6).
- The result is 10.
- The order does not matter, so the permutations would be 20.
2. A committee of three from 10 people
Choosing 3 people from 10.
- Enter n = 10 and k = 3.
- Compute 3,628,800 ÷ (6 · 5,040).
- The result is 120.
- The permutations (with order) number 720.
3. A pizza with 3 toppings out of 8
Choosing 3 ingredients from 8.
- Enter n = 8 and k = 3.
- Compute 8 · 7 · 6 ÷ (3 · 2 · 1).
- The result is 56.
- The order of the toppings does not matter.
4. A poker hand of 5 cards from 52
Choosing 5 cards from a deck.
- Enter n = 52 and k = 5.
- Compute 52 · 51 · 50 · 49 · 48 ÷ 5!.
- The result is 2,598,960.
- The chance of one specific hand is 1 in 2,598,960.
Common mistakes when counting combinations
- Confusing combinations with permutations — with combinations the order does not matter, so the result is k! times smaller.
- Entering k larger than n — you cannot choose more items than are available.
- Computing a factorial by multiplying n by k — a factorial is the product of all the numbers from 1 to n.
- Leaving out (n − k)! in the denominator — without it the result is far too large.
- Mixing up n and k — n is the number of items to choose from, and k is the number chosen.
- Ignoring the symmetry — C(10, 7) is faster to compute as C(10, 3).
- Assuming 0! = 0 — by definition 0! = 1, so C(n, 0) = 1.
Frequently asked questions
How do you calculate combinations?
Use the formula C(n, k) = n! ÷ (k! · (n − k)!). For n = 10 and k = 3 the result is 120.
What is the basic formula for combinations?
The basic formula is C(n, k) = n! ÷ (k! · (n − k)!), where n is the number of items and k is the number chosen. It is also written nCr or as n choose k.
What is the difference between combinations and permutations?
With combinations the order does not matter, and with permutations it does. For n = 10 and k = 3 there are 120 combinations and 720 permutations, which is 3! = 6 times more.
What is C(5, 2)?
C(5, 2) = 5! ÷ (2! · 3!) = 10. That is how many pairs you can choose from five items.
How many 5-card hands are there in a deck of 52?
There are C(52, 5) = 2,598,960 possible hands.
What are C(n, 0) and C(n, n)?
Both are equal to 1, because there is one way to choose no items and one way to choose all of them.
What does the symmetry C(n, k) = C(n, n − k) mean?
Choosing k items is equivalent to choosing the n − k items to leave out. For n = 10 we have C(10, 3) = C(10, 7) = 120.
What does the calculator return when k is larger than n?
The result is blank, because you cannot choose more items than are available. The calculator rounds non-integer values down.
Calculate combinations for your own numbers
Enter n and k in the combinations calculator and read the number of combinations, the symmetric value, the permutations and the form with factorials.
When the order matters, use the permutations calculator, and work out a factorial in the factorial calculator.