Combination (nCr) Calculator
Compute the number of ways to choose r items from n without regard to order, with the related permutation and symmetry.
Last updated:
Input
Calculate nCr, the number of ways to choose r items from n distinct items without regard to order. The permutation nPr and the symmetry are shown together.
Enter an integer of 0 or more
Enter an integer up to n
Result
Combination nCr of choosing 3 from 10
120
Permutation nPr arranging 3 of 10
720
Symmetry nC(n minus r) choosing 7 of 10
120
Digits of nCr
3
By symmetry nCr equals nC(n minus r). Choosing many items gives the same result as choosing the items left behind.
Pascal triangle
Each value is the sum of the two values above it, and row n holds the binomial coefficients nCk.
| n = 0 | 1 |
| n = 1 | 1 1 |
| n = 2 | 1 2 1 |
| n = 3 | 1 3 3 1 |
| n = 4 | 1 4 6 4 1 |
| n = 5 | 1 5 10 10 5 1 |
| n = 6 | 1 6 15 20 15 6 1 |
Combination nCr equals n! divided by ( r! times (n minus r)! ). Permutation nPr equals n! divided by (n minus r)!, and multiplying nCr by r! gives nPr.
How it works
- A combination nCr is the number of ways to choose r items from n distinct items without regard to order, given by nCr = n! divided by ( r! times (n minus r)! ).
- The value is built with an iterative calculation that alternates multiplication and division. Each step divides exactly, so BigInt yields an exact integer even for large results.
- Because of the symmetry nCr equals nC(n minus r), choosing many items gives the same result as choosing the items left behind.
- The permutation nPr counts ordered arrangements and equals n! divided by (n minus r)!. Multiplying a combination by the number of orderings r! gives the permutation.
- Pascal triangle is a triangle where each value is the sum of the two values above it, and the kth entry in row n equals the binomial coefficient nCk.
- When r is greater than n no selection is possible, so the result is undefined. A large upper bound on n is applied to keep the computation safe.
Frequently asked questions
- What is the formula for the combination nCr?
- It is nCr=n!÷(r!×(n−r)!); for example 5C2=10. The tool multiplies and divides step by step using BigInt so it stays exact even for large values.
- How does a combination nCr differ from a permutation nPr?
- A combination just selects and ignores order, while a permutation nPr=n!÷(n−r)! counts ordered arrangements. Multiplying nCr by the number of orderings r! gives nPr.
- Is there a shortcut when r is more than half of n?
- Yes. Because of the symmetry nCr=nC(n−r), you can compute using the number left out instead and get the same result. If r exceeds n there is nothing to choose, so it cannot be computed.
Reviews
Tell us what you think of this calculator.
Write a review
Rating