Combination Calculator (nCr)
Calculate C(n,r) — ways to choose r items from n when order doesn't matter.
Results
Combinations: When Order Doesn't Matter
A combination counts the number of ways to select r items from a group of n items when the order of selection doesn't matter. The combination formula C(n,r) is one of the most fundamental formulas in discrete mathematics and probability.
The Formula
C(n, r) = n! / (r! × (n − r)!). Where n! (n factorial) = n × (n−1) × (n−2) × … × 1. For example, C(10,3) = 10!/(3!×7!) = (10×9×8)/(3×2×1) = 720/6 = 120. This can be simplified by canceling the (n−r)! portion from the numerator before multiplying.
Combinations vs. Permutations
The key difference: combinations ignore order, permutations count it. Choosing 3 people for a committee from 10 is a combination (the group {A,B,C} is the same as {C,A,B}). Assigning 3 different roles (President, VP, Treasurer) to those 10 people is a permutation. P(n,r) = C(n,r) × r!, so permutations are always at least as large as combinations.
Pascal's Triangle
Combinations form Pascal's Triangle: each number equals the sum of the two directly above it. The nth row contains C(n,0), C(n,1), …, C(n,n). Row 5: 1, 5, 10, 10, 5, 1. These numbers appear in the binomial expansion (a+b)^n and the probability of k successes in n independent trials.
Real-World Applications
Lottery odds (choosing 6 numbers from 49: C(49,6) = 13,983,816), committee selection, poker hands (C(52,5) = 2,598,960 possible hands), survey sampling, and drug trial design all rely on combination calculations.
Worked Example: Poker Hands
A standard deck has 52 cards. A hand of 5 cards is drawn. How many distinct hands exist? C(52,5) = 52! / (5! × 47!) = (52×51×50×49×48) / (5×4×3×2×1) = 311,875,200 / 120 = 2,598,960. Of these, only 4 are royal flushes, making the probability just 4/2,598,960 ≈ 0.000154%.
Combinations vs. Permutations: Quick Comparison
| Scenario | Formula | n=10, r=3 |
|---|---|---|
| Choose 3 team members from 10 (order irrelevant) | C(n,r) = n!/(r!(n-r)!) | 120 |
| Assign 1st, 2nd, 3rd place from 10 (order matters) | P(n,r) = n!/(n-r)! | 720 |
| Ratio P to C | r! = 3! = 6 | 720 ÷ 120 = 6 |
Frequently Asked Questions
A combination is a selection of items where order does NOT matter. C(n,r) = n! / (r! × (n−r)!) counts the ways to pick r items from n. Choosing 2 flavors from 5 ice cream options: C(5,2) = 10.
C(5,2) = 5! / (2! × 3!) = (5×4) / (2×1) = 10. There are 10 distinct pairs you can form from 5 items.
Combinations: order doesn't matter (team selection). Permutations: order matters (rankings, codes). P(n,r) = C(n,r) × r! — permutations multiply combinations by the number of orderings of the selected items.
Both equal 1. C(n,0) = 1: there's exactly one way to choose nothing. C(n,n) = 1: there's exactly one way to choose all items.
P(exactly k successes in n trials) = C(n,k) × p^k × (1−p)^(n−k). Combinations count how many of the total outcomes have exactly k successes.
C(52,5) = 2,598,960 — the total number of 5-card hands from a standard 52-card deck. Every poker hand probability is calculated by dividing the number of ways to make that hand by 2,598,960.
No. You cannot choose more items than exist in the set. If r > n, C(n,r) = 0 — there are zero ways to choose more items than available. The formula also breaks down since (n−r)! would involve a negative factorial.