Calculate all four types of counting: permutations/combinations with/without repetition. Decision guide, side-by-side comparison, visual size chart, and common examples.
How many possible outcomes, arrangements, or selections exist? The answer depends on two questions: does order matter, and is repetition allowed? These two binary choices define four fundamental counting formulas in combinatorics, and this calculator handles all of them.
Select the counting type — permutations (order matters) or combinations (order doesn't matter), with or without repetition — and enter n (pool size) and r (selection size). The calculator computes all four counts simultaneously, displays them side by side, and includes a decision guide to help you pick the right formula for your scenario.
Whether you're calculating lottery odds, password possibilities, team selections, or arrangement counts, this unified calculator is the starting point. It covers C(n,r), P(n,r), n^r, and C(n+r−1,r) in one tool. Check the example with realistic values before reporting. Use the steps shown to verify rounding and units. Cross-check this output using a known reference case. Use the example pattern when troubleshooting unexpected results.
The most common mistake in combinatorics is choosing the wrong formula. This calculator shows all four answers at once, with a clear decision matrix based on order and repetition. The visual comparison and real-world examples table make it immediately clear which formula applies to your problem. Keep these notes focused on your operational context.
Four fundamental counting formulas: Order matters, no repetition: P(n,r) = n!/(n−r)! Order matters, with repetition: n^r Order doesn't matter, no repetition: C(n,r) = n!/(r!(n−r)!) Order doesn't matter, with repetition: C(n+r−1, r) = (n+r−1)!/(r!(n−1)!)
Result: C(52, 5) = 2,598,960
The number of possible 5-card poker hands from a 52-card deck is C(52,5) = 2,598,960. Order doesn't matter (receiving cards in different order is the same hand) and there's no repetition (each card is unique). For comparison, P(52,5) = 311,875,200 ordered deals and 52^5 = 380,204,032 with replacement.
Every counting problem in elementary combinatorics falls into one of four categories based on two binary choices: ordered vs unordered, and with vs without repetition. Understanding which paradigm applies is the crucial first step. The decision matrix in this calculator encodes this logic visually.
Probability = favorable outcomes / total outcomes. Each counting formula directly yields the denominator. If you want the probability of a specific event (drawing a royal flush in poker), count favorable outcomes (4) and divide by total outcomes (C(52,5) = 2,598,960), giving P ≈ 1.54 × 10⁻⁶.
Beyond the four basic formulas, advanced counting uses: inclusion-exclusion (for overlapping constraints), the pigeonhole principle (existence proofs), generating functions (for complex recurrences), Burnside's lemma (for symmetry), and bijective proofs (mapping to known counts). These build on the four fundamentals covered here.
Ask two questions: (1) Does order matter? If choosing items A, B and B, A are different, order matters → permutation. (2) Can items be reused? If yes → with repetition. This gives you exactly one of the four formulas.
n^r (ordered, repeated) ≥ P(n,r) (ordered, no repeat) ≥ C(n,r) (unordered, no repeat). Adding repetition increases counts; adding order increases counts. C(n+r−1,r) (unordered, repeated) is between C(n,r) and n^r.
P(n,n) = n! (all permutations of n items). C(n,n) = 1 (only one way to choose all items). n^n (permutations with repetition). C(2n−1,n) for combinations with repetition.
For constrained counting (at least one digit, no consecutive letters, etc.), use inclusion-exclusion: count unconstrained outcomes, then subtract forbidden ones. Or break into cases and sum.
If stage 1 has n₁ outcomes and stage 2 has n₂ outcomes, the total is n₁ × n₂. This generalizes to any number of stages and underlies all four counting formulas. It's the most fundamental rule in combinatorics.
The formulas work for any n and r, but the results can be astronomically large. C(100,50) ≈ 10²⁹. For practical purposes, logarithmic representations or scientific notation are used when results exceed standard number ranges.