Calculate the number of combinations (nCr) for choosing r items from n, where order does not matter.
A combination is a selection of items from a larger set where the order of selection does not matter. If you're choosing 3 people for a committee from a group of 10, the committee {Alice, Bob, Carol} is exactly the same as {Carol, Alice, Bob} — the order of selection is irrelevant, only the final group matters. The formula C(n,r) = n! / (r! × (n-r)!) counts exactly these unordered selections.
The key distinction from permutations is order. For combinations: choosing tomato, lettuce, and cheese on a sandwich is the same as choosing cheese, lettuce, and tomato. For permutations: the combination 1-2-3 on a lock is different from 3-2-1. When order matters, use permutations. When only the selection matters, use combinations.
The formula n! / (r! × (n-r)!) makes intuitive sense when broken down. n! counts all possible ordered arrangements of all n items. Dividing by r! removes the overcounting from the r items being selected (since their internal order doesn't matter). Dividing by (n-r)! removes the overcounting from the items not selected. What remains is the count of unique unordered selections of size r.
For example, C(5,2): there are 5! = 120 ways to arrange 5 things in order. We're choosing 2, and their order doesn't matter (divide by 2! = 2), and the remaining 3 items aren't selected (divide by 3! = 6). Result: 120 / (2 × 6) = 10. Check: from {A,B,C,D,E}, the 10 pairs are AB, AC, AD, AE, BC, BD, BE, CD, CE, DE. Correct.
Pascal's Triangle is a triangular array where each number is the sum of the two numbers above it. The nth row (starting from row 0) contains the binomial coefficients C(n,0), C(n,1), C(n,2), ..., C(n,n). The fourth row (1, 4, 6, 4, 1) gives C(4,0)=1, C(4,1)=4, C(4,2)=6, C(4,3)=4, C(4,4)=1.
Pascal's Triangle reveals a beautiful property: C(n,r) + C(n,r+1) = C(n+1,r+1). This allows computation of larger combinations from smaller ones without calculating large factorials, and underlies many recursive algorithms in computer science.
Lottery: in a 6/49 lottery where 6 numbers are drawn from 1-49, the number of possible tickets is C(49,6) = 13,983,816. The probability of winning is approximately 1 in 14 million. Poker: the number of distinct 5-card poker hands from a 52-card deck is C(52,5) = 2,598,960. Genetics: when two parents each carry two alleles at a gene, the possible offspring genotypes are combinations of these alleles. Drug trials: choosing which patients receive treatment in a clinical trial uses combinations to ensure representative, unbiased selection.