Combinatorics & Probability Calculator
Calculate permutations, combinations, factorial, binomial coefficients. Probability distributions calculator. Free online combinatorics tool
"How many ways can I arrange 5 people in a row" is a permutation: 5! = 120. "How many ways can I pick 5 cards from 52" is a combination: C(52, 5) = 2,598,960. The interesting question is which formula applies — order matters (permutation) vs order does not matter (combination), repetition allowed vs not, distinguishable items vs indistinguishable. Most "I have a probability problem" mistakes come from picking the wrong formula. This calculator handles permutations, combinations, factorials, binomials, and the cases the textbooks skip (multinomials, derangements, Stirling numbers).
The four cases of "choose k from n"
- Order matters, no repetition (permutation) — P(n, k) = n! / (n-k)!. "How many ways to seat 5 of 10 people in 5 specific chairs?": P(10, 5) = 30,240.
- Order matters, repetition allowed — n^k. "How many 4-digit PINs?": 10^4 = 10,000.
- Order does not matter, no repetition (combination) — C(n, k) = n! / (k! · (n-k)!). "How many ways to choose 5 lottery numbers from 49?": C(49, 5) = 1,906,884.
- Order does not matter, repetition allowed — C(n+k-1, k). "How many ways to put 5 indistinguishable balls into 3 distinguishable urns?": C(7, 5) = 21.
The decision tree: does the order matter? Does repetition occur? Those two questions cover 90% of combinatorics problems. Special cases (distinct identical items, circular arrangements, specific constraints) layer on top.
Working example: a poker hand
Input
How many distinct 5-card poker hands?
Output
Setup: 52 cards, choose 5, order does not matter.
Formula: C(52, 5)
Calculation:
C(52, 5) = 52! / (5! · 47!)
= (52 · 51 · 50 · 49 · 48) / (5 · 4 · 3 · 2 · 1)
= 311,875,200 / 120
= 2,598,960
Probability of specific hand types:
Royal flush: 4 / 2,598,960 ≈ 0.000154%
Straight flush: 40 / 2,598,960 ≈ 0.00154%
Four of a kind: 624 / 2,598,960 ≈ 0.024%
Full house: 3,744 / 2,598,960 ≈ 0.144%
Flush: 5,108 / 2,598,960 ≈ 0.197%
Straight: 10,200 / 2,598,960 ≈ 0.392%
Three of a kind: 54,912 / 2,598,960 ≈ 2.11%
Two pair: 123,552 / 2,598,960 ≈ 4.75%
One pair: 1,098,240 / 2,598,960 ≈ 42.3%
High card: 1,302,540 / 2,598,960 ≈ 50.1%Probabilities of specific hand types are computed by counting favorable arrangements. Each hand type has its own formula — e.g., royal flush = 4 (one per suit), straight flush = 40 (10 sequences × 4 suits − 4 royal flushes already counted). The math gets case-by-case.
Probability distributions you can compute here
- Binomial — number of successes in n independent trials with probability p each. P(X = k) = C(n, k) · p^k · (1-p)^(n-k). "Flip a fair coin 10 times, get exactly 5 heads": C(10,5) · 0.5^10 = 24.6%.
- Hypergeometric — draws without replacement. "Draw 5 cards, what is P(exactly 3 hearts)?": C(13, 3) · C(39, 2) / C(52, 5).
- Poisson — rare events with mean λ. P(X = k) = e^-λ · λ^k / k!. "Average 2 emails per hour; what is P(exactly 5 next hour)?": e^-2 · 2^5 / 5! ≈ 3.6%.
- Geometric — first success in independent trials. P(X = k) = p · (1-p)^(k-1). "Probability the first heads is on flip 4?": 0.5 · 0.5^3 = 6.25%.
- Negative binomial — number of trials until r-th success.
- Normal — bell curve. The Central Limit Theorem makes sums of many things approximately normal.
When to reach for this tool
- You are doing probability homework or studying for an exam.
- You are evaluating a game-design probability (loot tables, card game decks, dice rolls).
- You are estimating "what is the chance" for a real-world scenario (lottery odds, sample-size calculations, A/B test power).
- You are debugging a probabilistic algorithm and want to verify the underlying combinatorics.
What this tool will not do
- It will not enumerate all outcomes for small problems. For "list every permutation of ABCD", a programming language is better than a calculator.
- It will not solve every "find the formula" problem. Some combinatorics requires custom counting or generating functions; this tool gives you the standard formulas, not novel proofs.
- It will not do Bayesian reasoning. P(A | B) calculations need additional setup; consider a Bayesian calculator.
- It will not handle continuous distributions in depth. Normal, exponential, gamma are partial; for serious statistics, use scipy.stats or R.
Frequently asked questions
What is the difference between permutation and combination?
Permutation cares about order; combination does not. The arrangement "ABC" and "CBA" are two different permutations but one combination. Permutation formula uses n!/(n-k)!; combination divides by k! to remove order: n!/(k!(n-k)!).
Why is 0! = 1?
Convention that makes formulas work consistently. The empty product is 1; there is exactly one way to arrange zero items (the empty arrangement). With 0! = 1, C(n, 0) = 1 (one way to choose nothing) and C(n, n) = 1 (one way to choose all). Without it, every formula needs a special case for k = 0.
What is "n choose k"?
Combinations: C(n, k) or "n choose k" = n! / (k!(n-k)!). The number of ways to pick k items from n where order does not matter. Common notations: C(n, k), nCk, the binomial coefficient.
How big can factorials get?
5! = 120, 10! = 3.6M, 20! ≈ 2.4×10^18, 50! ≈ 3.04×10^64, 100! ≈ 9.3×10^157, 170! is approximately the largest double-precision float can represent. Beyond that you need big-integer / big-float libraries.
What is a multinomial?
Generalization of binomial when items split into more than 2 categories. Number of ways to arrange n items where there are k₁ of type 1, k₂ of type 2, etc.: n! / (k₁! · k₂! · ... · kₘ!). For example, anagrams of "MISSISSIPPI": 11! / (1! · 4! · 4! · 2!) = 34,650.
What are the chances of winning the lottery?
Depends on the lottery. Polish Lotto (6 numbers from 49): 1 / C(49, 6) = 1 / 13,983,816. US Powerball (5 from 69 + 1 from 26): 1 / 292,201,338. EuroMillions (5 from 50 + 2 from 12): 1 / 139,838,160. Roughly: car accident this year (~1/100), winning major lottery (~1/100,000,000). Buying a ticket changes your expected return by less than the price.
Related tools
Calculate percentages, percentage increase/decrease, find X% of Y, what percent is X of Y. Free online percentage calculator with formulas
Calculate mean, median, mode, standard deviation, variance and more. Statistical analysis with histograms and charts. Free online statistics calculator
Spin the wheel to make random decisions. Add custom options for random picker. Free online spinning wheel, random name picker, wheel of fortune
Solve linear, quadratic, cubic equations and systems of equations online. Step-by-step solutions with graphing. Free math equation solver calculator
Last updated · E-Utils editorial team