Combination Calculator (nCr)
Calculate C(n,k) binomial coefficients with step-by-step solution, Pascal's triangle & permutation comparison
Step-by-step solution
Enter n and k below to highlight C(n,k) in Pascal's triangle (n ≤ 15 for display).
If C(n,k) ≤ 100, all combinations of indices {0,1,...,n−1} are listed. Enter n and k to generate.
What is a Combination (nCr)?
A combination is a selection of items from a larger set where the order does not matter. If you are choosing 3 people to form a committee from a group of 10, you do not care who is "first" or "second" — only which 3 are on the committee. That is a combination problem.
The notation C(n,k), also written nCk, nCk, or "n choose k", counts the number of ways to choose k items from n distinct items without repetition and without regard to order. It is also called the binomial coefficient because it appears as the coefficient in the binomial expansion (a+b)n.
Compare this to a permutation: if the order of selection matters (e.g., assigning President, Vice-President, and Treasurer from 10 people), you use P(n,k) instead. Since every combination of k items can be arranged in k! orders, we always have P(n,k) = k! × C(n,k).
Combination Formula
The combination formula, also known as the binomial coefficient formula, is:
where n! = n × (n−1) × … × 2 × 1 and 0! = 1
A practical shortcut avoids computing large factorials: multiply n × (n−1) × … down exactly k terms (the numerator), then divide by k!. For C(10,3):
This shortcut works because most of the n! in the numerator cancels with (n−k)! in the denominator, leaving only the top k terms.
Combination vs Permutation
| Feature | Combination C(n,k) | Permutation P(n,k) |
|---|---|---|
| Order matters? | No | Yes |
| Formula | n! / (k!(n−k)!) | n! / (n−k)! |
| Example use | Team selection | Race finish order |
| C(5,2) vs P(5,2) | 10 | 20 |
| Relationship | C(n,k) = P(n,k) / k! | P(n,k) = k! × C(n,k) |
When you have 5 items and choose 2, there are 20 ordered arrangements (permutations). Since each pair can be ordered in 2! = 2 ways, there are 20/2 = 10 unordered combinations. This is the core relationship between the two formulas.
Pascal's Triangle and Binomial Coefficients
Pascal's triangle is a number triangle where every entry equals the sum of the two entries directly above it. The entry in row n (starting at row 0) and column k (starting at column 0) equals exactly C(n,k).
Row 1: 1 1
Row 2: 1 2 1
Row 3: 1 3 3 1
Row 4: 1 4 6 4 1
Row 5: 1 5 10 10 5 1
This works because of Pascal's identity: C(n,k) = C(n−1,k−1) + C(n−1,k). Every interior entry in the triangle is the sum of its two "parent" entries. Pascal's triangle gives a fast, recursive way to compute any combination without using factorials — just build rows from the top.
Real-World Examples
- Lottery (49 choose 6): C(49,6) = 13,983,816. To win India's or UK's national lottery, a player picks 6 numbers from 1–49. There are nearly 14 million possible tickets — which is why jackpot wins are so rare. The probability of a single ticket winning is 1 in 13,983,816.
- Poker hands (52 choose 5): C(52,5) = 2,598,960 possible 5-card hands from a standard 52-card deck. Poker probabilities (straight flush, full house, etc.) are all computed by dividing the number of qualifying hands by 2,598,960.
- Committee selection (10 choose 3): C(10,3) = 120 ways to choose a 3-person committee from 10 candidates. Order does not matter; you care only about who is on the committee, not who was selected first.
- Handshakes in a room: If n people are in a room and everyone shakes hands with everyone else exactly once, the total handshakes = C(n,2) = n(n−1)/2. For 20 people: C(20,2) = 190 handshakes.
- Binomial theorem: (a+b)n = Σ C(n,k) × an−k × bk. The combination C(n,k) is the coefficient of each term, which is why it is called the binomial coefficient.
Special Values Table
| n | k | C(n,k) | Notes |
|---|---|---|---|
| 5 | 2 | 10 | Handshakes for 5 people |
| 10 | 3 | 120 | Committee of 3 from 10 |
| 6 | 3 | 20 | Middle of Pascal row 6 |
| 4 | 2 | 6 | Pairs from 4 items |
| n | 0 | 1 | Always 1 (choose nothing) |
| n | n | 1 | Always 1 (choose everything) |
| n | 1 | n | Always n (choose one) |
| 52 | 5 | 2,598,960 | 5-card poker hands |
| 49 | 6 | 13,983,816 | 6/49 lottery tickets |