Roboculator
Online CalculatorsCategoriesDate & EventsNews
Get Started
Online CalculatorsCategoriesDate & EventsNewsGet Started
Roboculator

Smart calculators for every challenge. Free, fast, and private.

Categories

  • Finance
  • Health
  • Math
  • Construction
  • Conversion
  • Everyday Life

Popular Tools

  • Date & Events
  • Loan Calculator
  • BMI Calculator
  • Percentage Calc
  • Latest News
  • Search All

Resources

  • Glossary
  • Topic Tags
  • News & Insights

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • Editorial Policy
  • Disclaimer
© 2026 Roboculator. All rights reserved.
Roboculator

roboculator.com

  1. Home
  2. /Statistics
  3. /Probability Calculators
  4. /Combinations Calculator (nCr)

Combinations Calculator (nCr)

Calculator

Results

Combinations C(n,r)

—

log10 C(n,r)

—

Min(r, n-r)

3

Valid Input Flag

1

Results

Combinations C(n,r)

—

log10 C(n,r)

—

Min(r, n-r)

3

Valid Input Flag

1

The Combinations Calculator computes the number of ways to choose r items from n items without regard to order — denoted C(n, r), ⁿCᵣ, or "n choose r." Combinations are fundamental to combinatorics, probability theory, statistics, and countless applications from lottery odds to genetic analysis. Unlike permutations, combinations treat selections as unordered sets: choosing {A, B, C} is the same as choosing {C, A, B}.

This calculator handles values up to n = 170 using a logarithmic gamma function approach, avoiding overflow issues that plague direct factorial computation. It provides both the exact combination count and its base-10 logarithm for extremely large values.

Visual Analysis

How It Works

The number of combinations is given by the binomial coefficient formula:

$$C(n, r) = \binom{n}{r} = \frac{n!}{r!(n-r)!}$$

Where n! (n factorial) is the product of all positive integers up to n. Direct computation of factorials leads to overflow for even moderate values (170! ≈ 7.26 × 10³⁰⁶), so this calculator uses the log-gamma function approach:

$$\ln C(n,r) = \ln \Gamma(n+1) - \ln \Gamma(r+1) - \ln \Gamma(n-r+1)$$

Where Γ(x) is the gamma function satisfying Γ(n+1) = n! for non-negative integers. The log-gamma function is computed using Stirling's approximation:

$$\ln \Gamma(x) \approx \frac{1}{2} \ln\frac{2\pi}{x} + x\left(\ln\left(x + \frac{1}{12x - \frac{1}{10x}}\right) - 1\right)$$

This approach converts the multiplication of extremely large numbers into addition of their logarithms, maintaining numerical precision across the entire valid range.

Key properties of combinations: C(n, 0) = C(n, n) = 1 (one way to choose nothing or everything), C(n, 1) = n (n ways to choose one item), and the symmetry property C(n, r) = C(n, n-r). The binomial coefficients form Pascal's triangle, where each entry is the sum of the two entries above it.

Understanding Your Results

The result tells you how many distinct groups of size r can be formed from n items when order doesn't matter. For lottery analysis, C(49, 6) = 13,983,816 tells you there are nearly 14 million possible ticket combinations. For committee selection, C(20, 5) = 15,504 possible 5-person committees from 20 candidates.

The log₁₀ output is useful for extremely large values where the combination count exceeds what can be displayed as an integer. A log₁₀ value of 15 means approximately 10¹⁵ combinations.

Worked Examples

Lottery: Choose 6 from 49

Inputs

n49
r6

Results

combinations13983816
log combinations7.1456

The classic 6/49 lottery has C(49,6) = 13,983,816 possible combinations. Your probability of winning the jackpot with one ticket is 1/13,983,816 ≈ 0.0000072%. This is why lotteries are sometimes called a 'tax on people who don't understand probability.'

Poker: 5-Card Hands from 52 Cards

Inputs

n52
r5

Results

combinations2598960
log combinations6.4148

The number of possible 5-card poker hands is C(52,5) = 2,598,960. This is the denominator for calculating poker hand probabilities. For example, there are only 4 possible royal flushes, so P(royal flush) = 4/2,598,960 ≈ 0.000154%.

Frequently Asked Questions

Combinations count unordered selections — choosing {A, B} is the same as {B, A}. Permutations count ordered arrangements — (A, B) and (B, A) are different. Mathematically, P(n, r) = C(n, r) × r!, meaning permutations equal combinations multiplied by the number of ways to arrange r items. Use combinations when order doesn't matter (committees, lottery draws, card hands) and permutations when it does (rankings, sequences, PIN codes).

This is the symmetry property: choosing r items to include is equivalent to choosing (n-r) items to exclude. Selecting 3 people from 10 for a committee is the same as selecting 7 people to NOT be on the committee. Both processes produce the same groups. Mathematically: n!/(r!(n-r)!) = n!/((n-r)!r!). This property is computationally useful — C(100, 97) = C(100, 3) = 161,700 is much faster to compute using r = 3.

Pascal's triangle is a triangular array where each entry is a binomial coefficient C(n, r). Row n contains C(n, 0), C(n, 1), ..., C(n, n). Each entry equals the sum of the two entries above it: C(n, r) = C(n-1, r-1) + C(n-1, r). This recursive relationship, combined with the boundary conditions C(n, 0) = C(n, n) = 1, generates the entire triangle. It appears in algebra (binomial expansion), probability (binomial distribution), and number theory (divisibility patterns).

This calculator supports n up to 170. Beyond 170, the factorial exceeds the range of standard floating-point numbers (170! ≈ 7.26 × 10³⁰⁶, while the maximum double-precision float is about 1.8 × 10³⁰⁸). The log-gamma approach provides accurate results within this range. For larger values, the log₁₀ output remains meaningful even when the actual count is astronomically large. For exact integer arithmetic with very large n, specialized arbitrary-precision libraries are needed.

Combinations are the foundation of counting-based probability. To find P(event), compute (favorable combinations)/(total combinations). Examples: P(flush in poker) = C(4,1)×C(13,5) / C(52,5); P(exactly k successes in n trials) = C(n,k)×p^k×(1-p)^(n-k) (binomial distribution). Whenever you need to count "how many ways" something can happen without caring about order, combinations are the right tool.

The multinomial coefficient generalizes combinations to more than two groups. It counts the ways to divide n items into groups of sizes k₁, k₂, ..., kₘ where k₁+k₂+...+kₘ = n. The formula is n!/(k₁!×k₂!×...×kₘ!). For example, distributing 12 books into groups of 4, 4, and 4 gives 12!/(4!×4!×4!) = 34,650 ways. The binomial coefficient C(n,r) is the special case with two groups of sizes r and n-r.

Sources & Methodology

Graham, R.L., Knuth, D.E., & Patashnik, O. (2004). Concrete Mathematics (2nd ed.). Addison-Wesley. Rosen, K.H. (2019). Discrete Mathematics and Its Applications (8th ed.). McGraw-Hill. Abramowitz, M. & Stegun, I. (1964). Handbook of Mathematical Functions. Dover.
R

Roboculator Team

The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.

How helpful was this calculator?

Be the first to rate!

Related Calculators

Lottery Odds Calculator

Probability Calculators

Probability Calculator

Probability Calculators

Conditional Probability Calculator

Probability Calculators

Monty Hall Problem Calculator

Probability Calculators

Permutations Calculator (nPr)

Probability Calculators

Combinations with Replacement Calculator

Probability Calculators