The Sum and Product Rules
"Or" means add, as long as the cases don't overlap. "And then" means multiply, because every choice at one stage pairs with every choice at the next. Almost every counting problem comes down to these two rules.
What the symbols mean
- Ways of the first kind
How many choices there are in the first case or stage.
- Ways of the second kind
How many choices there are in the second case or stage.
Explanation
The sum and product rules are simply the two ways counts combine: "this or that" means add, and "this and then that" means multiply. They're good for counting things you could never list by hand, like every possible license plate or password, and the whole unit rests on them. The formula has just two pieces: (if you pick from one pile or the other, and nothing is in both, the totals add) and (if you pick one from each pile, every first pick pairs with every second pick). The bars just mean "how many." Bear with the notation; it's only bookkeeping for things you already do without thinking.
Product rule. Say you have 4 shirts and 3 pairs of pants. Each shirt can go with any of the 3 pants, so you get 3 outfits per shirt, and 4 shirts give . That's all the product rule is: if a choice is made in stages, and the number of options at each stage doesn't depend on what you picked earlier, multiply. A license plate with 3 letters and then 3 digits is six stages, so it has possibilities.
Sum rule. If the possibilities split into cases that don't overlap, add the cases. A starter that's either one of 5 appetizers or one of 3 soups has options. Notice the difference: you pick an appetizer or a soup, not one of each, so nothing pairs up and there's nothing to multiply.
The complement trick. Sometimes counting what you don't want is much easier. How many 3-letter strings contain at least one A? "At least one" splits into messy cases (one A, two A's, three A's, in various spots). But the strings with no A are easy: 25 choices per letter, so . Subtract from all strings and you get .
A tree diagram draws the product rule: each stage branches, and the leaves at the end are the outcomes. There's an interactive one further down where you can change the number of branches at each stage.
A common mistake. It's tempting to reuse the same count at every stage, or to add whenever you see "or." Both can go wrong. If a 4-digit PIN can't repeat digits, the second digit has 9 choices, not 10, because one digit is already used up; the count still doesn't depend on which digit you picked, so you can multiply . That idea grows into permutations in the next lesson. And if you count "cards that are red or kings" as , you've counted the two red kings twice, because those cases overlap. Fixing overlaps is what inclusion–exclusion does, later in this unit.
See it
Worked examples
How many license plates have 3 letters followed by 3 digits?
- 1
Think of filling the plate one spot at a time. That's six stages: 26 choices for each letter and 10 for each digit, and no choice limits the others.
Practice
Type your answer and check it. Solve them all to complete the lesson.
How many outfits can you make from 4 shirts and 3 pairs of pants?
How many 8-bit strings are there?
A starter is one of 5 appetizers or one of 3 soups. How many choices are there?
How many 3-letter strings (A–Z) contain at least one A?
A phone lock uses a 4-digit PIN with no digit repeated. How many such PINs are there?
A password is 8 characters, each a letter (upper or lower case) or a digit, so 62 options apiece. Security people measure strength in bits: . How many bits is that?
The hardest one here. Get it, and you've got this lesson.
How many 5-digit numbers (10000 to 99999) have at least one repeated digit?
Where it's used
Password policies, IP address ranges and license plate formats are all sized with the product rule.