Combinations Calculator
Calculate the number of combinations C(n, r)
Enter n (total items) and r (items chosen) to find how many unique groups of r can be selected from n, where order does not matter.
Combinations explained: choosing without caring about order
A combination is a selection of items from a larger set where the order of selection does not matter. If you are choosing 3 people from a group of 10 to sit on a committee, it does not matter whether Alice was picked first or third — the group is the same either way. Combinations count these distinct groups. The notation C(n, r) or "n choose r" represents the number of ways to choose r items from n items without regard to order.
The formula is C(n, r) = n! / (r! x (n - r)!), where the exclamation mark denotes a factorial (the product of all positive integers up to that number). For example, C(10, 3) = 10! / (3! x 7!) = (10 x 9 x 8) / (3 x 2 x 1) = 720 / 6 = 120. There are 120 different committees of 3 that can be formed from 10 people.
This calculator uses logarithms of factorials internally to handle large numbers accurately. Direct factorial multiplication overflows standard floating-point numbers for n much above 170, but taking the sum of logarithms and exponentiating back gives the result without overflow for a much wider range of inputs. Results above 10^15 are shown in scientific notation to keep the display readable.
Combinations appear in many practical and theoretical situations: lottery odds (choosing 6 numbers from 49), hand rankings in card games (choosing 5 cards from 52), sampling problems in statistics (choosing survey respondents), network design (choosing node pairs to connect), and combinatorial proofs in mathematics. Knowing C(n, r) quickly removes the need to list and count all possibilities manually, which becomes impractical very quickly as n grows.
Combinations versus permutations: the key difference
Combinations and permutations are closely related but answer different questions. Permutations count arrangements where order matters. Combinations count selections where order does not matter. The relationship is: C(n, r) = P(n, r) / r!. For any given n and r, the permutation count is always at least as large as the combination count (and equal only when r = 0 or r = 1). When r = 3, each combination corresponds to 3! = 6 different permutations, so dividing the permutation count by 6 gives the combination count.
To decide which one applies to your problem, ask: does swapping the order of selected items produce a different result? For a committee, no — the same 3 people form the same committee regardless of who was picked first. For a race podium, yes — first, second, and third place are distinct. The former is a combination problem; the latter is a permutation problem.
Important constraints and edge cases
Several edge cases have clean mathematical results. C(n, 0) = 1 for any n: there is exactly one way to choose nothing. C(n, n) = 1: there is exactly one way to choose all items. C(n, 1) = n: choosing one item from n gives n possibilities. The values are symmetric: C(n, r) = C(n, n - r), so C(10, 3) = C(10, 7) = 120. This symmetry arises because choosing r items to include is equivalent to choosing n - r items to exclude. This calculator checks that r does not exceed n, since choosing more items than exist is not possible.