Combinations and permutations from n and r
Enter two whole numbers n and r. The tool returns the number of permutations and combinations of r items from n, both without repetition and with repetition allowed. It is not a probability calculator and not a lottery-odds tool.
n and r
Formulas for Combinations and permutations
P(n, r) = n! / (n − r)! (0 when r > n)
C(n, r) = n! / (r! (n − r)!) (0 when r > n)
Permutations with repetition = n^r
Combinations with repetition = C(n + r − 1, r)
Where n = number of distinct items available, a whole number, at least 0; r = number of items taken, a whole number, at least 0; P = permutations without repetition; C = combinations without repetition.
Counts are exact integers. The tool refuses when a result would exceed the largest safe JavaScript integer (9007199254740991), so every displayed value is exact.
C(n, r) and P(n, r) are 0 when r is greater than n. The empty-product convention is P(n, 0) = C(n, 0) = 1, and 0 to the power 0 is taken as 1.
Combinations with repetition count multisets of size r from n types, C(n + r - 1, r), including the case r greater than n.
Checked examples for Combinations and permutations
P(10, 3) = 10×9×8 = 720. C(10, 3) = 720/6 = 120. 10^3 = 1,000. C(12, 3) = 220.
P(52, 5) = 52×51×50×49×48 = 311,875,200. C(52, 5) = 2,598,960. 52^5 = 380,204,032. C(56, 5) = 3,819,816.
r > n, so P = C = 0. 5^10 = 9,765,625. C(14, 10) = C(14, 4) = 1,001.
Limits of Combinations and permutations
n and r must be whole numbers greater than or equal to 0. Results that would not be exact in ordinary JavaScript numbers are refused. Not a probability, odds, or lottery calculator. Not for: probabilities, odds, or expected value; lottery, poker, or game-payoff calculations; permutations of a multiset with repeated letters.
NIST DLMF 26.3, Combinations and NIST DLMF 26.13, Permutations.