MathLabs

Grade 10

Counting principles

The addition and multiplication rules for counting outcomes, the foundation of combinatorics.

IntuitionIntuition: choices and branching paths

Imagine choosing an outfit: one shirt from several colors, then one pair of pants from several sizes. If you draw every possible outfit as a tree — one branch per shirt, and from each shirt branch, one twig per pair of pants — the outfits are exactly the leaves of the tree. Counting principles let you count those leaves without drawing the whole tree: add when a task splits into separate, non-overlapping cases, and multiply when a task is a sequence of independent steps that must all happen.

Tree diagram showing shirt-color branches splitting further into pants-size branches.
A branching tree of choices: pick a shirt color, then a pants size. Every path from the root to a leaf is one outfit, so the number of leaves equals the number of shirt colors times the number of pants sizes.

SchoolThe addition rule and the multiplication rule

Definition: Addition rule (sum principle)

If a task can be completed by exactly one of kk mutually exclusive methods, and method nin_i has nin_i possible outcomes, with no outcome shared between two methods, then the total number of outcomes is n1+n2+⋯+nkn_1+n_2+\cdots+n_k.

∣A1∪A2∪⋯∪Ak∣=∣A1∣+∣A2∣+⋯+∣Ak∣|A_1 \cup A_2 \cup \cdots \cup A_k| = |A_1| + |A_2| + \cdots + |A_k|

Here A1A_1, A2A_2, …\dots, AkA_k are pairwise disjoint sets of outcomes: each outcome belongs to exactly one of them, so listing every outcome once is the same as listing each set separately and adding the counts.

N=n1⋅n2⋯nkN = n_1 \cdot n_2 \cdots n_k

If instead a task consists of kk successive independent steps, and step nin_i can be done in nin_i ways no matter what happened before, the total number of ways to complete the whole task is the product N=n1⋅n2⋯nkN = n_1 \cdot n_2 \cdots n_k.

When to add and when to multiply
RuleWhen it appliesFormula
Addition ruleThe task is done by exactly one of kk disjoint casesn1+n2+⋯+nkn_1+n_2+\cdots+n_k
Multiplication ruleThe task is a sequence of kk independent steps, all of which must happenn1⋅n2⋯nkn_1 \cdot n_2 \cdots n_k

UndergraduateRigorous statement and proofs

Let A1A_1, A2A_2, …\dots, AkA_k be pairwise disjoint finite sets, meaning Ai∩Aj=∅A_i \cap A_j = \emptyset whenever i≠ji \neq j. Then ∣A1∪A2∪⋯∪Ak∣=∣A1∣+∣A2∣+⋯+∣Ak∣|A_1 \cup A_2 \cup \cdots \cup A_k| = |A_1| + |A_2| + \cdots + |A_k|.

Why is it true?

This formalizes the everyday habit of counting each disjoint case separately and adding: it is valid precisely because disjointness prevents any outcome from being counted twice.

Proof

Step 1 (base case k=2k=2): suppose A1A_1 and A2A_2 are disjoint, so A1∩A2=∅A_1 \cap A_2 = \emptyset. Every element of A1∪A2A_1 \cup A_2 lies in A1A_1 or in A2A_2, and disjointness rules out lying in both. Splitting A1∪A2A_1 \cup A_2 into the two disjoint pieces A1A_1 and A2A_2 and counting each piece once therefore gives ∣A1∪A2∣=∣A1∣+∣A2∣|A_1 \cup A_2| = |A_1| + |A_2|.

Step 2 (induction on kk): assume the formula already holds for any k−1k-1 pairwise disjoint sets, so ∣A1∪⋯∪Ak−1∣=∣A1∣+⋯+∣Ak−1∣|A_1 \cup \cdots \cup A_{k-1}| = |A_1| + \cdots + |A_{k-1}|. Set B=A1∪⋯∪Ak−1B = A_1 \cup \cdots \cup A_{k-1}. Because AkA_k is disjoint from every AiA_i with i<ki < k, it is also disjoint from their union BB. Applying the base case to BB and AkA_k gives ∣B∪Ak∣=∣B∣+∣Ak∣|B \cup A_k| = |B| + |A_k|.

Step 3 (combine): substituting the inductive hypothesis for ∣B∣|B| into the last equality gives ∣A1∪⋯∪Ak∣=∣A1∣+⋯+∣Ak−1∣+∣Ak∣|A_1 \cup \cdots \cup A_k| = |A_1| + \cdots + |A_{k-1}| + |A_k|, which is exactly the addition rule for kk sets. Since the base case k=2k=2 holds and each step from k−1k-1 to kk preserves the formula, it holds for every k≥2k \geq 2 by induction.

Let a task consist of kk successive steps T1,T2,…,TkT_1, T_2, \dots, T_k, where step nin_i can be performed in nin_i ways regardless of which choices were made in the earlier steps. Then the number of ways to carry out the whole sequence is N=n1⋅n2⋯nkN = n_1 \cdot n_2 \cdots n_k.

Why is it true?

Because each step's number of choices does not depend on earlier steps, every combination of choices is a distinct legal outcome, and the count of combinations multiplies exactly like counting cells in a rectangular grid.

Proof

Step 1 (base case k=1k=1): with a single step there are trivially N1=n1N_1 = n_1 ways, matching the formula for k=1k=1.

Step 2 (base case k=2k=2): for each of the n1n_1 ways to perform step 1, step 2 can still be done in n2n_2 ways, since its count does not depend on step 1's outcome. This splits all pairs of choices into n1n_1 disjoint groups of size n2n_2 (one group per outcome of step 1), so the addition rule gives a total of n2n_2 added to itself n1n_1 times, i.e. N2=n1⋅n2N_2 = n_1 \cdot n_2.

Step 3 (induction on kk): assume the formula holds for k−1k-1 steps, so the first k−1k-1 steps together admit Nk−1N_{k-1} outcomes. Treat those k−1k-1 steps as one combined "super-step" with Nk−1N_{k-1} outcomes, and step kk as a second, independent step with nkn_k outcomes (its count still does not depend on earlier choices). Applying the two-step base case to this pair gives Nk=Nk−1⋅nkN_k = N_{k-1} \cdot n_k, which is Nk=n1⋅n2⋯nkN_k = n_1 \cdot n_2 \cdots n_k. By induction the formula holds for every kk.

UndergraduateReal-World Applications and Worked Examples

Counting principles are the first tool used whenever a computer scientist estimates how many passwords, IP addresses or test cases exist, whenever a cryptographer sizes a key space, or whenever a statistician counts a sample space before assigning probabilities. The two examples below apply the multiplication rule directly to license plates and passwords.

Example: Counting license plates

A license plate has the format: 2 uppercase letters (A–Z) followed by 5 digits (0–9), and any letter or digit may repeat. How many different plates are possible?

Solution

Step 1: break the plate into 7 independent positions: 2 letter positions and 5 digit positions, filled in sequence.

Step 2: each letter position has 2626 choices (repetition allowed), so by the multiplication rule the two letter positions together give 26⋅26=26226 \cdot 26 = 26^2 outcomes.

Step 3: each digit position has 1010 choices independently of the others, so the five digit positions give 10510^5 outcomes.

Step 4: since all 7 positions are filled independently in sequence, the multiplication rule applies once more across the whole plate: total plates =262⋅105=67,600,000= 26^2 \cdot 10^5 = 67{,}600{,}000

Example: Counting passwords over a mixed alphabet

A website requires passwords of exactly 4 characters, where each character is either a lowercase letter (26 choices) or a digit (10 choices), and repetition is allowed. How many different passwords are possible?

Solution

Step 1: for a single character, apply the addition rule first, since a character is either a letter or a digit, never both: the number of choices per character is 26+10=3626 + 10 = 36.

Step 2: this per-character count does not depend on which characters were chosen in the other positions, so the 4 positions are independent successive steps in the sense of the multiplication rule.

Step 3: applying the multiplication rule across the 4 positions gives 36436^4 as the total password count.

Step 4: computing, 364=1,679,61636^4 = 1{,}679{,}616 distinct passwords.

A class has 15 boys and 12 girls. How many ways are there to choose one student to represent the class, if any student may be chosen?

A set menu offers a choice of 3 soups and, independently, a choice of 4 main dishes; a customer must choose exactly one soup and one main dish. How many different meals are possible?

How many license plates of the form 2 uppercase letters (A–Z) followed by 3 digits (0–9) are possible, if letters and digits may repeat?

A password must be either 4 lowercase letters (26 choices each) or 4 digits (10 choices each), but never a mix of the two kinds in the same password. How many different passwords are possible?

References

  1. Richard A. Brualdi (2009). Introductory Combinatorics
  2. Kenneth H. Rosen (2019). Discrete Mathematics and Its Applications