Combinations Calculator
Result:
Calculate combinations C(n,r) with our free online calculator. Perfect for selection problems, probability calculations, and situations where order doesn't matter.
What are Combinations?
Combinations count the number of ways to choose r items from a set of n items where order doesn't matter. Different orders of the same items are considered the same combination.
Combination Formula
C(n,r) = n! / (r!(n-r)!)
Also written as: (n choose r) or ⁿCᵣ
Symmetry: C(n,r) = C(n,n-r)
Combination Properties
Key Properties
- Order doesn't matter: ABC = BCA
- C(n,0) = 1 (empty selection)
- C(n,1) = n (choose one)
- C(n,n) = 1 (choose all)
- C(n,r) = C(n,n-r) (symmetry)
Relationship to Permutations
- C(n,r) = P(n,r) / r!
- Fewer combinations: Than permutations
- Factor difference: r! times fewer
- Pascal's triangle: Each entry is C(n,r)
- Binomial coefficients: Used in expansions
Step-by-Step Examples
Problem: How many ways to choose 3 people from a group of 5?
Solution: C(5,3) = 5! / (3!(5-3)!) = 5! / (3!2!)
Calculation:
C(5,3) = (5 × 4 × 3 × 2 × 1) / ((3 × 2 × 1) × (2 × 1))
C(5,3) = 120 / (6 × 2) = 120 / 12 = 10
Alternative: C(5,3) = (5 × 4 × 3) / (3 × 2 × 1) = 60 / 6 = 10
Answer: 10 different combinations
Problem: Choose 2 letters from {A, B, C, D}
Formula: C(4,2) = 4! / (2!(4-2)!) = 4!/(2!2!) = 24/(2×2) = 6
All combinations:
- AB (same as BA)
- AC (same as CA)
- AD (same as DA)
- BC (same as CB)
- BD (same as DB)
- CD (same as DC)
Count: 6 combinations
Note: Order doesn't matter, so AB = BA
Problem: Lottery - choose 6 numbers from 49
Formula: C(49,6) = 49! / (6! × 43!)
Efficient calculation:
C(49,6) = (49 × 48 × 47 × 46 × 45 × 44) / (6 × 5 × 4 × 3 × 2 × 1)
C(49,6) = 10,068,347,520 / 720 = 13,983,816
Result: Almost 14 million different combinations!
Probability: 1 in 13,983,816 chance of winning
Common Combination Values
C(n,r) | Value | Description | Common Use |
---|---|---|---|
C(5,2) | 10 | Choose 2 from 5 | Small team selection |
C(6,3) | 20 | Choose 3 from 6 | Committee formation |
C(7,3) | 35 | Choose 3 from 7 | Menu combinations |
C(10,2) | 45 | Choose 2 from 10 | Pairings |
C(10,3) | 120 | Choose 3 from 10 | Project teams |
C(12,4) | 495 | Choose 4 from 12 | Card hands |
C(20,5) | 15,504 | Choose 5 from 20 | Survey samples |
C(52,5) | 2,598,960 | 5-card poker hand | Card games |
Real-World Applications
Games & Probability
- Lottery number selection
- Poker hand probabilities
- Bingo game outcomes
- Raffle ticket combinations
- Board game possibilities
Group Selection
- Team formation
- Committee selection
- Study group creation
- Project partnerships
- Interview panel selection
Science & Research
- Clinical trial design
- Sample selection methods
- Experimental combinations
- Hypothesis testing scenarios
- Data analysis subsets
Combinations vs Permutations Comparison
Aspect | Combinations C(n,r) | Permutations P(n,r) |
---|---|---|
Order matters? | No - ABC = BCA | Yes - ABC ≠ BCA |
Formula | n! / (r!(n-r)!) | n! / (n-r)! |
Result size | Smaller | Larger |
Example C(4,2) | 6 combinations | 12 permutations |
Use cases | Team selection, lottery | Rankings, sequences |
Computational Efficiency
Naive Method
def combination(n, r):
return factorial(n) /
(factorial(r) *
factorial(n-r))
Problem: Large factorials overflow
Use: Small values only
Multiplicative Method
def combination(n, r):
if r > n-r: r = n-r
result = 1
for i in range(r):
result *= (n-i)
result //= (i+1)
return result
Advantage: No large factorials
Use: Most efficient
Pascal's Triangle
def combination(n, r):
# Build Pascal's triangle
# C[i][j] = C[i-1][j-1] +
# C[i-1][j]
# Return C[n][r]
Advantage: Multiple values at once
Use: When computing many C(n,r)
Special Combination Identities
🧮 Mathematical Identities
Basic Identities:
- Symmetry: C(n,r) = C(n,n-r)
- Pascal's identity: C(n,r) = C(n-1,r-1) + C(n-1,r)
- Sum identity: C(n,0) + C(n,1) + ... + C(n,n) = 2ⁿ
- Hockey stick: C(r,r) + C(r+1,r) + ... + C(n,r) = C(n+1,r+1)
Advanced Identities:
- Vandermonde: C(m+n,r) = Σ C(m,k)C(n,r-k)
- Absorption: n × C(n-1,r-1) = r × C(n,r)
- Committee-chairman: r × C(n,r) = n × C(n-1,r-1)
- Inclusion-exclusion: Used for restricted selections
Frequently Asked Questions (FAQ)
Use combinations when order doesn't matter:
- Team selection: Choosing 5 players from 12 (the order you pick doesn't matter)
- Lottery tickets: Numbers 1,2,3,4,5,6 same as 6,5,4,3,2,1
- Committee formation: Selecting members regardless of roles
- Menu choices: Picking 3 toppings from 10 available
- Key question: If rearranging your selection gives the same result, use combinations
This symmetry exists because choosing items is the same as choosing what to leave out:
- Logical reasoning: Choosing 3 from 5 is the same as choosing which 2 to leave out
- Mathematical proof: C(n,r) = n!/(r!(n-r)!) = n!/((n-r)!r!) = C(n,n-r)
- Example: C(10,3) = C(10,7) = 120
- Practical benefit: Always compute the smaller of r or n-r for efficiency
- Pascal's triangle: This symmetry is why the triangle is symmetric
For large combinations, use the multiplicative method to avoid overflow:
- Don't compute factorials directly: 50! is too large for most computers
- Use symmetry: C(50,25) = C(50,25), but C(50,5) = C(50,45) - compute C(50,5)
- Multiplicative formula: C(n,r) = (n×(n-1)×...×(n-r+1)) / (r×(r-1)×...×1)
- Alternate multiply and divide: Prevents intermediate overflow
- Use logarithms: For very large values, work with log(C(n,r))
- Software tools: Mathematical software handles arbitrary precision
Combinations are fundamental to calculating probabilities:
- Basic probability: P(event) = favorable outcomes / total outcomes
- Favorable outcomes: Often calculated using combinations
- Example: Probability of exactly 3 heads in 5 coin flips = C(5,3)/2⁵
- Binomial distribution: P(X=k) = C(n,k) × p^k × (1-p)^(n-k)
- Hypergeometric distribution: Sampling without replacement
- Card probabilities: Poker hands, bridge distributions
Yes! Combinations with repetition have a different formula:
- Standard combinations (this calculator): Each item can be chosen at most once
- With repetition: Items can be chosen multiple times
- Formula with repetition: C(n+r-1,r) = C(n+r-1,n-1)
- Example: Choose 3 candies from 4 types (can repeat): C(4+3-1,3) = C(6,3) = 20
- Applications: Ice cream scoops, pizza toppings with doubles
- Also called: Multiset coefficients or "stars and bars"
Related Calculators
Find Calculator
Popular Calculators
Other Calculators
