CalcMountain

Combination Calculator (nCr)

Calculate combinations using the formula C(n, r) = n! / (r! * (n - r)!). Combinations count the number of ways to choose items where order does not matter.

Combinations count the number of ways to choose r items from a group of n, where order doesn't matter. The notation C(n,r) or "n choose r" or nCr appears throughout probability, statistics, and combinatorics. Real-world examples: choosing a 5-card poker hand from 52 cards, selecting a 12-person jury from 50 candidates, forming a 3-person committee from 10 employees, or calculating lottery combinations.

This calculator returns C(n,r) = n! / (r! × (n-r)!). The result is also called the "binomial coefficient" because it appears in the expansion of (a+b)^n. For large n, results can be extremely large — C(52, 26) is over 495 trillion.

Combinations are essential for: - **Probability calculations**: lottery odds, hypergeometric distribution. - **Card games**: poker hand probabilities. - **Sampling theory**: number of possible samples. - **Genetics**: gene combinations. - **Computer science**: subset enumeration.

Inputs

Results

Combinations (nCr)

120

Formula

C(10, 3) = 10! / (3! × 7!)

n!

3,628,800

r!

6

(n-r)!

5,040

Last updated:

Formula

**Combination formula (nCr):** C(n, r) = n! / (r! × (n-r)!) Where: - **n!**: n factorial = n × (n-1) × ... × 2 × 1 - **r**: items chosen - **n-r**: items left **Properties:** - **C(n, 0) = 1**: only one way to choose nothing. - **C(n, n) = 1**: only one way to choose all. - **C(n, 1) = n**: n ways to choose 1. - **C(n, r) = C(n, n-r)**: symmetric. **Pascal's triangle:** Each entry is C(n, r). Each row n+1 = previous entries summed. | n\r | 0 | 1 | 2 | 3 | 4 | 5 | |---|---|---|---|---|---|---| | 0 | 1 | | | | | | | 1 | 1 | 1 | | | | | | 2 | 1 | 2 | 1 | | | | | 3 | 1 | 3 | 3 | 1 | | | | 4 | 1 | 4 | 6 | 4 | 1 | | | 5 | 1 | 5 | 10 | 10 | 5 | 1 | **Worked example: C(10, 3)** C(10, 3) = 10! / (3! × 7!) = 3,628,800 / (6 × 5,040) = 3,628,800 / 30,240 = 120 There are 120 ways to choose 3 items from 10. **Common combinations:** | Problem | Calculation | Result | |---|---|---| | Poker hand (5 from 52) | C(52, 5) | 2,598,960 | | Bridge hand (13 from 52) | C(52, 13) | 635,013,559,600 | | Lottery (6 from 49) | C(49, 6) | 13,983,816 | | Lottery (6 from 75 - Mega Millions) | C(75, 6) | 17,259,390 | | 3-of-a-kind from 13 ranks | C(13, 1) × C(48, 2) | varies | | Pick 3-person committee from 10 | C(10, 3) | 120 | | Subset of 5 from 20 | C(20, 5) | 15,504 | **Probability with combinations:** For uniform selection: P(specific combination) = 1 / C(n, r) **Examples:** - Pick correct lottery 6 from 49: 1 / 13,983,816 ≈ 7.15e-8. - Royal flush in poker (5 cards): 4 × C(13,1) ways to get / C(52,5) = ~0.000154. **Combinations vs permutations:** - **Combinations** ignore order: ABC = ACB = BCA. Use when arrangement doesn't matter. - **Permutations** count order: ABC ≠ ACB ≠ BCA. Use when arrangement matters. - **Relationship**: P(n, r) = C(n, r) × r! **Hypergeometric distribution:** Sampling without replacement uses combinations: P(k successes in n draws from population with K successes) = C(K,k) × C(N-K, n-k) / C(N, n) Where N is population, K is success count. **Common applications:** | Field | Combinations of | |---|---| | Cards | Hand combinations | | Lottery | Ticket combinations | | Statistics | Sampling sequences | | Genetics | Gene combinations | | Set theory | Subsets | | Group theory | Committee selection | | Quality control | Lot inspection | | Logistics | Pickup combinations | **Pascal's identity:** C(n+1, r+1) = C(n, r) + C(n, r+1) This generates Pascal's triangle. **Symmetry:** C(n, r) = C(n, n-r) Example: C(10, 3) = C(10, 7) = 120. **Sum of all combinations:** Σ C(n, r) from r=0 to n = 2^n For n=4: 1+4+6+4+1 = 16 = 2^4. **Common combinatorial identities:** - Hockey stick: Σ C(k, r) = C(k+1, r+1) for k from r. - Vandermonde: Σ C(m, k) × C(n, r-k) = C(m+n, r). **Practical limits:** - C(170, 85) ≈ 10^49 — Excel begins to lose precision. - C(52, 26) ≈ 4.95 × 10^14 — possible bridge games. **Computing for large numbers:** For large C(n, r): - Use logarithms: log C(n,r) = log(n!) - log(r!) - log((n-r)!). - Use Stirling approximation for very large numbers. - Use computer software (R, Python).

How to use this calculator

  1. Enter total items (n).
  2. Enter items chosen (r).
  3. Calculator returns C(n, r).
  4. Verify r ≤ n (can't choose more than available).
  5. For probability problems with equal likelihood, P = 1/C(n,r).
  6. Watch out for large numbers — overflow possible at large n.

Worked examples

Lottery odds

**Scenario:** Pick 6 numbers from 49 for lottery. What's the chance of winning? **Calculation:** C(49, 6) = 49! / (6! × 43!) = 13,983,816 ways. P(winning) = 1 / 13,983,816 ≈ 7.15 × 10⁻⁸. **Result:** Odds are 13.98 million to 1. To have 50% chance of winning, you'd need ~9.7 million tickets.

Poker hand

**Scenario:** Number of possible 5-card poker hands from 52-card deck. **Calculation:** C(52, 5) = 52! / (5! × 47!) = 2,598,960. **Result:** 2,598,960 possible hands. Each specific hand has probability 1/2,598,960. Various hand categories (one pair, two pair, etc.) make up subsets of this.

Committee selection

**Scenario:** Choose 3-person committee from 10 employees. How many possible committees? **Calculation:** C(10, 3) = 10! / (3! × 7!) = 120 different committees. **Result:** 120 distinct committee selections. Order doesn't matter (Alice, Bob, Carol = Bob, Alice, Carol).

When to use this calculator

**Use combinations when:**

- Choosing items where order doesn't matter. - Subsets of fixed size. - Sampling without replacement. - Probability of specific selections. - Counting possible groupings.

**Use permutations instead when:**

- Order matters (arrangements, rankings). - Sequences of events. - Linear orderings.

**Common applications:**

- **Card games**: hand combinations. - **Lotteries**: winning number combinations. - **Sampling**: number of possible samples. - **Genetics**: allele combinations. - **Group projects**: team selections. - **Quality control**: which parts to inspect. - **Sports**: bracket combinations.

**Probability with combinations:**

P(specific outcome) = 1 / C(n, r) for uniform selection.

For multiple specific outcomes: count favorable / total.

**Hypergeometric distribution:**

For sampling without replacement: P(k successes in n trials) = C(K,k) × C(N-K, n-k) / C(N, n)

Where N = population, K = successes in population.

**Examples in probability:**

| Scenario | Combination needed | |---|---| | Lottery odds | C(49, 6) = 13.98M | | Poker royal flush | C(13,1) × C(4,1) / C(52,5) | | Two pair odds | C(13,2) × C(4,2)² × C(44,1) / C(52,5) | | Bridge hand types | Various C(n, r) combinations |

**Counting principle:**

Combinations are part of broader counting: - Multiplication: independent choices multiply. - Addition: mutually exclusive cases add. - Permutations: ordered arrangements. - Combinations: unordered selections.

**Programming combinations:**

Direct calculation: - Python: math.comb(n, r) or scipy.special.comb() - R: choose(n, r) - Excel: COMBIN(n, r) - C/C++: factorial calculation

For large n: use approximation or log-space.

**Pascal's triangle:**

Each row r contains C(r, 0), C(r, 1), ..., C(r, r). Each entry equals sum of two above. Generates all combinations systematically.

**Binomial theorem:**

(a + b)^n = Σ C(n, k) × a^(n-k) × b^k

The binomial coefficients are the combinations.

**Common counting principles:**

| Type | Formula | Example | |---|---|---| | Permutation | n! | Arrange 5 books: 5! = 120 | | Permutation (subset) | n!/(n-r)! | 5 from 10 in order: 30,240 | | Combination | n!/(r!(n-r)!) | 5 from 10 unordered: 252 | | Multinomial | n!/(r₁!r₂!...rₖ!) | Multiple groups |

**Stars and bars:**

Distribution problems: number of ways to put n identical items in k groups = C(n+k-1, k-1).

**Computer science applications:**

- Combinatorial search. - Subset enumeration. - Knapsack problems. - Cryptographic key combinations. - Algorithm analysis.

**Beyond simple combinations:**

- Permutations with repetition. - Combinations with repetition. - Multinomial coefficients. - Restricted combinations.

**Common errors:**

- Confusing nCr with nPr. Order matters in P; not in C. - Trying to choose more than available (r > n). - Forgetting C(n, 0) = C(n, n) = 1. - Computing for very large n without overflow protection.

Common mistakes to avoid

  • Confusing combinations with permutations. C ignores order; P respects order.
  • Trying to compute C(n, r) where r > n. Mathematically zero.
  • Forgetting r! / (n-r)! division. Just dividing by n! gives wrong answer.
  • Computing for very large numbers without log scale. Overflow common.
  • Treating C(n, 0) and C(n, n) as undefined. Both equal 1.
  • Using nCr formula when nPr is appropriate. Order matters in many cases.
  • Confusing with factorials. n choose r is not the same as r!.

Frequently Asked Questions

Sources & further reading

SponsoredShop Top Deals on AmazonSupport CalcMountain — browse top-rated products at no extra cost to you.

Related Calculators