BY: Statistics Fundamentals Team
Reviewed By: Minsa A (Senior Statistics Editor)

Combination Calculator

Calculate C(n,r) — the number of ways to choose r items from n items when order does not matter. Enter n and r to get the exact combination count, the full formula with your values substituted in, and a step-by-step solution. No signup required.

nCr — Combination Calculator

Formula C(n,r) = n! / [r!(n−r)!] Condition Order does not matter
Non-negative integer. Must be ≥ r.
Non-negative integer. Cannot exceed n.

Quick Examples

Method Multiplicative algorithm — avoids large factorials

Enter n and r in the Calculate tab first, then return here for full working.

Formula C(n+r−1, r) When Same item may be chosen again
Number of distinct types available.
How many items you select (can repeat).
When to use this formula Use C(n+r−1, r) only when repetition is explicitly allowed — for example, choosing 3 flavours of ice cream from 5 options when the same flavour may appear more than once. This is a different problem from standard combinations without repetition. Do not use this formula when items cannot be repeated.

What Is a Combination?

A combination is a selection of r objects chosen from n distinct objects where the order of selection does not matter. Two selections that contain the same objects in different order count as one combination. The total number of such selections is C(n,r), read as "n choose r" or "nCr."

Suppose you have five students — A, B, C, D, E — and you need to pick two to represent the class. The group {A, B} is identical to the group {B, A}; the order in which you named them is irrelevant. There are C(5,2) = 10 such groups. Combinations appear throughout discrete mathematics, probability, and statistics because counting without regard to order prevents double-counting arrangements of the same underlying group.

Concrete distinction: Choosing three people to sit on a committee is a combination — {Alice, Bob, Carol} is the same committee regardless of who is named first. Assigning those three people to President, Secretary, and Treasurer is a permutation — who gets which title matters.

According to the Wolfram MathWorld reference, combinations are among the foundational objects of combinatorics and appear directly in the binomial theorem, Pascal's triangle, and probability theory.

The Combination Formula — nCr

The standard combination formula is:

C(n, r) = n! / [r! × (n − r)!]

Where n is the total number of objects, r is the number selected, and ! denotes factorial. The formula divides the number of ordered selections (permutations) by r! — the number of ways to arrange the selected items — because all those arrangements represent the same unordered group.

Table: Variables in the Combination Formula

SymbolNameMeaning
nPopulation sizeTotal number of distinct objects available
rSample sizeHow many objects are selected
n!n factorialn × (n−1) × … × 2 × 1    (0! = 1 by definition)
r!r factorialCounts the arrangements of the chosen items; dividing by it removes order
(n−r)!Complement factorialAccounts for the unchosen items
C(n,r)CombinationNumber of distinct r-element subsets of an n-element set

How to Calculate Combinations Step by Step

To calculate C(10, 3): write the formula, substitute the values, simplify the factorials, and divide. Here is the full method.

1
Identify n and r

n = 10 (total items), r = 3 (items selected). Check that r ≤ n. Both are non-negative integers.

2
Write the formula

C(10, 3) = 10! / [3! × (10 − 3)!] = 10! / (3! × 7!)

3
Cancel common factors to simplify

10! / 7! = 10 × 9 × 8 (the 7! cancels). So C(10,3) = (10 × 9 × 8) / 3!

4
Compute the numerator and denominator

Numerator: 10 × 9 × 8 = 720. Denominator: 3! = 3 × 2 × 1 = 6.

5
Divide to get the result

C(10, 3) = 720 / 6 = 120. There are 120 ways to choose 3 items from 10 when order does not matter.

Result: C(10, 3) = 120. You can verify this instantly in the calculator above.

Calculating Combinations Without Full Factorials

Computing n! directly for large n produces enormous numbers, most of which cancel in the final division. A more practical method uses the multiplicative form:

C(n, r) = [n × (n−1) × … × (n−r+1)] / r!

This multiplies only r terms in the numerator. To reduce arithmetic further, use the symmetry identity C(n,r) = C(n, n−r) and compute whichever has the smaller r value. For C(52, 49), for example, it is far easier to compute C(52, 3) = (52 × 51 × 50) / 6 = 22,100 than to work with 49-term products.

Example — C(20, 5) by the multiplicative method:
Numerator: 20 × 19 × 18 × 17 × 16 = 1,860,480
Denominator: 5! = 120
C(20, 5) = 1,860,480 / 120 = 15,504

Factorials and Why 0! = 1

The factorial of n, written n!, equals the product of all positive integers from 1 to n. By definition, 0! = 1.

Factorial Reference Table

nn!Expansion
01By definition
111
222 × 1
363 × 2 × 1
4244 × 3 × 2 × 1
51205 × 4 × 3 × 2 × 1
67206 × 5 × 4 × 3 × 2 × 1
75,0407!
103,628,80010!
202,432,902,008,176,640,00020!

The value 0! = 1 preserves the identity C(n,0) = n! / [0! × n!] = 1, which is correct: there is exactly one way to choose nothing from any set. Without this convention, the combination formula would be undefined at r = 0 and r = n, breaking two important special cases.

The Symmetry Property: C(n,r) = C(n,n−r)

Every combination has a mirror image: C(n,r) = C(n,n−r) for all valid n and r. Choosing 3 items to include from 10 is equivalent to choosing the 7 items to exclude. Both problems produce the same count: 120.

Proof:
C(n, n−r) = n! / [(n−r)! × (n−(n−r))!]
            = n! / [(n−r)! × r!]
            = C(n, r)     ■

This identity has a practical use beyond its elegance. When r is large relative to n, compute C(n, n−r) instead, since the smaller value reduces the number of multiplication steps required. C(100, 97) is far easier to compute as C(100, 3) = 161,700.

Special Cases of C(n, r)

Table: Special Cases and Their Values

CaseFormulaValueInterpretation
r = 0C(n, 0) = n! / (0! × n!)1Exactly one way to choose nothing
r = nC(n, n) = n! / (n! × 0!)1Exactly one way to choose everything
r = 1C(n, 1) = n! / (1! × (n−1)!)nn ways to pick a single item
r = n−1C(n, n−1) = n! / ((n−1)! × 1!)nn ways to leave exactly one item out
r = 2C(n, 2) = n(n−1)/2n(n−1)/2Pairs from n objects
r > nUndefined (standard)0Cannot choose more than the total available

Combinations vs. Permutations — The Core Difference

Combinations and permutations both count selections, but permutations treat different arrangements of the same items as distinct outcomes, whereas combinations do not. The relationship is: C(n,r) = P(n,r) / r!. Every set of r items has r! possible orderings, so dividing the permutation count by r! collapses all those orderings into a single combination.

Table: Combinations vs. Permutations — Formula and Key Distinction

PropertyCombinationPermutation
Order matters?NoYes
FormulaC(n,r) = n! / [r!(n−r)!]P(n,r) = n! / (n−r)!
C(10,3) / P(10,3)120720
RatioC(n,r) = P(n,r) / r!P(n,r) = C(n,r) × r!
Typical question"How many groups?""How many arrangements?"

Table: Scenario Decision Guide — Combination or Permutation?

ScenarioTypeReason
Choose 3 committee members from 10CombinationOnly membership matters, not title or order
Award gold, silver, and bronze medalsPermutationEach position is distinct
Deal a 5-card poker hand from 52CombinationThe hand is defined by which cards it contains, not the dealing order
Arrange 5 books on a shelfPermutationEvery ordering is a different arrangement
Select 4 students for a project teamCombinationRoles are identical — only membership matters
Assign 4 students to 4 named rolesPermutationEach student gets a specific, distinguishable role
Choose 6 lottery numbers from 49CombinationThe ticket wins regardless of number order
Create a 4-digit PIN (digits may repeat)Permutation with repetitionOrder of digits determines the PIN

Where the Formula Comes From

The combination formula is derived from the permutation formula. The number of ordered selections of r objects from n is:

P(n, r) = n! / (n − r)!

Each unordered group of r items corresponds to exactly r! ordered arrangements of those same r items. So the count of unordered groups is:

C(n, r) = P(n, r) / r! = [n! / (n−r)!] / r! = n! / [r! × (n−r)!]

For C(5,2): P(5,2) = 5 × 4 = 20 ordered pairs. Each pair appears in 2! = 2 orders ({A,B} and {B,A}). So C(5,2) = 20 / 2 = 10. This is the central insight: combinations prevent the double-counting that permutations include.

Combination with Repetition

When the same item may be selected more than once, the formula changes to C(n+r−1, r), also called the multiset coefficient or "stars and bars." This counts the number of ways to choose r items from n types when any type may appear multiple times.

Combinations with repetition = C(n + r − 1, r)
Example: An ice cream parlour offers 5 flavours. You order 3 scoops and can repeat a flavour. How many distinct orders are possible?

n = 5 (flavours), r = 3 (scoops selected)
C(5 + 3 − 1, 3) = C(7, 3) = 7! / (3! × 4!) = 35

There are 35 distinct combinations with repetition.

This is a fundamentally different calculation from C(5,3) = 10, which counts selections where each flavour appears at most once. Use the With Repetition tab in the calculator above for this formula. Do not confuse the two: the standard nCr formula applies only when items cannot be reused.

Pascal's Triangle and Combinations

Every entry in Pascal's triangle is a combination value. Row n, position r (starting from zero) equals C(n,r). Each interior entry obeys Pascal's identity: C(n,r) = C(n−1, r−1) + C(n−1, r).

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

Highlighted cells: C(5,2)=10 and C(5,3)=10 illustrate the symmetry identity.

Row 5 reads: C(5,0)=1, C(5,1)=5, C(5,2)=10, C(5,3)=10, C(5,4)=5, C(5,5)=1. The symmetry C(n,r)=C(n,n−r) is visible in the mirror structure of each row. The sum of row n equals 2n, representing the total number of subsets of an n-element set.

Combinations and the Binomial Theorem

Combination values are the coefficients in binomial expansions. The binomial theorem states:

(a + b)n = C(n,0)anb0 + C(n,1)an−1b1 + … + C(n,n)a0bn
Example — (a + b)3:
= C(3,0)a3 + C(3,1)a2b + C(3,2)ab2 + C(3,3)b3
= 1·a3 + 3·a2b + 3·ab2 + 1·b3

This is why combinations are also called binomial coefficients. The notation nCr, C(n,r), Crn, and the parenthesised form all refer to the same value. The connection between combinations and polynomial algebra makes the combination formula one of the most cross-disciplinary results in mathematics.

How Combinations Are Used in Probability

Combinations count the total number of equally likely outcomes and the number of favourable outcomes, so the probability of an event is often a ratio of two combination values.

P(event) = (favourable combinations) / (total combinations)

Table: Probability Examples Using Combinations

ProblemTotal outcomesFavourableProbability
5-card hand from 52 cardsC(52,5) = 2,598,960C(4,1) for four aces and one other = 48 (approx.)Very small
6 numbers from 49 (lottery)C(49,6) = 13,983,8161 (the single winning combination)1 / 13,983,816
3 defectives from batch of 20 (4 defective)C(20,3) = 1,140C(4,3) = 44/1,140 ≈ 0.0035

Combinations in Binomial Probability

The binomial probability formula uses C(n,k) directly:

P(X = k) = C(n,k) × pk × (1−p)n−k

C(n,k) counts the number of distinct ways k successes can occur among n independent Bernoulli trials. For example, if p = 0.3 and n = 10, the probability of exactly 3 successes is C(10,3) × 0.33 × 0.77 = 120 × 0.027 × 0.0824 ≈ 0.267. The binomial distribution page on Statistics Fundamentals covers this formula with full worked examples.

Combinations in the Hypergeometric Distribution

When sampling without replacement from a finite population, combinations govern the hypergeometric distribution:

P(X = k) = C(K, k) × C(N−K, n−k) / C(N, n)

Where N is the population size, K is the number of successes in the population, n is the sample size, and k is the number of successes observed. Each term in the numerator and denominator is a combination count.

15 Worked Examples

1. C(5, 2) — Choosing Students

Given: n=5 students {A,B,C,D,E}, r=2 chosen.
C(5,2) = 5! / (2! × 3!) = 120 / (2 × 6) = 120 / 12 = 10
The 10 pairs: AB, AC, AD, AE, BC, BD, BE, CD, CE, DE.

2. C(10, 3) — Committee Selection

Given: n=10, r=3.
C(10,3) = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120
There are 120 ways to form a 3-person committee from 10 candidates.

3. C(20, 5) — Survey Sampling

Given: n=20, r=5.
C(20,5) = (20 × 19 × 18 × 17 × 16) / 5! = 1,860,480 / 120 = 15,504

4. C(52, 5) — Poker Hands

Given: standard 52-card deck, 5-card hand.
C(52,5) = 52! / (5! × 47!) = (52 × 51 × 50 × 49 × 48) / 120
= 311,875,200 / 120 = 2,598,960
There are over 2.5 million distinct poker hands.

5. C(49, 6) — Lottery Combinations

Given: Choose 6 numbers from 49 (6/49 lottery).
C(49,6) = 13,983,816
The probability of matching all 6 numbers with one ticket is 1 in 13,983,816.

6. C(100, 4) — Large n

C(100,4) = (100 × 99 × 98 × 97) / 4!
= 94,109,400 / 24 = 3,921,225

7. Symmetry Check — C(10,3) vs C(10,7)

C(10,3) = 120 and C(10,7) = 120.   They are equal by the symmetry identity.
To verify: C(10,7) = 10! / (7! × 3!) = same denominator as C(10,3) rearranged. ✓

8. Special Case — C(8, 0)

C(8,0) = 8! / (0! × 8!) = 1 / 1 = 1
There is exactly one way to choose no items from any collection.

9. Special Case — C(8, 8)

C(8,8) = 8! / (8! × 0!) = 1   ✓
There is exactly one way to choose all 8 items from 8.

10. Binomial Probability — Exactly 2 Heads in 6 Flips

P(X=2) = C(6,2) × (0.5)2 × (0.5)4
= 15 × 0.25 × 0.0625 = 15 × 0.015625 = 0.234375 (about 23.4%)

11. Combination with Repetition — Ice Cream

5 flavours, 3 scoops with repetition allowed.
C(5+3−1, 3) = C(7,3) = 7! / (3! × 4!) = 5040 / 144 = 35

12. Card Probability — Probability of a Flush

Total 5-card hands: C(52,5) = 2,598,960
Flush hands (5 cards of same suit): 4 × C(13,5) = 4 × 1,287 = 5,148
P(flush) = 5,148 / 2,598,960 ≈ 0.00198 (about 0.2%)

13. Pascal's Identity Check — C(6,2) = C(5,1) + C(5,2)

C(5,1) + C(5,2) = 5 + 10 = 15 = C(6,2).   ✓
This is Pascal's recursion: each entry is the sum of the two entries above it.

14. Hypergeometric Probability — Quality Control

Batch: N=20, K=4 defective. Sample n=3. P(exactly 1 defective):
= C(4,1) × C(16,2) / C(20,3)
= 4 × 120 / 1,140 = 480 / 1,140 ≈ 0.421

15. Combination vs Permutation Comparison

Choose 3 officers from 8 candidates with distinct roles (President, VP, Treasurer):
P(8,3) = 8 × 7 × 6 = 336 (order matters — different officer assignment)

Choose 3 committee members from 8 (no roles):
C(8,3) = 336 / 6 = 56 (order irrelevant)

Common Mistakes with Combinations

Table: Common Errors and How to Avoid Them

MistakeExampleCorrection
Using permutation when order does not matterCounting committee arrangements with P(n,r)Use C(n,r); only membership counts
Forgetting that 0! = 1Treating C(n,0) as undefined0! = 1 by definition; C(n,0) = 1
Entering r > nC(3, 5)r cannot exceed n; the calculator returns an error
Using decimals for n or rC(5.5, 2)Both must be non-negative integers
Using the repetition formula when repetition is not allowedC(n+r−1,r) for a lotteryUse C(n,r); lottery tickets cannot repeat numbers
Confusing C(n,r) with P(event)Saying "C(49,6) is the probability of winning"C(49,6) is the count of outcomes; P = 1/C(49,6)
Swapping n and rEntering C(3,10) instead of C(10,3)n must be the larger value; r ≤ n
Forgetting to divide by r!Stopping at the permutation countAlways divide P(n,r) by r! to get the combination

Combinations in Excel, Python, and R

Excel and Google Sheets

Excel and Google Sheets provide two distinct combination functions. Use the right one for each problem.

Table: COMBIN vs COMBINA

FunctionSyntaxWhat it computesFormula
COMBIN=COMBIN(n, r)Standard combinations (no repetition)C(n,r) = n!/[r!(n-r)!]
COMBINA=COMBINA(n, r)Combinations with repetitionC(n+r-1, r)
=COMBIN(10, 3) ' Returns 120 =COMBINA(5, 3) ' Returns 35 (with repetition) =COMBIN(52, 5) ' Returns 2,598,960 (poker hands) =COMBIN(49, 6) ' Returns 13,983,816 (lottery)

Python

Python's standard library provides math.comb() (Python 3.8+), which returns exact integer results.

import math # Standard combination — exact integer print(math.comb(10, 3)) # 120 print(math.comb(52, 5)) # 2598960 print(math.comb(49, 6)) # 13983816 print(math.comb(100, 4)) # 3921225 # Combination with repetition def comb_with_rep(n, r): return math.comb(n + r - 1, r) print(comb_with_rep(5, 3)) # 35

R

R provides choose(n, r) for combinations and lchoose(n, r) for the log of the binomial coefficient when results are very large.

choose(10, 3) # 120 choose(52, 5) # 2598960 choose(49, 6) # 13983816 # Log-combination for very large values lchoose(100, 50) # log(C(100,50)) without overflow

Quick Reference: What Every Learner Should Know About Combinations

ConceptFormula / ValuePlain English
CombinationC(n,r) = n!/[r!(n-r)!]Count of r-element subsets of an n-element set; order ignored
nTotal objectsThe size of the pool you are choosing from
rObjects selectedHow many you pick; must satisfy 0 ≤ r ≤ n
Factorialn! = n×(n-1)×…×1The product of all positive integers from 1 to n; 0!=1
SymmetryC(n,r) = C(n,n-r)Choosing 3 to include equals choosing 7 to exclude (if n=10)
From permutationsC(n,r) = P(n,r)/r!Divide ordered selections by the number of orderings of each group
Pascal's identityC(n,r)=C(n-1,r-1)+C(n-1,r)Each row of Pascal's triangle is built from the row above
Binomial coefficientCoefficient of xr in (1+x)nSame number appears in binomial expansions
Probability useP = C(favourable) / C(total)Ratio of combination counts when outcomes are equally likely
With repetitionC(n+r-1, r)Use only when the same item may be selected multiple times
Binomial probabilityC(n,k)pk(1-p)n-kC(n,k) counts the arrangements of k successes in n trials
Excel=COMBIN(n,r)Returns the standard combination value; =COMBINA for repetition
Pythonmath.comb(n,r)Exact integer result, no overflow (Python 3.8+)
Rchoose(n,r)Standard combinations; lchoose for log-scale large values

Related Calculators and Guides on Statistics Fundamentals

Combinations connect to probability, counting, and distribution theory throughout statistics.

External references: For further reading, the Wolfram MathWorld article on Combinations covers the mathematical definition and properties in detail. The NIST Engineering Statistics Handbook discusses combinatorial methods in the context of designed experiments. OpenStax Statistics provides free, peer-reviewed coverage of the hypergeometric distribution and its connection to combinations.

Frequently Asked Questions

A combination is a selection of r items from a set of n distinct items where the order of selection does not matter. The number of combinations is given by C(n,r) = n! / [r!(n−r)!], also written nCr or "n choose r." Choosing {A,B} from {A,B,C} is the same combination as {B,A}; only the membership of the group matters, not the order in which members were named.

The combination formula is C(n,r) = n! / [r!(n−r)!], where n is the total number of objects, r is the number selected, and ! denotes factorial. For C(10,3): 10! / (3! × 7!) = 3,628,800 / (6 × 5,040) = 3,628,800 / 30,240 = 120. The calculator above performs this calculation instantly and shows each step.

Combinations count unordered selections; permutations count ordered arrangements. C(n,r) = n!/[r!(n−r)!] counts groups. P(n,r) = n!/(n−r)! counts arrangements. For n=10, r=3: C(10,3) = 120 unordered groups, P(10,3) = 720 ordered arrangements. The relationship is C(n,r) = P(n,r)/r!, because each group of r items can be arranged in r! different orders.

nCr (also written C(n,r), nCr, or "n choose r") is the number of combinations of r items chosen from n items without regard to order. It equals n!/[r!(n−r)!] and is also called the binomial coefficient because it appears as the coefficient of xr in the binomial expansion of (1+x)n.

No. In standard combinations without repetition, r cannot exceed n because (n−r)! would require the factorial of a negative integer, which is undefined. If you enter r > n into this calculator, it will display an error message. C(n,r) is defined as 0 by convention when r > n, though this case is typically excluded from practical use.

0! = 1 by mathematical convention, chosen to maintain consistency across factorial-based formulas. With 0! = 1, the combination formula gives C(n,0) = n!/(0! × n!) = 1 (correct: one way to choose nothing) and C(n,n) = n!/(n! × 0!) = 1 (correct: one way to choose everything). Without this definition, the formula would fail at these important boundary cases.

The symmetry identity states that choosing r items to include is equivalent to choosing the (n−r) items to exclude. Both operations produce the same number of distinct groups. C(10,3) = C(10,7) = 120 because every 3-element subset defines a unique 7-element complement and vice versa. Practically, this lets you compute C(100,97) as C(100,3) = 161,700, which is far simpler.

Combination with repetition (also called the multiset coefficient or "stars and bars") counts selections where the same item type may appear more than once. The formula is C(n+r−1, r). Choosing 3 scoops of ice cream from 5 flavours where the same flavour can repeat gives C(7,3) = 35. This is distinct from the standard C(5,3) = 10 which assumes no flavour repeats. Always clarify whether repetition is permitted before applying a formula.

Row n of Pascal's triangle lists C(n,0), C(n,1), …, C(n,n) from left to right. Row 5 is 1, 5, 10, 10, 5, 1, corresponding to C(5,0) through C(5,5). Each interior entry satisfies Pascal's identity: C(n,r) = C(n−1,r−1) + C(n−1,r), meaning each number is the sum of the two above it. The sum of all entries in row n equals 2n.

Combinations count equally likely outcomes, so probability problems involving unordered selections use the ratio: P(event) = (favourable combinations) / (total combinations). Lottery odds use C(49,6) as the denominator. The binomial probability formula P(X=k) = C(n,k)pk(1−p)n−k uses C(n,k) to count the number of ways k successes can occur in n trials. The hypergeometric distribution uses a ratio of three combination values to model sampling without replacement.

C(5,2) = 5! / (2! × 3!) = (5 × 4) / (2 × 1) = 20 / 2 = 10. Using the multiplicative shortcut: multiply the top 2 values of 5! in the numerator (5 × 4 = 20) and divide by 2! = 2. The result is 10 distinct pairs from five objects.

The binomial coefficient is another name for C(n,r). The term comes from the binomial theorem: when you expand (a+b)n, the coefficient of an-rbr is C(n,r). For example, (a+b)4 = 1a4 + 4a3b + 6a2b2 + 4ab3 + 1b4, where the coefficients 1, 4, 6, 4, 1 are C(4,0) through C(4,4).

The multiplicative formula avoids computing full factorials: C(n,r) = [n × (n−1) × … × (n−r+1)] / r!. Only r terms appear in the numerator. For large values, first apply symmetry to ensure r ≤ n/2, then use this product. This is exactly the method the calculator uses internally to produce exact integer results efficiently.

C(52,5) = 2,598,960 distinct 5-card hands. Combinations are used rather than permutations because the final hand is the same regardless of the order cards were dealt. This is the denominator in most poker probability calculations. You can verify this using the C(52,5) quick example button in the calculator above.

C(49,6) = 13,983,816. Using the multiplicative method: (49 × 48 × 47 × 46 × 45 × 44) / 6! = 10,068,347,520 / 720 = 13,983,816. Each six-number selection from 49 numbers is one distinct ticket. The probability that one ticket matches the winning combination is exactly 1 in 13,983,816.