Picture picking an outfit from 4 shirts and 3 pairs of pants: every shirt can be paired with every pair of pants, so the total number of outfits is 4 times 3, or 12. That's combinatorics in its entirety at the simplest level — a set of careful rules for counting how many ways something can happen, without having to list every single possibility by hand.

That same multiplying-choices idea is exactly how a PIN's real strength gets calculated, and it's why a 4-digit PIN feels more secure than it is: each of the 4 digits has 10 possible values (0 through 9), so the total number of possible PINs is 10 × 10 × 10 × 10, or 10,000 — a number small enough that a system without a lockout after failed attempts could be brute-forced by a computer in well under a second. The same multiplication that counts outfit combinations counts attacker guesses, which is exactly why password-strength advice pushes toward more characters and a larger set of allowed symbols: both numbers directly multiply into the total count of possibilities an attacker has to search through.

A related, commonly confused pair of ideas is permutations versus combinations. A permutation cares about order — how many different ways can 3 people be arranged in a line for a photo (order matters: front-middle-back is a different photo than middle-front-back). A combination doesn't care about order — how many different 3-person teams can be picked from a group of 10 (the team is the same regardless of which order you happened to pick its members in). Getting this distinction right matters directly for testing: if a feature's behavior could depend on the order operations happen in, that's a permutation question, and testing only a few orderings out of many possible ones is a real, if often invisible, gap in test coverage.

Combinatorics also answers a very practical question during test planning: given 3 independent settings that each have 4 possible values, how many total combinations would a fully exhaustive test suite need to cover? Multiplying it out — 4 × 4 × 4, or 64 — often reveals that "just test everything" isn't actually feasible once a feature has more than a couple of independent options, which is the real, practical justification behind pairwise and other reduced-combination testing strategies that deliberately test a representative subset instead of every single combination.

None of this requires memorizing formulas — the two ideas that cover almost every situation a developer runs into are "multiply the number of choices at each independent step" and "check whether order matters before you start counting," and both of those are just careful applications of the same outfit-picking logic this article started with.