Before any specific formula in combinatorics — before permutations, combinations, or the binomial theorem — there are a small number of logical rules that govern how counts combine. Every counting argument in the section, however elaborate, is a structured application of these rules. Two of them are foundational. The addition rule applies when a count splits into mutually exclusive cases; the multiplication rule applies when an outcome is built from a sequence of independent steps. Three further principles extend or vary these ideas: complementary counting (count what fails the condition and subtract), double counting (count the same set two ways and equate), and the pigeonhole principle (more items than containers forces a repeat). Each principle answers a structural question about a counting problem rather than computing a specific number. Recognizing which principle applies is the first step in any counting argument.
The Addition Rule
When a choice can be made in one of several ways, count each way and add.
The recipe looks too simple to go wrong. Try it on two counts.
Adding works for bus, train or taxi routes — but gives 17 hearts-or-kings in a deck that has only 16.
count
cases
sum of the cases
true count
routes to the city
bus 2, train 3, taxi 4
9
9
cards that are hearts or kings
hearts 13, kings 4
17
16
The king of hearts is both a heart and a king, so adding counts it twice. No route is both a bus route and a train route.
Adding counts is correct only when no outcome belongs to two cases.
The Mutual-Exclusion Condition
The rule requires that the cases be mutually exclusive. When two methods share outcomes, naive addition counts the shared outcomes twice. The systematic correction for this case is the inclusion–exclusion principle, which extends the addition rule by alternating additions and subtractions of intersection sizes.
The definition
The addition rule says that when a count splits into cases that cannot happen together, the total is the sum of the case counts.
The addition rule applies when a count splits into cases that cannot occur simultaneously. If an outcome can be achieved by method 1 in m1 ways, by method 2 in m2 ways, and so on through method k in mk ways, with no outcome belonging to more than one method, then the total number of outcomes is
Addition Rule
∣A1∪A2∪⋯∪Ak∣=∣A1∣+∣A2∣+⋯+∣Ak∣,Ai∩Aj=∅ for i=j.
The rule is signalled by the word "or" between cases that exclude each other.
The linguistic marker for the addition rule is the word or — pick method 1 OR method 2 OR method 3. Each "or" between mutually exclusive cases contributes its own count to the sum.
In the language of set theory, the rule is the cardinality identity ∣A∪B∣=∣A∣+∣B∣ when A∩B=∅, generalized to any number of pairwise disjoint sets.
Example
A traveller can reach the city by 2 bus routes, by 3 train routes, or by 4 taxi routes. Since these options are mutually exclusive — one trip uses one mode of transport — the total number of route choices is
2+3+4=9.
When cases overlap, the overlap has to be subtracted.
For hearts or kings: 13+4−1=16. Overlaps among any number of cases are handled by the inclusion–exclusion principle.
The rest of the page covers the multiplication rule, complementary counting, double counting, the pigeonhole principle, how the principles combine, related concepts and an overview.
The hearts-or-kings count as a picture. Add the terms one at a time: after the two single counts the king of hearts has been counted twice, and the last term takes it off once.
Click a region to see which terms of the formula count it. Click a term, or use the arrows, to add the formula one term at a time.
0 of 3 terms added.
Hearts or kings: the overlap counted twice·Inclusion–exclusionLearn Math Class
The Multiplication Rule
The multiplication rule applies when an outcome is built from a sequence of independent steps, each contributing its own number of options. If step 1 has m1 outcomes, step 2 has m2 outcomes, and so on through step k with mk outcomes, and the steps are independent, then the combined sequence has
possible outcomes. The linguistic marker for the multiplication rule is the word and — choose step 1 AND step 2 AND step 3. Each "and" between independent steps multiplies the count. In set-theoretic terms, the rule is the cardinality of the Cartesian product, ∣A×B∣=∣A∣⋅∣B∣, extended to any finite number of factors.
Example
A lunch combo is built from 3 main courses, 2 drinks, and 4 desserts. Each main can be paired with each drink, and each pairing with each dessert, giving
3×2×4=24
possible meals.
Pitfall: Adding the steps
Adding the menu counts, 3+2+4=9, counts dishes, not meals: a meal is a main and a drink and a dessert. Each of the 3×2=6 main-and-drink pairs takes any of 4 desserts, so there are 3×2×4=24 meals.
Here every outcome uses all three steps: a meal has one main, one drink and one dessert. The traveller in the addition rule makes a single choice instead, and each trip uses exactly one mode of transport. Whether an outcome is put together from several choices or picked from one of several separate lists is what decides between multiplying and adding.
The Independence Condition
Fact: A cube with 43 quintillion positions
A Rubik's Cube has 8! corner placements, 37 corner twists, 12! edge placements and 211 edge flips, halved by a parity rule: about 4.3×1019 positions. The last twist and the last flip are forced by the others, so they contribute a factor of 1.
The rule requires that the number of options at each step not depend on the choices made at earlier steps. When the option count at a later step shifts based on earlier choices, the multiplication rule does not apply directly and the count must be broken down further — usually by splitting into cases via the addition rule. The multiplication rule is the engine behind every permutation formula. Arranging n distinct items in a line uses the rule with decreasing counts at each step: n choices for the first position AND (n−1) for the second AND (n−2) for the third, down to 1, yielding n! total arrangements. Combinations build on the same product, with a division step to remove the ordering.
Three choices, then two
Choose a shirt, then trousers. Each of the 3 shirts opens its own branch, and every branch splits the same 2 ways, so the tree ends in 3 × 2 = 6 leaves — one for each outfit, each reached by exactly one path. Add a third step with k options and every leaf would split k ways again: that repeated splitting is why the counts multiply.
The rule needs the second step to offer the same number of options whatever the first choice was; the tree shows it as equal-sized fans.
Some counting problems are easier to solve in reverse. Counting the cases that fail a condition can be significantly simpler than counting the cases that satisfy it, especially when the condition has the form "at least one" — its negation, "none", often collapses into a single tractable count. If U is the universe of all outcomes and A⊆U is the set of desired outcomes, then
The strategy is to count the total, count the complement, and subtract.
Example
The number of arrangements of n distinct items in which a designated item lands in a designated position can be found from its complement: the arrangements in which that item is not in that position. The complement partitions cleanly: the designated position holds one of the n−1 other items, and the remaining n−1 items fill the rest in (n−1)! ways. Subtracting (n−1)⋅(n−1)! from n! gives the desired number, (n−1)!.
Pitfall: Securing one success first
For at least one head in 4 coin flips, choosing the flip that shows the head (4 ways) and letting the other 3 land freely gives 4⋅23=32, more than the 24=16 possible outcomes. The complement gives 16−1=15.
A condition of the form "at least one" hides many cases at once: exactly one, exactly two, and so on up to all of them, and a single outcome can meet the condition in several places. Its negation, "none", is a single case with no overlaps, and it is usually counted by one product. That is why the subtraction route is the standard choice whenever the words "at least one" appear.
Structural Note
In set-theoretic notation, complementary counting expresses ∣A∣=∣U∣−∣Ac∣, where Ac is the complement of A in the universe. This is the addition rule applied to the partition A∪Ac=U — complementary counting is a strategic application of the addition rule rather than an independent principle.
An "at least one" count is usually one subtraction away: count the outcomes with none and take them from the total.
Double counting is a proof technique rather than a counting formula. The set in question is counted in two genuinely different ways; the two resulting expressions both equal the size of the set, so they equal each other. The output is an identity, not a numerical count. If ∣S∣ can be expressed as f(n) by one argument and as g(n) by another argument, then
A canonical illustration: in a group of people who have shaken hands in various pairings, the sum of the number of hands each person shook equals twice the total number of handshakes. The reason is that each handshake is counted once from each participant's perspective — the same set (handshakes) counted two ways. In graph theory this becomes ∑vdeg(v)=2∣E∣, where the left side sums degrees over all vertices and the right side counts each edge from both endpoints.
Pitfall: Counting each handshake twice
With 6 people who all shake hands, 6⋅5=30 counts every handshake once from each of its two people. The lemma halves the sum: 230=15 handshakes, the same as the (26)=15 pairs.
The lemma is easiest to use when every person's count is known. If each of n people shakes hands with every other person exactly once, each of them shakes n−1 hands, so the left side of the identity is a single product. The right side then gives the number of handshakes, which must match the number of pairs of people.
Combinatorial Identities
Many of the identities involving the binomial coefficient — including Vandermonde's identity and the hockey stick identity — are most naturally proved by double counting. A subset count is interpreted in two ways: by selecting members directly, and by partitioning the selection into stages or cases. The two expressions for the same subset count then equate to produce the identity. Algebraic proofs of these identities exist, but the combinatorial proofs are typically shorter and more illuminating.
Counting one set in two different ways proves that the two answers are equal, with no algebra needed.
The Pigeonhole Principle
The pigeonhole principle does not count outcomes — it guarantees the existence of a particular kind of outcome. The statement is existential: it certifies that something must occur without identifying where.
Basic Form
If n items are distributed among k containers and n>k, then at least one container holds at least two items.
The reasoning is direct: if every container held at most one item, the total number of items would be at most k, contradicting n>k.
Generalized Form
If n items are distributed among k containers, then at least one container holds at least ⌈n/k⌉ items, where ⌈⋅⌉ denotes the ceiling function. The basic form is the case n=k+1, which forces ⌈n/k⌉=2.
Formally:
Pigeonhole Principle (Generalized)
n items into k containers⟹∃ container with ≥⌈n/k⌉ items.
For 25 people and 12 months, ⌊25/12⌋=2 claims only that some month has 2 birthdays. The bound is ⌈25/12⌉=3: with at most 2 per month, 12 months hold only 24 people.
In any group of 13 people, at least two share a birth month — the 13 people are distributed among 12 months, so the basic form applies. Among any 5 integers chosen from {1,2,…,8}, at least two come from one of the four pairs {1,2},{3,4},{5,6},{7,8} — 5 items distributed into 4 pairs forces at least one pair to contain two of the chosen integers, and those two differ by exactly 1.
One-Sided Nature
Fact: No compressor shrinks every file
There are 2n files of n bits but only 2n−1 shorter bit strings, the empty one included. If every file got shorter, two files would share a compressed form, and unpacking could not tell them apart.
The pigeonhole principle is asymmetric. It proves that a collision must occur, but says nothing about which container holds it or how to find it. The principle yields existence proofs in number theory, geometry, and combinatorics, often in settings where direct construction is hard or impossible. In the language of functions, the principle states that no injection exists from a finite set into a strictly smaller finite set — any function from a larger finite set to a smaller one must map at least two elements of the domain to the same target.
4 items into 3 cells: 3⁴ = 81 ways
Every one of the 81 assignments of 4 items to 3 cells is enumerated here, and not one of them leaves all three cells with a single item — there are simply not enough cells to go round. That is the pigeonhole principle as an exhaustive check rather than an argument: the crowded cell is present in all 81 cases, which is why the conclusion needs no construction. Change the counts and watch the guarantee appear and disappear on the distribution into cells visualizer.
The generalized form above is the same argument with the threshold raised: push enough items in and some container must hold not just two but many.
When items outnumber containers, a collision is certain, even when no one can say where it happens.
Putting the Principles Together
Most counting problems are not solved by applying a single principle. They require chaining several — addition to split a problem into cases, multiplication within each case to count its outcomes, complementary counting to simplify a case that is easier in reverse.
A Worked Example
Count the number of 3-digit positive integers whose digits are all distinct. The first digit cannot be 0 (or the number would not be a 3-digit number), so it has 9 choices. The second digit can be any digit except the one already used, giving 9 remaining choices (now including 0). The third digit can be any digit except the two already used, giving 8 choices. By the multiplication rule:
Putting the Principles Together
9×9×8=648.
Now consider the complementary question: how many 3-digit positive integers contain at least one repeated digit? The total number of 3-digit positive integers is 9×10×10=900 — 9 choices for the first digit and 10 each for the other two. Subtracting the 648 with all-distinct digits gives
Putting the Principles Together
900−648=252
with at least one repetition. A direct count of the "at least one repetition" set would require case analysis: exactly two digits equal and one different, all three digits equal, and the various positional arrangements. The complementary route converts the multi-case problem into a single subtraction.
When Each Principle Applies
The addition rule splits a count across mutually exclusive cases. The multiplication rule builds a count from independent steps. Complementary counting reframes a hard "at least one" problem as a simpler "none" problem and subtracts. Double counting produces identities by counting the same set two different ways. The pigeonhole principle proves that a configuration must exist when items outnumber containers. These five principles together cover the logical foundation of every formula that appears in the rest of the section.
Five mistakes come up again and again when the counting principles are put to work. Four are marked where they happen in the sections above; the fifth, adding cases that overlap, is described in the addition rule section. Here each is worked through in full, with the wrong and the right working side by side.
A count is split into cases and the case counts are added, but some outcomes belong to two cases at once. Each of those outcomes is counted twice.
Start
The integers from 1 to 20 divisible by 2 or by 3.
Wrong turn
Error here
There are 10 multiples of 2 and 6 multiples of 3, so the count is given as 10+6=16.
Right path
The multiples of 6, namely 6, 12 and 18, are in both lists. Subtracting them once gives 10+6−3=13. This is the inclusion–exclusion principle for two sets.
Why it happensThe word "or" points to the addition rule, and the condition that the cases cannot happen together is easy to skip.
How to checkLook for one outcome that fits two cases; here 6 is divisible by both 2 and 3. Listing the numbers also works: 2,3,4,6,8,9,10,12,14,15,16,18,20 are 13 numbers.
2Adding the steps
An outcome is built from several choices made together, but the option counts are added as if a single choice were made from one combined list. The reverse slip multiplies alternatives: the traveller's 2 bus, 3 train and 4 taxi routes give 9 trips, not 2×3×4=24, because a trip uses only one of them.
Wrong turn
Error here
A lunch combo has 3 mains, 2 drinks and 4 desserts, and the number of meals is given as 3+2+4=9.
Right path
Each meal is one main and one drink and one dessert. The 3 mains pair with the 2 drinks in 3×2=6 ways, and each pair goes with any of the 4 desserts: 3×2×4=24 meals.
Why it happens9 is the number of dishes on the menu, and adding feels like putting the options together. The word "and" is often left out of the problem.
How to checkAsk whether one outcome uses one choice or one of each. Main 1 alone already gives 2×4=8 different meals, so 9 meals in total is far too few.
3Securing one success first
For an "at least one" condition, one success is fixed first and everything else is left free. An outcome with several successes is then counted once for each of them.
Start
At least one head in 4 coin flips.
Wrong turn
Error here
Choose the flip that shows the head in 4 ways and let the other 3 flips land freely in 23=8 ways: 4⋅8=32.
Right path
There are 24=16 outcomes in all, and only one of them, all tails, has no head. So 16−1=15 outcomes have at least one head.
Why it happensFixing a head does guarantee the condition, so the count looks safe. But an outcome such as two heads followed by two tails is reached twice, once with the first flip fixed and once with the second, and four heads is reached four times.
How to checkThe answer can never be larger than the total; 32>16 shows the overcount. Counting by the exact number of heads confirms the right answer: (14)+(24)+(34)+(44)=4+6+4+1=15.
4Counting each handshake twice
The number of handshakes is found by adding up how many hands each person shook, and that sum is given as the answer.
Start
6 people each shake hands with everyone else.
Wrong turn
Error here
Each shakes 5 hands, so the count is given as 6⋅5=30.
Right path
Each handshake involves 2 people, so it appears twice in the sum. By the handshake lemma the sum is 2∣E∣, so ∣E∣=230=15. Choosing the 2 people of a handshake gives the same number: (26)=15.
Why it happensCounting person by person is natural, and it is easy to forget that the handshake between two people appears in both of their counts.
How to checkTry 3 people. They make 3 handshakes, but the per-person sum is 3⋅2=6. The per-person sum is always even, since it is twice the number of handshakes; an odd sum signals a slip in the counts.
5Rounding n/k down
The generalized form guarantees a container with at least ⌈n/k⌉ items, but the quotient is rounded down instead of up.
Start
25 people and 12 months.
Wrong turn
Error here
⌊25/12⌋=2, so the conclusion drawn is only that some month has at least 2 birthdays. For 13 people the floor gives 1, which says nothing at all.
Right path
⌈25/12⌉=3. If every month had at most 2 birthdays, the 12 months would hold at most 24 people, fewer than 25. So some month has at least 3.
Why it happensRounding down is the habit for questions like "how many full boxes", where the leftover is ignored. Here the leftover is the whole point: it has to go somewhere, and it pushes one container higher.
How to checkSpread the items as evenly as possible. 12 months with 2 people each hold 24; the 25th person makes a third in some month, so the guaranteed number is 3.
Each slip applies the right principle in the wrong way. Cases are added only when they do not overlap, the steps of one outcome are multiplied, at least one is counted as the total minus none, a sum over people counts every handshake twice, and the pigeonhole bound rounds n/k up. Comparing the answer with the total, listing the outcomes, or trying 3 people catches each of them.
Related Concepts
• Set Theory — the language of unions, intersections, complements, and Cartesian products that the counting rules formalize as cardinality identities. • Functions — the pigeonhole principle is the statement that no injection exists from a finite set into a strictly smaller finite set.
Counting Principles at a Glance
The page covered five logical rules behind every counting argument: the addition and multiplication rules for combining counts, complementary counting for "at least one" problems, double counting as a proof technique for identities, and the pigeonhole principle for existence guarantees. The table below collects each principle with its linguistic marker, its purpose, and a canonical example.
Solve counting word problemsWord problemsCommittees, license plates, seating plans and "at least one" questions: translate the story, pick the formula, count each stage.On this page ↑
More combinatorics methods
Count choices made in stagesSingle ruleOne outcome is built from several steps, and the number of options at each step does not depend on the earlier choices: an outfit of a shirt and pants and shoes, a code digit by digit, a meal of 3×2×4 dishes.
Count choices from separate casesSingle ruleOne outcome comes from one of several groups that share no outcomes, joined by the word or: one book from 5 novels or 7 biographies, one trip by bus or by train.
Do you add or multiply when counting possibilities?
+
Multiply when choices happen in sequence and each is made in addition to the others. Add when the choices are alternatives and only one of them occurs. Picking a shirt and then a hat multiplies; picking either a shirt or a hat adds. The words and and or in the problem usually signal which applies.Read more →
When is it easier to count the opposite?
+
Whenever the phrase at least appears, or when the forbidden cases are far fewer than the allowed ones. Count everything, count what fails, and subtract. Problems asking for arrangements where at least one condition holds usually have many valid cases and few invalid ones, which makes the complementary route much shorter.Read more →
What does the pigeonhole principle let you prove?
+
That some outcome must occur, without identifying which one. If more items are placed than there are containers, at least one container holds two. It gives existence rather than construction, which is why it proves things like two people in a large city having the same number of hairs, with no way to name them.Read more →
When do you use double counting?
+
When you want to prove two expressions are equal rather than compute a number. Count the same collection in two different ways and the two answers must agree, which establishes an identity directly. Many binomial coefficient identities are proved this way, and the argument is often shorter than algebraic manipulation.Read more →
How many positions does a Rubik's Cube have?
+
About 4.3×1019, exactly 43,252,003,274,489,856,000. The multiplication rule combines 8! corner placements, 37 corner twists, 12! edge placements and 211 edge flips, and a parity rule halves the result. The last corner twist and the last edge flip are forced by the others, which is why the powers are 37 and 211 rather than 38 and 212.Read more →
Can a compression program make every file smaller?
+
No. There are 2n files of n bits but only 2n−1 bit strings shorter than n bits, the empty one included. If every n-bit file got shorter, the pigeonhole principle would force two files to share one compressed form, and unpacking could not tell them apart. A lossless compressor that shrinks some files must leave others the same size or make them longer.Read more →
Can you multiply when the later choices depend on the earlier ones?
+
Yes, as long as the number of options at each step stays the same. For 3-digit numbers with distinct digits, which digits are left for the second place depends on the first digit, but there are always 9 of them, and then always 8 for the third, so the count is 9×9×8=648. When the number of options itself changes, split into cases with the addition rule.Read more →
How many people guarantee that three share a birth month?
+
25. With 24 people the 12 months can hold exactly 2 each, so no month needs a third. The 25th person has to join a month that already has two, which is the generalized pigeonhole principle: ⌈25/12⌉=3. In the same way, guaranteeing m people in one month takes 12(m−1)+1 people, and m=2 gives the familiar 13.Read more →