Math

Combination Calculator

Calculate combinations C(n,r) — the number of ways to choose r items from n items where order does not matter.

Quick Answer

C(n,r) = n! / (r! × (n−r)!). For example, C(5,2) = 5! / (2! × 3!) = 120 / (2 × 6) = 10 ways.

Enter Values

Examples:

Results

Enter n and r values (r ≤ n, n ≤ 170) to calculate combinations.

About This Tool

The Combination Calculator computes C(n,r), also written as “n choose r” — the number of ways to select r items from a set of n items when the order of selection does not matter. This is one of the fundamental concepts in combinatorics and probability theory.

The Combination Formula

C(n,r) = n! / (r! × (n−r)!), where n! (n factorial) is the product of all positive integers up to n. The denominator removes duplicate arrangements because combinations treat (A,B) and (B,A) as the same selection. This is what distinguishes combinations from permutations, where order matters.

Combinations vs. Permutations

Combinations count groups. Permutations count arrangements. Choosing 3 people from 10 for a committee is a combination (C(10,3) = 120). Choosing a president, VP, and treasurer from 10 is a permutation (P(10,3) = 720). The permutation count is always larger because it treats each ordering as distinct.

Real-World Examples

Lottery odds use combinations. A 6/49 lottery has C(49,6) = 13,983,816 possible combinations. Poker hands use C(52,5) = 2,598,960. Sports brackets, sampling methods, and genetic combinations all rely on this formula. Understanding combinations helps you calculate probabilities and make better decisions.

Computational Limits

Factorials grow extremely fast. 170! is approximately 7.26 × 10^306, which is near the limit of JavaScript floating-point precision. For values of n above 170, the result overflows. This calculator handles values up to n = 170 accurately.

Frequently Asked Questions

What is C(n,r) in simple terms?
C(n,r) tells you how many ways you can pick r things from n things when order doesn't matter. Picking cards A,B,C is the same as picking C,B,A — both count as one combination.
When do I use combinations instead of permutations?
Use combinations when order doesn't matter (choosing team members, lottery numbers, card hands). Use permutations when order matters (rankings, passwords, seating arrangements).
What is the combination formula?
C(n,r) = n! / (r! × (n−r)!). The n! counts all arrangements, and dividing by r! × (n−r)! removes the duplicate orderings.
What does C(n,0) equal?
C(n,0) = 1 for any n. There is exactly one way to choose nothing from a set: choose nothing. Similarly, C(n,n) = 1 because there is one way to choose everything.
How are lottery odds calculated?
Lottery odds use the combination formula. For a 6/49 lottery, the odds are 1 in C(49,6) = 13,983,816. For Powerball with 5 from 69 plus 1 from 26, it's C(69,5) × 26 = 292,201,338.

Was this tool helpful?