01 / 20
+ × n

Sum & Product
Rules

Master the two fundamental counting principles that form the backbone of combinatorics and discrete mathematics.

Discrete Math

What is Counting?

In discrete math, counting means determining the number of ways to perform a task or select objects from a set. This is the foundation of combinatorics: the branch of mathematics that deals with finite or countable structures.

Two rules govern nearly all counting arguments: the Sum Rule (for "or" situations) and the Product Rule (for "and" situations).

The Sum Rule

If a task can be done in one of two mutually exclusive ways: either by method \(A\) with \(n_1\) options, or by method \(B\) with \(n_2\) options, then the total number of ways is:

The word "or" is your signal: "you can pick from set \(A\) or set \(B\)." Since the options don't overlap, you simply add them.

Sum Rule Visualized

Set A a₁ a₂ a₃ a₄
\( n_1 = 4 \)
Set B b₁ b₂ b₃
\( n_2 = 3 \)
+ Total = 4 + 3 = 7 ways

The Product Rule

If a task consists of a sequence of two steps: step 1 can be done in \(n_1\) ways, and then step 2 can be done in \(n_2\) ways (regardless of how step 1 was done), then the total number of ways is:

The word "and" is your signal: "first choose from step 1, and then choose from step 2." Each choice at step 1 pairs with every choice at step 2.

Product Rule Visualized

b₁ b₂ b₃ Step 2 a₁ a₂ a₃ Step 1 (a₁, b₁) (a₁, b₂) (a₁, b₃) (a₂, b₁) (a₂, b₂) (a₂, b₃) (a₃, b₁) (a₃, b₂) (a₃, b₃) Total = 3 × 3 = 9 pairs

Formal Definitions

Sum Rule
If \(A_1, A_2, \ldots, A_n\) are pairwise disjoint finite sets, then: $$ |A_1 \cup A_2 \cup \cdots \cup A_n| = |A_1| + |A_2| + \cdots + |A_n| $$
Product Rule
If \(A_1, A_2, \ldots, A_n\) are finite sets, then: $$ |A_1 \times A_2 \times \cdots \times A_n| = |A_1| \cdot |A_2| \cdots |A_n| $$

Sum vs Product: The Key

Sum Rule Product Rule
Keyword "or" "and" / "then"
Operation Addition Multiplication
Tasks Choose one alternative Complete a sequence of steps
Set operation \(A \cup B\) (disjoint union) \(A \times B\) (Cartesian product)
Requirement Sets must be disjoint Steps must be independent
Example cue "Pick a book or a movie" "Pick a shirt and pants"

How to Apply the Rules

1
Identify the task. What are you counting? Define the outcome clearly.
2
Break the task into subtasks. Are you choosing between alternatives ("or"), or completing a sequence of steps ("and/then")?
3
Check conditions. For the sum rule: are the alternatives disjoint? For the product rule: is each step independent of the others?
4
Count each subtask individually, then add (sum rule) or multiply (product rule) the counts.
5
Combine the rules if needed: many problems use both rules in different parts of the solution.

Example 1: Sum Rule

A student must choose an elective: either a math course (5 options) or a science course (4 options). No course counts as both. How many choices are there?

Math Courses Algebra Geometry Statistics Calculus Number Th. 5 options + Science Courses Biology Chemistry Physics Astronomy 4 options Total = 5 + 4 = 9 choices

Example 2: Product Rule

A license plate has one letter followed by two digits. How many distinct plates are possible?

Step 1: Letter 26 choices × Step 2: Digit 10 choices × Step 3: Digit 10 choices Total = 26 × 10 × 10 = 2,600 plates

Example 3: Both Rules Together

A password is either 3 lowercase letters or 2 digits followed by 1 uppercase letter. How many passwords exist?

Option A: 3 Letters
Product rule: \( 26 \times 26 \times 26 = 17{,}576 \)
Option B: 2 Digits + 1 Letter
Product rule: \( 10 \times 10 \times 26 = 2{,}600 \)

Example 4: Bit Strings

How many bit strings of length 8 either start with 1 or end with 00?

A
Start with 1: Fix first bit as 1, remaining 7 bits are free: \( 2^7 = 128 \).
B
End with 00: Fix last two bits as 00, remaining 6 bits are free: \( 2^6 = 64 \).
∩
Both: Start with 1 and end with 00. Fix 3 bits, 5 free: \( 2^5 = 32 \).

Generalized Forms

Sum Rule (n sets)
For pairwise disjoint sets \(A_1, \ldots, A_n\): $$ \left|\bigcup_{i=1}^{n} A_i\right| = \sum_{i=1}^{n} |A_i| $$
Product Rule (n steps)
For a procedure with \(n\) independent steps: $$ |A_1 \times \cdots \times A_n| = \prod_{i=1}^{n} |A_i| $$

Common Mistakes

✕ Adding when you should multiply
If steps happen sequentially (shirt AND pants), multiply. Adding gives far too few outcomes.
✕ Multiplying when you should add
If you choose one alternative (bus OR train), add. Multiplying implies both happen, which is wrong.
✕ Forgetting overlap
The sum rule requires disjoint sets. If sets overlap, you must subtract \( |A \cap B| \) to avoid double-counting.

Summary Table

Sum Rule Product Rule
Formula \( n_1 + n_2 + \cdots \) \( n_1 \times n_2 \times \cdots \)
Signal words "or", "either", "alternatively" "and", "then", "followed by"
Condition Disjoint alternatives Independent sequential steps
Set notation \( |A \cup B| \) \( |A \times B| \)
Typical answer Moderate (sum of parts) Large (product grows fast)

Question 1 of 5

A restaurant offers 6 appetizers and 10 main courses. If a diner orders one appetizer and one main course, how many meals are possible?

Question 2 of 5

You can travel from A to B by bus (3 routes) or train (5 routes). How many ways can you travel from A to B?

Question 3 of 5

How many 4-digit PINs (each digit 0-9) are possible?

Question 4 of 5

A password is either 2 uppercase letters or 3 digits. How many passwords exist?

Question 5 of 5

How many bit strings of length 6 begin with 1 or end with 1?