All topics / Counting & Combinatorics

Counting & Combinatorics

How to count possibilities without listing them: multiply independent choices, and know when order matters (permutations) versus when it doesn't (combinations). It's the math behind probability, password strength, and why brute force blows up.

  1. The Multiplication Principle If one choice can be made m ways and the next n ways, the two together can be made m × n ways. This single rule — multiply independent choices — is the engine behind almost all counting.
  2. Permutations & Combinations When order matters, you count permutations (n! and nPr). When order doesn't matter, you count combinations (nCr). Knowing which question you're asking is the whole game.
  3. Why Counting Matters Counting is the foundation of probability (favorable outcomes over total), the reason a longer password is exponentially stronger, and the reason some problems explode beyond brute force. The same idea, three big payoffs.