Quant Memo
Foundational

Counting: Permutations and Combinations

How to count arrangements and selections without listing them all. Permutations when order matters, combinations when it doesn't, and the multiplication rule that generates both. The counting muscle behind nearly every discrete probability question.

Prerequisites: Probability Spaces

Counting is the foundation of discrete probability. To find the chance of something, you often just count the favorable outcomes, count the total outcomes, and divide. The hard part is counting large sets without listing them one by one, and two ideas do almost all of that work: permutations (when order matters) and combinations (when it doesn't). Both grow out of a single rule.

The multiplication rule

If a task is built from a sequence of independent steps, and step 1 can be done n1n_1 ways, step 2 in n2n_2 ways, and so on, then the whole task can be done in

n1×n2××nkn_1 \times n_2 \times \cdots \times n_k

ways. Every choice at one step gets paired with every choice at the next, so the counts multiply. This is why a menu with 3 starters and 2 mains offers 3×2=63 \times 2 = 6 different meals.

3 first choices ×2 each = 6
Three ways to make the first choice, two ways to make the second, and every pairing is a distinct outcome: three times two is six leaves.

Permutations: order matters

A permutation counts arrangements, where swapping two items gives a genuinely different result. The number of ways to line up all nn distinct items is

n!=n×(n1)××2×1,n! = n \times (n-1) \times \cdots \times 2 \times 1 ,

read "nn factorial." (The first spot has nn candidates, the next has n1n-1 left, and so on, straight from the multiplication rule.) If you only fill rr of the nn spots, you stop early:

P(n,r)=n!(nr)!.P(n, r) = \frac{n!}{(n-r)!} .

Here nn is the number of available items and rr is the number of ordered positions. By convention 0!=10! = 1.

Combinations: order doesn't matter

A combination counts selections, where a group is the same no matter what order you picked it in. To choose rr items from nn:

(nr)=n!r!(nr)!,\binom{n}{r} = \frac{n!}{r!\,(n-r)!} ,

read "nn choose rr." The logic: start from the ordered count P(n,r)P(n,r), then divide by r!r! to erase the orderings, since each unordered group of rr items was counted r!r! times, once for each way of arranging it. That single division is the whole difference between a permutation and a combination.

The whole distinction in one line: order matters → permutation P(n,r)=n!(nr)!P(n,r)=\frac{n!}{(n-r)!}; order doesn't → combination (nr)=n!r!(nr)!\binom{n}{r}=\frac{n!}{r!(n-r)!}. The combination is just the permutation divided by r!r! to erase the orderings.

Worked example

A desk of 5 traders needs a team. First, how many ways can you pick a 2-person team where the two roles are the same? Order does not matter, so use a combination:

(52)=5!2!3!=5×42×1=202=10.\binom{5}{2} = \frac{5!}{2!\,3!} = \frac{5 \times 4}{2 \times 1} = \frac{20}{2} = 10 .

Ten possible teams. Now suppose the two roles are different, say a lead and a backup. Order now matters, so use a permutation:

P(5,2)=5!3!=5×4=20.P(5, 2) = \frac{5!}{3!} = 5 \times 4 = 20 .

Twenty possibilities, exactly 2!=22! = 2 times the combination count, because each of the 10 teams can be arranged into lead-and-backup in 2 ways. That factor of r!r! is the entire relationship between the two.

Mental-math shortcut: (nr)=(nnr)\binom{n}{r} = \binom{n}{n-r} — choosing which rr to include is the same as choosing which nrn-r to leave out. So (5048)\binom{50}{48} is just (502)=1225\binom{50}{2} = 1225, not a monstrous factorial.

Common pitfalls

  • Order matters, or it doesn't. Deciding this first is the whole game. "How many teams?" is a combination; "how many rankings?" is a permutation. Using the wrong one is off by exactly a factor of r!r!.
  • With or without replacement. Drawing cards without replacement shrinks the pool each step (52,51,50,52, 51, 50, \dots); rolling a die with replacement does not (6,6,6,6, 6, 6, \dots). Match the formula to the setup.
  • "And" multiplies, "or" adds. Sequential choices that all happen multiply their counts; mutually exclusive alternatives add. Mixing these up is the most common counting error.
  • Silent double-counting. Whenever items are interchangeable, ask whether you've counted the same outcome more than once and divide out the symmetry, just as (nr)\binom{n}{r} divides by r!r!.

Two questions decide almost every counting problem: does order matter? (permutation vs combination) and is it with or without replacement? (does the pool shrink each draw?). Settle both before picking a formula — nearly every mistake is getting one of them wrong, or silently double-counting interchangeable items.

These counts are the raw material for probability: the "choose" coefficient (nr)\binom{n}{r} is exactly what turns a single yes/no trial into the The Binomial Distribution, and every classic equally-likely-outcomes problem reduces to a favorable count over a total count. Pair careful counting with Conditional Probability and most interview brainteasers fall apart.

Related concepts

Practice in interviews

Further reading

  • Blitzstein & Hwang, Introduction to Probability, ch. 1
  • Ross, A First Course in Probability
ShareTwitterLinkedIn