Counting & Probability

The Fundamental Counting Principle

The fundamental counting principle says that if a process has kk steps, and step one can be done in n1n_1 ways, step two in n2n_2 ways, and so on, then the whole process can be done in n1×n2×⋯×nkn_1 \times n_2 \times \cdots \times n_k ways. In short: multiply the number of options at each step.

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

That single line settles questions about outfits, passwords, license plates and seating plans without listing a single one. The multiplication is never the hard part. The skill lies in deciding what counts as a step, and in knowing what to do when the options at one step depend on an earlier choice.

What is the fundamental counting principle?

A “step” is any decision or event made one after another, such as picking a shirt, then pants, then shoes. When every step has a fixed number of options, the total is the product of those numbers. Written for two steps, it is m×nm \times n. For three or more, it simply keeps going.

Example 1. An outfit uses one of 4 shirts, one of 3 pairs of pants and one of 2 pairs of shoes. How many outfits are there?

4×3×2=244 \times 3 \times 2 = 24

There are 24 outfits. The common slip is to add: 4+3+2=94 + 3 + 2 = 9 counts the individual items, not the outfits. Adding would be right only if you were picking a single item from the whole closet.

Counting matters well beyond puzzles, because the bottom of every fraction in basic probability is a count of equally likely outcomes. A reliable cue for the principle is the word “and”: a shirt and pants and shoes. Whenever the situation reads as one choice followed by another, multiplication is on the table.

Why does multiplying the choices work?

The reason is one clean picture: a tree. Start with 4 shirt branches. From the end of each, draw 3 pants branches. Every shirt branch now carries the same group of 3 pants, so the total number of ends is 3+3+3+33 + 3 + 3 + 3, which is the repeated addition that 4×3=124 \times 3 = 12 abbreviates. Add shoes, and each of those 12 ends sprouts 2 more branches, giving 12×2=2412 \times 2 = 24.

That is also the whole proof for any number of steps. A process with kk steps is a process with k−1k - 1 steps followed by one more step, and the extra step multiplies the count by nkn_k. Nothing needs to be listed because the tree is perfectly uniform: every path through it has the same shape.

Many textbooks describe the steps as “independent,” which misleads people into thinking probability. The real requirement is smaller: the number of options at a step must be the same whatever happened earlier. The options themselves can change. If each of 3 mains comes with its own menu of exactly 4 sides, the count is still 3×4=123 \times 4 = 12. When the number of options does change from path to path, the tree is no longer uniform, and the problem must be split into cases (the subject of a later section).

Quick check

You choose a main dish from 3 options. The list of sides depends on the main, but every main comes with exactly 4 possible sides. How many main-and-side meals are there?

How to use the counting principle when repeats are not allowed

Whether an item can be reused changes the numbers at each step, and nothing else. A 4-digit PIN where digits may repeat gives 1010 options at every step:

10×10×10×10=104=10,00010 \times 10 \times 10 \times 10 = 10^4 = 10{,}000

When the same number of options appears at every step, the product collapses into a power nkn^k. If digits cannot repeat, each used digit removes one option for the next step:

10×9×8×7=504010 \times 9 \times 8 \times 7 = 5040

That shrinking product is what permutations are, and it can be written 10!6!\frac{10!}{6!} because the factorial in the denominator cancels the tail 6×5×⋯×16 \times 5 \times \cdots \times 1. You never need to memorize the permutation formula if you understand the shrinking product. If the order of the digits did not matter, the situation would instead belong to combinations, which the page returns to shortly.

Repeats or not?

Ask whether the same item may fill two different positions. A PIN can use 7 twice, but a podium cannot give the same runner first and second place.

Which step do you count first when there are restrictions?

Start with the most restricted step. This one habit prevents most wrong answers, because a restricted position has few options and later positions adapt to it.

Example 2. How many 3-digit even numbers have no repeated digit?

Counting left to right fails: the hundreds digit cannot be 0, the units digit must be even, and whether 0 has already been used changes how many options remain. So fill the units digit first and split into cases on whether it is 0.

Case A: units digit is 0. Hundreds has 9 options (1 to 9), tens has 8 (the remaining digits).

9×8×1=729 \times 8 \times 1 = 72

Case B: units digit is 2, 4, 6 or 8, so 4 options. Hundreds must be nonzero and different from the units digit: 9−1=89 - 1 = 8 options. Tens can be anything unused: 10−2=810 - 2 = 8 options.

4×8×8=2564 \times 8 \times 8 = 256

The cases cannot overlap, so add them: 72+256=32872 + 256 = 328. As a second check, count the odd ones: units has 5 options, hundreds has 8, tens has 8, giving 5×8×8=3205 \times 8 \times 8 = 320. Together 328+320=648328 + 320 = 648, which matches the direct count of all 3-digit numbers with distinct digits, 9×9×8=6489 \times 9 \times 8 = 648.

The rule behind the cases: multiply within a case, where every step has a fixed count, and add across cases.

Fundamental counting principle vs the addition rule

Multiplication and addition answer different questions. Multiplication builds one outcome from several stages (this and then that). Addition counts one outcome that can come from either of several separate groups (this or that).

Wording in the problem Operation Example
a soup and a main multiply 3×5=153 \times 5 = 15
a soup or a salad add 3+4=73 + 4 = 7

Mixed problems use both. A starter is either one of 3 soups or one of 4 salads, so there are 3+4=73 + 4 = 7 starters. Paired with one of 5 mains, the total is 7×5=357 \times 5 = 35 meals. The groups must not overlap for plain addition to work. If some items belong to both groups, subtract the overlap so nothing is counted twice. For example, the numbers from 1 to 100 divisible by 2 or by 5 number 50+20−10=6050 + 20 - 10 = 60, since the 10 multiples of 10 appear in both lists.

When does the counting principle overcount?

Six orderings of the same three-person committee collapse into one, turning 720 sequences into 120 committees
Every committee of 3 shows up as 3! = 6 different sequences, so divide the raw product by 6.

The principle counts sequences: ordered lists of choices. If a problem treats two sequences as the same outcome, the raw product counts that outcome more than once.

Choosing a committee of 3 from 10 people illustrates it. Picking a first, second and third member gives 10×9×8=72010 \times 9 \times 8 = 720 sequences. But the committee Ana, Ben, Cy is the same group as Cy, Ana, Ben. Every committee shows up in 3!=63! = 6 different orders, so the number of committees is

10×9×83!=7206=120\frac{10 \times 9 \times 8}{3!} = \frac{720}{6} = 120

A quick test for whether order matters: swap two of the chosen items. If the result is a different outcome (a different PIN, a different race result), order matters and the raw product stands. If it is the same outcome, divide by the number of orderings. The full comparison of both cases is in permutations vs combinations.

A neat consequence is the handshake count. In a group of 10, the number of handshakes is 10×92=45\frac{10 \times 9}{2} = 45. Each of the 10 people shakes 9 hands, and dividing by 2 fixes the double counting. The same 45 is also 1+2+⋯+91 + 2 + \cdots + 9, which is an arithmetic series: the second person shakes 1 hand, the third 2 new ones, and so on.

Quick check

A club of 6 people picks a 2-person cleanup crew. The two crew members are not ranked. How many different crews are possible?

Where is the fundamental counting principle used in real life?

Security is the clearest case. A password of 8 characters drawn from 26 uppercase letters, 26 lowercase letters and 10 digits has 628=218,340,105,584,89662^8 = 218{,}340{,}105{,}584{,}896 possibilities. To see its size without a calculator, use logarithm rules:

log⁡10(628)=8log⁡1062≈8(1.792)≈14.3\log_{10}\left(62^8\right) = 8 \log_{10} 62 \approx 8(1.792) \approx 14.3

A logarithm of about 14.3 means a 15-digit number, roughly 2×10142 \times 10^{14}. Each added character multiplies the count by 62, which is why length beats cleverness.

Two other uses are worth knowing. Subsets: each of nn items is either in or out, two options per item, so there are 2n2^n subsets. Ten pizza toppings give 210=10242^{10} = 1024 pizzas, including the plain one. Divisors: factor the number into primes and choose an exponent for each. Since 360=23×32×5360 = 2^3 \times 3^2 \times 5, the exponent choices are 4, 3 and 2, giving 4×3×2=244 \times 3 \times 2 = 24 divisors.

Divisor count shortcut

If N=paqbrcN = p^a q^b r^c with distinct primes, the number of divisors is (a+1)(b+1)(c+1)(a+1)(b+1)(c+1). Each exponent runs from 0 up to its maximum, which is one more option than the exponent.

The principle also sits inside algebra. Expanding a determinant takes one entry from each row, each from a different column, so an n×nn \times n determinant has n×(n−1)×⋯×1=n!n \times (n-1) \times \cdots \times 1 = n! terms. That is 2 terms in the 2×2 determinant and 6 in the 3×3 determinant.

How does the fundamental counting principle give probabilities?

When all outcomes are equally likely, probability is favorable outcomes divided by total outcomes, and the principle supplies both numbers.

Example 3. A 4-digit PIN is chosen at random, digits 0 to 9, repeats allowed. What is the probability that all four digits are different?

Total PINs: 104=10,00010^4 = 10{,}000. PINs with all digits different: 10×9×8×7=504010 \times 9 \times 8 \times 7 = 5040.

P=504010,000=0.504P = \frac{5040}{10{,}000} = 0.504

So a random PIN has no repeated digit just over half the time. A guesser who tries one specific PIN succeeds with probability 110,000=0.0001\frac{1}{10{,}000} = 0.0001.

The same answer appears step by step: the first digit is anything, the second must avoid one digit (probability 910\frac{9}{10}), the third avoids two (810\frac{8}{10}), the fourth avoids three (710\frac{7}{10}). Then 1×910×810×710=5041000=0.5041 \times \frac{9}{10} \times \frac{8}{10} \times \frac{7}{10} = \frac{504}{1000} = 0.504. Multiplying probabilities along a path is the counting principle with every count divided by the same total, which is why the two methods always agree.

Quick check

A 3-digit PIN uses digits 0 to 9 with repeats allowed. What is the probability that all three digits are different?

How can you check a counting answer?

Counting errors rarely look wrong, so build in a check. Four reliable ones:

  • Reverse the order of the steps and recount. A correct product does not care which step goes first, though the case splits may look different.
  • Count the complement. “At least one” is usually easier as total minus “none.”
  • Shrink the problem to a tiny version, list every outcome by hand, and compare with the formula.
  • Estimate the size first. Three steps with roughly 10 options each should land near 1000, not 100 or 100,000.

The complement method is the fastest fix for “at least” questions. For example, 4-character codes with digits 0 to 9, repeats allowed, containing at least one 7: there are 104=10,00010^4 = 10{,}000 codes, and 94=65619^4 = 6561 have no 7, so 10,000−6561=343910{,}000 - 6561 = 3439 contain a 7. Counting directly would need cases for one 7, two 7s, three and four.

Try this: Count the 2-digit numbers (10 to 99) that contain at least one digit 7 in two ways: directly by cases, and as 90 minus the numbers with no 7. Both should give 18.

When the two methods agree, the answer is almost certainly right. When they differ, the gap usually points at the step where a restriction was ignored or an overlap was counted twice.

Practice problems

0 of 5 solved

  1. A café sells 5 coffees, 3 cup sizes and 4 syrups. A drink is one coffee, one size and one syrup. How many different drinks are possible?

  2. How many 4-letter codes can be made from the 26 letters of the alphabet if no letter may be repeated?

  3. A license plate has 3 letters followed by 3 digits, and repeats are allowed. How many plates are possible?

  4. How many positive divisors does 720720 have?

  5. How many 4-digit numbers (1000 to 9999) have at least one repeated digit?

Common questions

What is the fundamental counting principle in simple terms?

If a task is done in stages and each stage has a fixed number of options, multiply those numbers to get the total number of outcomes. Three shirts and two pairs of pants give 3×2=63 \times 2 = 6 outfits.

Is the fundamental counting principle the same as the multiplication rule?

In counting, yes: the multiplication rule, the rule of product and the fundamental counting principle all name the same idea. The probability multiplication rule is a close cousin, since it multiplies probabilities of stages instead of counts.

When do you add instead of multiply in counting problems?

Add when the problem offers either one group of options or another and a single pick is made, as long as the groups do not overlap. Multiply when one choice is made in each of several stages.

Does the fundamental counting principle work when repetition is not allowed?

Yes. Reduce the number of options by one at each step that uses up an item, for example 10×9×8×710 \times 9 \times 8 \times 7 for a 4-digit code with no repeated digit. This is exactly how permutations are counted.

Are the events in the fundamental counting principle required to be independent?

Not in the probability sense. What matters is that the number of options at each stage is the same no matter what was chosen earlier, even if the actual options change. If the number changes, split the problem into cases.

How is the fundamental counting principle different from combinations?

The principle counts ordered sequences of choices. Combinations count groups where order is ignored, so the sequence count is divided by the number of orderings of each group.

Up next