Permutations & Combinations Calculator
Compute nPr (order matters) and nCr (order doesn't) with full counting-principle explanation.
C(10, 3) = 10! / (3! · (10−3)!) = 120
Counting is the foundation of probability. A permutation cares about order (the lineup of a relay team); a combination doesn't (a hand of cards). Add 'with repetition' when the same item can be reused (passwords, multisets) and you've covered nearly every counting problem you'll meet.
The four counting rules
Permutations without repetition — P(n, k) = n! / (n−k)!. Choose k of n items where order matters and no item repeats. Example: how many ways to seat 3 of 10 people in a 1st/2nd/3rd-place podium.
Combinations without repetition — C(n, k) = n! / (k!(n−k)!). Order doesn't matter, no repeats. Example: 5-card poker hands from a 52-card deck.
Permutations with repetition — nᵏ. k slots, each independently filled from n choices. Example: 4-digit PIN from 10 digits = 10⁴ = 10000.
Combinations with repetition (multisets) — C(n+k−1, k). k items chosen from n types, repeats allowed, order doesn't matter. Example: scooping 3 ice-cream balls from 5 flavours.
Worked example — lottery odds
A 'pick 6 from 49' lottery: how many possible tickets? Order doesn't matter and no number repeats — combinations without repetition.
C(49, 6) = 49! / (6! · 43!) = 13 983 816. One ticket has odds 1 in 13.98 million.
By contrast, a 6-digit number with repeats allowed = 10⁶ = 1 000 000 — much better odds, but far smaller prize pools because the count is so much smaller.
Worked example — passwords vs poker
8-character password from 62 alphanumeric characters with repeats: 62⁸ ≈ 2.18 × 10¹⁴. Why a brute-forcer needs an offline hash to crack reasonable passwords.
Poker hands: total = C(52, 5) = 2 598 960. Royal flushes = 4. P(royal) = 4 / 2598960 ≈ 1 in 650 000.
Same machinery — 'choose k of n' — applied at very different scales.
Quick checks
C(n, k) = C(n, n−k). Choosing the 'in' group is the same problem as choosing the 'out' group.
P(n, k) = k! · C(n, k). Permutations equal combinations multiplied by the orderings of the chosen k items.
n! grows ferociously: 10! ≈ 3.6 million, 20! ≈ 2.4 × 10¹⁸, 70! overflows IEEE 754 double precision. This calculator caps at 170! (≈ 1.7 × 10³⁰⁶) — anything beyond returns Infinity.
Common pitfalls
Treating ordered problems as unordered. 'How many possible podiums?' is P, not C.
Forgetting repetition. 'How many 7-digit phone numbers?' uses repetition (10⁷); ranking 7 distinct candidates doesn't (7!).
Multinomial coefficients — arranging n items where some repeat (like the letters in MISSISSIPPI) need n! / (n₁! · n₂! · …). Not covered by the four rules above.
Counting in computer science and genetics
In computer science, combinatorics drives algorithm analysis. Sorting n items has n! possible initial orderings, which is why comparison sorts can't beat O(n log n) in the worst case. Password entropy is log₂(nᵏ) — the number of bits of security in a k-character password drawn from n symbols.
In genetics, combinations count possible genotypes. With two alleles at a single locus, there are C(2+2−1, 2) = 3 genotypes (AA, Aa, aa). Across 20,000+ genes, the combinatorial space of human variation is astronomical — which is why twin studies focus on comparing identical versus fraternal pairs to isolate genetic from environmental effects.
Frequently asked questions
Why isn't 0! zero?
0! is defined as 1. It makes C(n, 0) = 1 (there's exactly one way to choose nothing) and keeps the binomial theorem clean.
Is a Powerball drawing a permutation or combination?
The 5 main balls are a combination (order doesn't matter). The Powerball itself is a separate single draw multiplied in.
What's a 'multinomial' coefficient?
Generalises combinations to splitting n items into 3+ groups of fixed sizes. C(n; n₁, n₂, n₃) = n! / (n₁! n₂! n₃!).
Why does my calculator say Infinity?
Factorials over 170 exceed JavaScript's double-precision range. For huge counts use logarithms or a big-integer library.
More in Statistics & Probability
From z-scores and confidence intervals to t-tests, chi-square, correlation, regression, and the binomial/Poisson distributions — textbook-grade tools with worked examples.
- Z-Score Calculator
Convert a value to a z-score, percentile, and tail probabilities using the standard normal distribution.
- Normal Distribution Calculator
Find P(X<x), P(X>x), and between-range probabilities for any normal distribution with mean μ and SD σ.
- Binomial Distribution Calculator
Compute P(X=k), cumulative probabilities, mean, and variance for n trials with success probability p.
- Poisson Distribution Calculator
Model rare events with rate λ — get P(X=k), cumulative probability, mean, and variance.
- Bayes' Theorem Calculator
Update prior beliefs with new evidence using Bayes' rule — posterior probability with tree diagram.
- Confidence Interval Calculator
Compute z or t confidence intervals for a mean, with margin of error breakdown.
Related calculators
Browse all Education →Fraction Calculator
Add, subtract, multiply, and divide fractions and mixed numbers — results returned simplified, as a mixed number, and as a decimal.
Standard Deviation Calculator
Mean, median, mode, range, sample/population standard deviation, variance, quartiles, IQR, and SEM for any list of numbers.
Course Grade Calculator
Weighted course grade from assignments, quizzes, and exams. Shows current grade plus the score needed on remaining work.
Scientific Calculator
Free online scientific calculator with trig, logs, exponents, square roots, parentheses, and constants pi and e.
Area of a Circle Calculator
Find the area of a circle from its radius, diameter, or circumference with the exact formula A = π × r².
Circumference Calculator
Find the circumference of a circle from its radius, diameter, or area using C = 2 × π × r.
Cylinder Volume Calculator
Volume and surface area of any cylinder from its radius and height using V = π × r² × h.
Sphere Volume Calculator
Volume and surface area of a sphere from its radius or diameter — uses V = (4/3) × π × r³.