Combinations with an exact result, working shown and probability.
A combination counts the ways to choose r elements from a set of n when order does NOT matter: picking Ann and Bob is the same as picking Bob and Ann. Without repetition the count is C(n, r) = n! / (r! · (n − r)!), the binomial coefficient. With repetition (a multiset) it is C(n + r − 1, r). The calculator uses BigInt and a multiplicative product with the symmetry C(n, r) = C(n, n − r), so it never builds giant factorials and returns the exact number up to n = 5000. Beyond C(n,r) it also computes permutations, combinations and permutations with repetition, circular permutations, derangements and anagrams, shows the working with numerator and denominator cancelled, lists every case in order (exportable as TXT and CSV), highlights the row of Pascal's triangle and turns the total into a probability (1 in X and a percentage), with ready-made lottery, poker and password examples.
How to use
Enter n and r, pick the counting type and read the result.
Pick the counting type (Combination C(n,r) is preselected) and enter n, the total number of elements, and r, how many are chosen.
Read the exact result, the step by step working and, beside it, the five results (C, P, CR, PR and the ratio r!) for the same n and r.
Use a ready-made example (Powerball, poker, password), list the cases to download as TXT or CSV, or click Pascal's triangle to change n and r.
The formulas
How C(n,r) and combinations with repetition are computed
Without repetition, C(n, r) = n! / (r! · (n − r)!). Since order does not matter, we divide the permutation count P(n, r) by the r! orderings of each choice: C(n, r) = P(n, r) / r!. In practice the tool multiplies n · (n−1) · … only k times, with k = the smaller of r and n − r, dividing by a growing integer at each step, always exactly.
With repetition, CR(n, r) = C(n + r − 1, r). The idea is "stars and bars": r identical items separated by n − 1 dividers. Here r can be larger than n, which is impossible without repetition.
Choosing 2 people from a group of 5: C(5, 2) = (5 · 4) / (2 · 1) = 10. Choosing 5 cards from a 52-card deck: C(52, 5) = 2,598,960 possible poker hands, of which 4 are royal flushes, that is 1 chance in 649,740.
Powerball: 5 numbers out of 69 plus 1 ball out of 26 give C(69, 5) · 26 = 292,201,338 combinations, so one ticket has a 1 in 292,201,338 chance at the jackpot. Brazil's Mega-Sena (6 of 60) has C(60, 6) = 50,063,860, Quina (5 of 80) has 24,040,016 and Lotofacil (15 of 25) has 3,268,760.
Details and uses
Edge cases and applications
It is always true that C(n, 0) = 1 (one way to choose nothing) and C(n, n) = 1 (one way to choose everything). Without repetition r cannot exceed n. For very large numbers the tool shows the scientific notation and the digit count, and the copy button hands you the whole number.
Combinations show up in probability and lotteries, counting card hands, forming committees and teams, genetics, software testing (pairs and triples of parameters) and in the coefficients of the expansion of (a + b)ⁿ.
C(n, 0) = C(n, n) = 1 and 0! = 1.
Each row of Pascal's triangle adds up to 2ⁿ.
Use a combination when ORDER does not matter; passwords and podiums are not combinations.
Tool limit: n and r up to 5000, always with an exact result.
Embed
Use this tool on your site
Paste the code into your HTML and the tool shows up on your page, without J-Kit's navigation and ads. It still runs in the browser of whoever visits your site.
These references help contextualize formulas, standards, APIs and limitations used on this page. They do not replace professional validation when a result has legal, financial, medical or operational impact.
A combination is a choice of r elements out of n where order does not matter. The formula is C(n, r) = n! / (r! · (n − r)!), read "n choose r". Example: picking 2 fruits from apple, pear and grape gives C(3, 2) = 3 groups (apple and pear, apple and grape, pear and grape). In the calculator, enter n and r and the Combination mode shows the exact result and the working step by step.