Calculate P(n,r) and C(n,r), with and without repetition, compare all four variants, visualize Pascal's triangle, and explore the computation table.
Permutations and combinations are the two pillars of combinatorics — the mathematics of counting, arranging, and selecting. A permutation counts the number of ways to arrange r items from n where order matters; a combination counts selections where order doesn't matter.
This calculator computes all four variants: permutations and combinations, each with and without repetition. P(n,r) = n!/(n−r)! counts ordered arrangements. C(n,r) = n!/(r!(n−r)!) counts unordered selections (binomial coefficients). With repetition, P = nʳ and C = C(n+r−1, r). The interactive Pascal's triangle highlights your chosen C(n,r), and a comparison table shows all values for every r from 0 to n.
These formulas are essential in probability (sample spaces), statistics (hypothesis testing), cryptography (key space analysis), genetics (allele combinations), algorithm analysis (complexity bounds), and everyday problems like lottery odds, committee selection, and tournament brackets. The binomial coefficient C(n,r) is also the coefficient of xʳ in (1+x)ⁿ, connecting combinatorics to algebra.
Factorials grow extremely fast — 20! already exceeds 2.4 × 10¹⁸ — making manual calculation impractical for even moderate values of n. Comparing all four variants (P and C, with and without repetition) requires multiple factorial computations and careful formula selection. This calculator instantly computes P(n,r), C(n,r), and their repetition variants, highlights your value on Pascal's triangle, and provides a comparison table across all r values so you can see patterns at a glance. Whether you're calculating lottery odds, committee selections, or sample spaces for probability, this tool saves time and eliminates arithmetic errors.
P(n,r) = n! / (n−r)! C(n,r) = n! / (r! · (n−r)!) P rep = nʳ C rep = C(n+r−1, r)
Result: P(10,4) = 5,040; C(10,4) = 210
10 × 9 × 8 × 7 = 5,040 ordered arrangements. Dividing by 4! = 24 gives 210 unordered combinations.
The central question in any counting problem is: does order matter? Arranging 3 books on a shelf is a permutation problem (ABC ≠ BAC), while choosing 3 books to read is a combination problem (the set {A,B,C} is the same regardless of order). P(n,r) = C(n,r) × r!, meaning each unordered selection of r items can be arranged in r! ways. For 52-card poker: C(52,5) = 2,598,960 possible hands, but P(52,5) = 311,875,200 possible ordered deals.
Pascal's triangle is an infinite triangular array where each entry equals C(n,r). Row n contains the binomial coefficients for expanding (a+b)ⁿ. Key properties: the sum of row n equals 2ⁿ (total subsets of an n-element set), and C(n,r) = C(n−1,r−1) + C(n−1,r) gives the recursive construction. Pascal's triangle also encodes Fibonacci numbers (diagonal sums), hockey stick identities, and Catalan number relationships. It appears throughout probability, algebra, and number theory.
Lottery odds use C(n,r) directly: a 6/49 lottery has C(49,6) = 13,983,816 outcomes. In genetics, C(n,r) counts genotype combinations. In networking, C(n,2) gives the number of handshakes or connections between n nodes. Committee selection from a group, pizza topping combinations, and tournament bracket arrangements are all combination problems. Cryptographic key spaces, error-correcting codes (Hamming codes use binomial coefficients), and statistical sampling distributions all rely on permutation and combination formulas.
Permutations count ordered arrangements (ABC ≠ BCA). Combinations count unordered selections (ABC = BCA). P(n,r) = C(n,r) × r!.
When items can be selected more than once. Choosing 3 ice cream scoops from 5 flavors with repeat = C(7,3) = 35.
A triangular array where each entry C(n,r) equals the sum of the two entries above it. Row n contains all C(n,0) through C(n,n).
Use Stirling's approximation: n! ≈ √(2πn)(n/e)ⁿ. Or compute C(n,r) iteratively to avoid factorial overflow.
For a 6/49 lottery: C(49,6) = 13,983,816. Your chance of winning is about 1 in 14 million.
Binomial distribution uses C(n,k). Hypothesis testing, confidence intervals, and sampling all rely on combinatorial formulas.