WDC Learn

Counting & Combinatorics

Counting tools for the AMC 12: multiplication and addition principles, permutations and combinations, arrangements with repeats, complementary counting, inclusion-exclusion, stars and bars, bijections, recursion, binomial identities, and casework.

≈3–4 problems per paper10 lessons6 worked examples30 practice problems4 videos

Counting appears on nearly every AMC 12 paper, typically in three or four problems. Early problems (around #5 to #10) usually reduce to a single product or a single binomial coefficient once the structure is clear. Mid-level problems (#11 to #15) combine two tools, such as complementary counting with a divisibility condition, or stars and bars with a bound. The hardest problems (#20 to #25) require a decomposition into casework, a bijection that turns an awkward constraint into one you can count, or a recursion over states.

The most important skill is naming the structure before computing. Ask whether order matters, whether repetition is allowed, whether objects are labeled, and whether rotations or reflections are identified. Then ask whether the answer is a product of independent steps, a sum of disjoint cases, a complement, an overlap correction, or a count of distributions. Most lost points come from a wrong choice at this step, not from arithmetic.

For study, work through the ten concepts in order, then do the worked examples before the practice set. For every problem you solve, check the answer with a small case or by listing, because counting errors are usually off-by-one or overcounting errors that a small case exposes at once. Once the basic tools feel automatic, focus on the difficulty 4 and 5 problems, where most of the learning happens.

1.The multiplication and addition principles

Most counting problems are built from two operations: putting independent choices together, and splitting a count into disjoint cases. The multiplication principle handles the first. If a task has two steps, the first step can be done in aa ways, and the second can be done in bb ways no matter which first step was chosen, then the whole task can be done in a⋅ba\cdot b ways.

Why this is true: write each complete outcome as an ordered pair (first choice, second choice). Each of the aa first choices can be paired with each of the bb second choices, and no pair repeats. Laying the pairs out in an aa-by-bb grid shows abab cells, one per outcome. The same reasoning extends to any number of steps: nn independent steps with a1,…,ana_1,\dots,a_n options give a1a2⋯ana_1a_2\cdots a_n outcomes.

The addition principle handles 'or'. If an outcome must come from one of several cases that cannot happen at the same time, the total is the sum of the case sizes. The key word is disjoint. If two cases can overlap, adding them counts the overlap twice, and the overlap must be subtracted. That correction is the seed of inclusion-exclusion (Concept 5).

Most errors come from using the wrong operation. A useful test: ask whether every step must be carried out (then multiply) or whether one of several options is chosen (then add). Three soups and four sandwiches give 3⋅4=123\cdot 4=12 lunches if the diner takes one of each. If the diner takes either a soup or a sandwich, but not both, the count is 3+4=73+4=7.

A subtler trap: the number of options at a later step can depend on an earlier choice. Choosing two different cards from a 52-card deck gives 52⋅5152\cdot 51 ordered pairs, not 52⋅5252\cdot 52, because the second card cannot repeat the first. When the count of later options changes with the earlier choice, either split into cases on the earlier choice, or choose the objects in an order that makes each later count constant.

Overcounting is the other danger in products. The multiplication principle is exact only when each outcome corresponds to exactly one sequence of choices. If two different sequences produce the same final object, the product is too large and must be divided by the number of sequences that give the same object. That division is exactly what permutations and combinations do in the next concept.

KEY FACTS
  • Product rule: independent steps with aa and bb options give a⋅ba\cdot b outcomes
  • Sum rule: disjoint cases of sizes aa and bb give a+ba+b outcomes
  • Dependent counts: if later options depend on earlier choices, split into cases or change the order of choosing

Spot it: Every step must happen (multiply), or exactly one of several disjoint options happens (add). Read 'and' as multiply and 'or' as add.

COMMON MISTAKES
  • Adding when every step must be made, or multiplying when only one option is chosen.
  • Using a fixed count for a later step when an earlier choice changes its size.
TRY IT

A lunch special takes one soup (3 kinds), one sandwich (4 kinds), and either one drink (2 kinds) or one dessert (3 kinds), but not both. How many different lunch specials are possible?

Practise this lesson (6 problems) →

2.Permutations and combinations

A permutation is an ordered selection. The number of ways to fill kk distinct positions from nn distinct objects is P(n,k)=n(n−1)⋯(n−k+1)=n!(n−k)!P(n,k)=n(n-1)\cdots(n-k+1)=\frac{n!}{(n-k)!}. The first position has nn choices, the next has n−1n-1 because one object is used, and so on. This is the multiplication principle applied to a falling product.

A combination is an unordered selection: the number of kk-element subsets of an nn-set is (nk)=n!k! (n−k)!\binom{n}{k}=\frac{n!}{k!\,(n-k)!}. Derivation: every kk-subset can be listed in k!k! orders, and each ordered list of kk distinct objects comes from exactly one subset. Therefore P(n,k)=(nk)⋅k!P(n,k)=\binom{n}{k}\cdot k!, which rearranges to the binomial formula.

This relationship is the most useful fact in the topic. When a problem asks for a committee, a pair of cards, or a set of marbles, the order does not matter, so divide by k!k! or count the set directly. When the chosen items receive roles, seats, or positions, the order matters and you should count permutations. Many problems are a combination followed by an assignment: choose the set first, then multiply by the number of ways to label it.

Standard identities to recognize: (nk)=(nn−k)\binom{n}{k}=\binom{n}{n-k} (choosing who is left out is the same as choosing who is in), (n0)=(nn)=1\binom{n}{0}=\binom{n}{n}=1, and (n1)=n\binom{n}{1}=n. The first identity is also a bijection: complementing a subset is a one-to-one correspondence between kk-subsets and (n−k)(n-k)-subsets, so the two counts are equal.

Worked idea: a club of 8 members must choose a president and a secretary, who must be different people. That is ordered, so there are P(8,2)=56P(8,2)=56 choices. If instead the club sends two people to a conference with no roles, the count is (82)=28\binom{8}{2}=28, exactly half, because each pair appears once in each of its two orders in the permutation count.

Typical contest traps: choosing a set and then also ordering it when the problem does not care; forgetting that restrictions such as 'at least one woman' change which combinations are allowed, which is why such problems are split into cases; and mixing PP and ()\binom{}{} inside one count, where the treatment of order must stay consistent throughout.

Combinations are the bridge to the rest of the topic. Pascal's identity (Concept 9) comes from counting subsets with and without a fixed element, and stars and bars (Concept 6) reduces distributions to choosing positions for bars among a row of symbols. Learning to say 'this is a set' or 'this is a sequence' in one sentence is the habit that prevents most errors.

KEY FACTS
  • P(n,k)=n!(n−k)!P(n,k)=\frac{n!}{(n-k)!} counts ordered selections of kk items from nn
  • (nk)=n!k! (n−k)!=P(n,k)k!\binom{n}{k}=\frac{n!}{k!\,(n-k)!}=\frac{P(n,k)}{k!} counts unordered selections
  • (nk)=(nn−k)\binom{n}{k}=\binom{n}{n-k} and (nk)=0\binom{n}{k}=0 when k<0k<0 or k>nk>n

Spot it: Use combinations when only the chosen set matters, and permutations when positions, roles, or order of the chosen items matter.

COMMON MISTAKES
  • Counting a set and also multiplying by its orderings when the problem does not care about order.
  • Using a single formula for a count that has a restriction, instead of splitting into cases.
TRY IT

A committee of 3 is chosen from 8 people, and then the three members stand in a line for a photograph. How many distinct photographs are possible?

Practise this lesson (6 problems) →

3.Arrangements with repeats and circular arrangements

When letters repeat, the usual n!n! overcounts. Take the word BOO. Treating the three letters as distinct gives 3!=63!=6 orders, but only three words exist: BOO, OBO, OOB. Each word arises from 2!=22!=2 labelings of the two O's. In general, if a word has nn letters with n1n_1 copies of one kind, n2n_2 of another, and so on, the number of distinct arrangements is the multinomial coefficient n!n1! n2!⋯\frac{n!}{n_1!\,n_2!\cdots}.

Derivation by division: label the copies so that all nn items become distinct. This gives n!n! labeled arrangements. Each distinct word corresponds to exactly n1! n2!⋯n_1!\,n_2!\cdots labeled arrangements, since the identical copies can be permuted among themselves without changing the word. Divide by that product. A second viewpoint is to choose positions for each kind in turn: (nn1)\binom{n}{n_1} ways for the first kind, then (n−n1n2)\binom{n-n_1}{n_2} for the second, and so on. The product telescopes into the multinomial formula.

Circular arrangements: seat nn distinct people around a round table, where two seatings are the same if one is a rotation of the other. Fix one person in a reference seat. The remaining n−1n-1 people can be placed in the other seats in (n−1)!(n-1)! ways, and each circular seating corresponds to exactly one such placement. So the count is (n−1)!(n-1)!, not n!n!; the factor nn disappears because rotations are identified.

If reflections are also identified (a necklace turned over counts as the same), divide by 2 further when n≥3n\ge 3 and the arrangement has no symmetry of its own. For bead necklaces with two colors and rotations only, Burnside's lemma averages the number of fixed colorings over the rotation group. It is a useful upgrade once the basic ideas feel comfortable, and it appears in the problems below.

A common mistake is to treat a block as a single person without counting its internal orders. For two people who must sit next to each other around a table of nn people, glue them into one unit: there are n−1n-1 units around the table, giving (n−2)!(n-2)! arrangements of units, and each unit has 22 internal orders. The answer is 2 (n−2)!2\,(n-2)!, which is worth checking on a small case.

Testing a formula on a small case is the fastest check. For three distinct letters around a round table with rotations identified there are 2!=22!=2 arrangements, while in a row there are 3!=63!=6. For the word BOO the formula gives 3!/2!=33!/2!=3, matching the list above. Whenever a formula feels right, list the answer for two or three objects and compare.

KEY FACTS
  • Multinomial: n!n1! n2!⋯nm!\frac{n!}{n_1!\,n_2!\cdots n_m!} distinct arrangements of a multiset
  • Circular arrangements of nn distinct objects: (n−1)!(n-1)! when rotations are identified
  • Adjacent block of two among nn people around a table: 2 (n−2)!2\,(n-2)!

Spot it: The letters are not all distinct, or the objects sit around a table where only relative positions matter.

COMMON MISTAKES
  • Using n!n! when some letters repeat, which overcounts by the factorial of each repeat count.
  • Forgetting to fix a reference seat, which counts each circular seating nn times.
TRY IT

How many distinct arrangements of the seven letters of the word ALGEBRA are there?

Practise this lesson (5 problems) →

4.Complementary counting

Many problems ask for 'at least one' or 'not all'. Counting such a condition directly often forces a messy union of overlapping cases. The complementary principle says that #(desired)=#(all)−#(undesired)\#(\text{desired})=\#(\text{all})-\#(\text{undesired}), where the undesired set is usually a single, clean condition.

Why this helps: 'at least one 7 among five digits' has several overlapping cases (exactly one 7, exactly two 7s, and so on). Its complement, 'no 7 at all', is one case: each digit has 9 choices, giving 959^5 strings. Subtracting from the total 10510^5 leaves 105−9510^5-9^5 strings with at least one 7.

Use complements when the undesired condition is restrictive: 'no digit repeats', 'no vowel appears', 'no two adjacent letters are equal', 'every letter appears'. If the desired condition is the restrictive one, count it directly instead.

Complements combine with other tools. In 'at least two of each' problems, the bad set may be several small events. Subtract the cases violating each condition, then add back the overlaps, which is inclusion-exclusion (Concept 5). The cleanest decomposition is one where the bad cases are disjoint or nested.

Complement traps: using the wrong total (for instance, a total that excludes leading zeros while the complement includes them); taking the complement of 'at least one' as 'at most one' rather than 'none'; and subtracting overlapping bad events twice. Each is a symptom of not fixing one universe before counting.

A sanity check is built in. A complementary count must lie between 00 and the total. If the subtraction gives a negative number or a number larger than the total, the bad set was mis-specified. Complementary counting is the identity ∣A∣+∣Ac∣=∣U∣|A|+|A^c|=|U| applied on one fixed universe UU, and it should be the first tool tried whenever the condition has the form 'at least'.

KEY FACTS
  • ∣desired∣=∣all∣−∣undesired∣|\text{desired}|=|\text{all}|-|\text{undesired}| on a single fixed universe
  • 'At least one' has complement 'none'; 'at least two' has complement 'zero or one'

Spot it: A condition reads 'at least one', 'some', or 'not all', and the opposite condition is a single clean case.

COMMON MISTAKES
  • Taking the complement of 'at least one' as 'at most one'.
  • Using a total that is not the universe the bad set lives in.
TRY IT

How many four-digit strings, using the digits 0 through 9 with repetition allowed (leading zeros are allowed), contain at least one repeated digit?

Practise this lesson (4 problems) →

5.Inclusion-exclusion

For two sets, ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A\cup B|=|A|+|B|-|A\cap B|. The reason is that adding ∣A∣|A| and ∣B∣|B| counts every element of A∩BA\cap B twice, so one copy must be removed. Picture two overlapping circles: the sum double-counts the lens in the middle.

For three sets, ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣|A\cup B\cup C|=|A|+|B|+|C|-|A\cap B|-|A\cap C|-|B\cap C|+|A\cap B\cap C|. Check element by element: an element in exactly one set is counted once. An element in exactly two sets is counted 2−1=12-1=1 times. An element in all three is counted 3−3+1=13-3+1=1 time. The alternating signs are forced, because each element must be counted exactly once.

General principle: ∣⋃i=1nAi∣=∑S≠∅(−1)∣S∣+1∣⋂i∈SAi∣\left|\bigcup_{i=1}^{n} A_i\right|=\sum_{S\neq\varnothing}(-1)^{|S|+1}\left|\bigcap_{i\in S} A_i\right|. For an element lying in exactly m≥1m\ge 1 of the sets, the alternating contributions form ∑j=1m(−1)j+1(mj)=1\sum_{j=1}^{m}(-1)^{j+1}\binom{m}{j}=1, which follows from the binomial theorem applied to (1−1)m=0(1-1)^m=0.

Divisibility problems are the standard application. The number of multiples of dd in {1,…,N}\{1,\dots,N\} is ⌊N/d⌋\lfloor N/d\rfloor, and the multiples of both aa and bb are the multiples of lcm⁡(a,b)\operatorname{lcm}(a,b). So the count of integers divisible by 3 or 5 is ⌊N/3⌋+⌊N/5⌋−⌊N/15⌋\lfloor N/3\rfloor+\lfloor N/5\rfloor-\lfloor N/15\rfloor. The same idea works for three divisors, where the triple intersection term matters.

Exactly-one counts: the number of elements in exactly one of AA and BB equals ∣A∣+∣B∣−2∣A∩B∣|A|+|B|-2|A\cap B|. This is the symmetric difference. When a problem says 'or, but not both', use this form rather than the union formula.

Traps: stopping after the pairwise intersections and forgetting the triple term; using the formula when some intersections are empty but not checking; confusing 'at least one' with 'exactly one'. A check is that the answer must not exceed the sum of the set sizes, and must not be smaller than the largest single set.

KEY FACTS
  • ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A\cup B|=|A|+|B|-|A\cap B|
  • ∣A∪B∪C∣=∑∣Ai∣−∑∣Ai∩Aj∣+∣A∩B∩C∣|A\cup B\cup C|=\sum|A_i|-\sum|A_i\cap A_j|+|A\cap B\cap C|
  • Multiples of dd in {1,…,N}\{1,\dots,N\}: ⌊N/d⌋\lfloor N/d\rfloor; exactly one of A,BA,B: ∣A∣+∣B∣−2∣A∩B∣|A|+|B|-2|A\cap B|

Spot it: The condition is 'divisible by at least one of', 'has at least one of several properties', or 'exactly one of two properties'.

COMMON MISTAKES
  • Omitting the triple intersection term when there are three sets.
  • Using gcd⁡\operatorname{gcd} where lcm⁡\operatorname{lcm} is needed for the overlap of divisibility conditions.
TRY IT

How many integers from 1 to 200, inclusive, are divisible by 3 or 7 but not by both?

Practise this lesson (5 problems) →

6.Stars and bars

Distributing identical objects into distinct boxes is among the most reusable counts. The number of nonnegative integer solutions to x1+⋯+xk=nx_1+\cdots+x_k=n equals (n+k−1k−1)\binom{n+k-1}{k-1}. Picture nn identical stars in a row, with k−1k-1 bars placed among the n+k−1n+k-1 positions. Each arrangement of stars and bars corresponds to exactly one solution: the stars between consecutive bars give the values xix_i.

The count follows from choosing which k−1k-1 of the n+k−1n+k-1 positions hold bars, giving (n+k−1k−1)\binom{n+k-1}{k-1}. For example, x+y+z=10x+y+z=10 in nonnegative integers has (122)=66\binom{12}{2}=66 solutions, which is verified by brute force in the example below.

Positive solutions: if every xi≥1x_i\ge 1, substitute xi=yi+1x_i=y_i+1 with yi≥0y_i\ge 0. Then ∑yi=n−k\sum y_i=n-k, so the count is (n−1k−1)\binom{n-1}{k-1}. Equivalently, place k−1k-1 bars into the n−1n-1 gaps between the nn stars, with at most one bar per gap and none at the ends.

Upper bounds break the clean formula. Use inclusion-exclusion: count all solutions, subtract those where some xix_i exceeds its bound (shift that variable by the bound and recount), then add back the cases where two variables exceed their bounds, and so on. When the total is small, most terms vanish, which is why this method is efficient in contest problems.

Recognizing the setting: 'distribute 12 identical candies among 4 children', 'nonnegative integer solutions', and 'choose kk items with repetition from nn types'. For the last, the count is (n+k−1k)\binom{n+k-1}{k}, which equals (n+k−1k−1)\binom{n+k-1}{k-1} by the symmetry of binomial coefficients.

Off-by-one errors are the most common mistake. Shifting one variable by 1 changes the total nn by 1, and the bound you subtract must match the shift exactly. Writing out the substitution explicitly, with its new total, prevents nearly all such errors.

KEY FACTS
  • Nonnegative solutions of x1+⋯+xk=nx_1+\cdots+x_k=n: (n+k−1k−1)\binom{n+k-1}{k-1}
  • Positive solutions of x1+⋯+xk=nx_1+\cdots+x_k=n: (n−1k−1)\binom{n-1}{k-1}
  • Upper bounds: shift the violating variable and subtract via inclusion-exclusion

Spot it: Identical objects go into distinct groups, or a sum of nonnegative (or positive) integers is fixed.

COMMON MISTAKES
  • Using the positive formula when zeros are allowed, or the nonnegative formula when each variable must be at least 1.
  • Forgetting to shift the total after substituting xi=yi+cx_i=y_i+c.
TRY IT

How many ordered triples of nonnegative integers (x,y,z)(x,y,z) satisfy x+y+z=10x+y+z=10?

Practise this lesson (1 problem) →

7.Bijections and symmetry

A bijection proves two sets have equal size without counting either one. Build a one-to-one correspondence between a set you cannot count directly and a set you can. A classic example: subsets of {1,…,n}\{1,\dots,n\} correspond to binary strings of length nn (write 1 when the element is included). The product rule on binary strings then gives 2n2^n subsets.

A shifting bijection: kk-subsets of {1,…,n}\{1,\dots,n\} with no two consecutive elements are in one-to-one correspondence with kk-subsets of {1,…,n−k+1}\{1,\dots,n-k+1\}. Given a1<⋯<aka_1<\cdots<a_k with ai+1−ai≥2a_{i+1}-a_i\ge 2, define bi=ai−(i−1)b_i=a_i-(i-1). Then bi+1−bi=ai+1−ai−1≥1b_{i+1}-b_i=a_{i+1}-a_i-1\ge 1, so the bib_i are strictly increasing, and they lie in {1,…,n−k+1}\{1,\dots,n-k+1\}. The inverse map adds i−1i-1 back to each bib_i. So the count is (n−k+1k)\binom{n-k+1}{k}.

Symmetry: when a process pairs objects up two-to-one, halve the count. Ten people shake hands pairwise. Ordered pairs (a,b)(a,b) with a≠ba\neq b number 10⋅9=9010\cdot 9=90, but each handshake appears as two ordered pairs, so there are 4545 handshakes, which matches (102)\binom{10}{2}.

Symmetry also reduces casework. If a condition is invariant under a relabeling (swap two colors, reflect a board, rotate a necklace), count one representative case and multiply by the number of images. Be careful with objects fixed by the symmetry, which appear once rather than in pairs. This is the logic behind Burnside's lemma, which averages over the symmetry group.

The best bijection changes a constraint you cannot count into one you can. Gaps between chosen elements become spacing, sums become stars and bars, and paths that cross a forbidden boundary can be reflected to paths with a different endpoint. Each time, ask whether the transformed object is easier to count and whether the map can be reversed.

Traps: claiming a bijection without checking it is invertible; halving a two-to-one count when some objects are fixed by the pairing; and applying a symmetry argument when the condition is not actually symmetric. A small-case check, such as n=4n=4, catches all three.

KEY FACTS
  • Subsets of {1,…,n}\{1,\dots,n\} ↔\leftrightarrow binary strings of length nn, so there are 2n2^n subsets
  • kk-subsets of {1,…,n}\{1,\dots,n\} with no two consecutive elements: (n−k+1k)\binom{n-k+1}{k}
  • Two-to-one pairings: halve the count, unless some object is fixed by the pairing

Spot it: The count is hard to do directly, but the objects can be encoded as strings, sets, or paths that are easier to count, or a symmetry maps the problem to itself.

COMMON MISTAKES
  • Claiming a bijection without checking that the map is reversible.
  • Halving a symmetric count when some configuration is fixed by the symmetry.
TRY IT

How many 4-element subsets of {1,2,…,10}\{1,2,\dots,10\} contain no two consecutive integers?

Practise this lesson (4 problems) →

8.Recursion and states

A recursion expresses the count for size nn in terms of counts for smaller sizes. To build one, look at the last decision, or the first. For binary strings of length nn with no two consecutive 1s, split by the last symbol. If it is 0, the first n−1n-1 symbols form any valid string. If it is 1, the symbol before it must be 0, and the first n−2n-2 symbols form any valid string.

So an=an−1+an−2a_n=a_{n-1}+a_{n-2}, with a1=2a_1=2 and a2=3a_2=3. The values run 2, 3, 5, 8, 13, 21, 34, 55, and so on. This is the Fibonacci sequence shifted: an=Fn+2a_n=F_{n+2} where F1=F2=1F_1=F_2=1. For n=8n=8 the answer is a8=55a_8=55.

States: when the constraint depends on the previous symbol, track a small set of states, such as 'last symbol was A' and 'last symbol was B', and write a transfer rule for how counts move between states. Each step is a linear map on the state counts. This turns a long-length problem into a short table, and it is the same idea as taking a power of a transfer matrix.

Step recursions: if a climber takes steps of size 1, 2, or 3, the last step is one of these three, so f(n)=f(n−1)+f(n−2)+f(n−3)f(n)=f(n-1)+f(n-2)+f(n-3), with base cases f(0)=1f(0)=1, f(1)=1f(1)=1, and f(2)=2f(2)=2. Recursions with several terms need careful base cases, and most errors live there. Compute the first few values by listing to confirm the base cases.

Spacing recursions for subsets: if chosen elements must differ by at least 3, the largest element is either absent (leaving {1,…,n−1}\{1,\dots,n-1\}) or present (forbidding n−1n-1 and n−2n-2, leaving {1,…,n−3}\{1,\dots,n-3\}). This gives an=an−1+an−3a_n=a_{n-1}+a_{n-3} with base cases a0=1a_0=1, a1=2a_1=2, a2=3a_2=3. The same case analysis works for any forbidden gap.

A table of values is as much a brute force as a computer's enumeration, and it is usually the fastest reliable method. Write a0,a1,…a_0,a_1,\dots in a row, double-check two or three values by listing, and then extend. Once a recursion is established, look for a closed form only if the problem requires a large index.

KEY FACTS
  • Binary strings of length nn with no two adjacent 1s: Fn+2F_{n+2}, with F1=F2=1F_1=F_2=1
  • Fibonacci recursion: Fn+1=Fn+Fn−1F_{n+1}=F_n+F_{n-1}
  • Steps of size 1, 2, 3: f(n)=f(n−1)+f(n−2)+f(n−3)f(n)=f(n-1)+f(n-2)+f(n-3)

Spot it: The count of size nn depends on counts of smaller size through the last decision, or the constraint depends on a small amount of memory such as the last symbol.

COMMON MISTAKES
  • Wrong base cases, which shift every later value.
  • Forgetting that the 'last symbol' split must account for both possibilities.
TRY IT

How many binary strings of length 8 contain no two consecutive 1s?

Practise this lesson (3 problems) →

9.Binomial identities and Pascal's triangle

Pascal's triangle lists (nk)\binom{n}{k}. The rule (nk)=(n−1k−1)+(n−1k)\binom{n}{k}=\binom{n-1}{k-1}+\binom{n-1}{k} can be proved by counting. Fix a particular element XX of an nn-set. A kk-subset either contains XX (then choose the other k−1k-1 from n−1n-1 elements) or it does not (then choose all kk from the other n−1n-1 elements). Adding the two cases gives the identity.

Row sums: ∑k=0n(nk)=2n\sum_{k=0}^{n}\binom{n}{k}=2^n, because each subset of an nn-set is counted once in the row by its size. Alternating row sums vanish: ∑k(−1)k(nk)=0\sum_{k}(-1)^k\binom{n}{k}=0 for n≥1n\ge 1, since the even-size and odd-size subsets are equinumerous. Both follow from expanding (1+x)n(1+x)^n and substituting x=1x=1 or x=−1x=-1.

Parity sums: for n≥1n\ge 1, ∑k even(nk)=2n−1\sum_{k\text{ even}}\binom{n}{k}=2^{n-1}, because the even-size and odd-size subsets split the 2n2^n subsets evenly. For n=10n=10 this is 512512, a value verified by brute force in the example below.

Hockey stick: ∑k=rn(kr)=(n+1r+1)\sum_{k=r}^{n}\binom{k}{r}=\binom{n+1}{r+1}. Derive it by counting (r+1)(r+1)-subsets of {0,1,…,n}\{0,1,\dots,n\} according to their largest element kk. Each largest element kk contributes (kr)\binom{k}{r} subsets, and the total is a telescoping application of Pascal's rule.

Vandermonde: ∑k(mk)(nr−k)=(m+nr)\sum_{k}\binom{m}{k}\binom{n}{r-k}=\binom{m+n}{r}. Count rr-subsets of a set of m+nm+n elements split into a group of mm and a group of nn, by how many elements fall in the first group. Such identities appear naturally in committee problems (Concept 10).

Binomial theorem: (1+x)n=∑k(nk)xk(1+x)^n=\sum_k\binom{n}{k}x^k. Substituting x=1x=1, x=−1x=-1, or comparing coefficients gives the row sums and alternating sums above. When a problem asks for a sum of binomial coefficients, look first for a counting interpretation or a substitution before expanding by hand.

KEY FACTS
  • Pascal: (nk)=(n−1k−1)+(n−1k)\binom{n}{k}=\binom{n-1}{k-1}+\binom{n-1}{k}
  • ∑k=0n(nk)=2n\sum_{k=0}^{n}\binom{n}{k}=2^n and ∑k even(nk)=2n−1\sum_{k\text{ even}}\binom{n}{k}=2^{n-1} for n≥1n\ge 1
  • Hockey stick: ∑k=rn(kr)=(n+1r+1)\sum_{k=r}^{n}\binom{k}{r}=\binom{n+1}{r+1}; Vandermonde: ∑k(mk)(nr−k)=(m+nr)\sum_k\binom{m}{k}\binom{n}{r-k}=\binom{m+n}{r}

Spot it: A sum or identity involves binomial coefficients, or a count can be split by one element being included or excluded.

COMMON MISTAKES
  • Summing all binomial coefficients when the problem only asks for the even-indexed ones.
  • Misapplying Pascal's rule by mixing up k−1k-1 and kk in the indices.
TRY IT

Find ∑k even(10k)\sum_{k\text{ even}}\binom{10}{k}, the sum of (10k)\binom{10}{k} over even kk from 0 to 10.

Practise this lesson (3 problems) →

10.Committees and casework

Committee problems often impose conditions such as 'exactly two women', 'at least one from each group', or 'the captain must be included'. The standard method is to split the count into cases by a key quantity, usually the number of members from one group. Count each case as a product of combinations, then add. The sum is valid because the cases are disjoint: each committee has exactly one value of the key quantity.

Example: a committee of 4 chosen from 5 men and 4 women with at least two women. The cases are exactly two women, (42)(52)=60\binom{4}{2}\binom{5}{2}=60; exactly three women, (43)(51)=20\binom{4}{3}\binom{5}{1}=20; and exactly four women, (44)=1\binom{4}{4}=1. The total is 8181. Splitting by the number of men instead gives the same total, as it must.

Fixed members: when a particular person must be included, remove that person from the pool and reduce the committee size by one. When a particular person must be excluded, remove them from the pool. These reductions are often the simplest route, and they combine well with complementary counting when a condition is stated in the negative.

Choose the case variable carefully. The best variable is the one whose possible values give a small number of disjoint cases that each factor nicely. If the condition says 'more men than women' on a committee of five, the cases are m=3,4,5m=3,4,5, which is much shorter than the full range of values.

Casework also handles teams and roles. For unlabeled groups of equal size, divide by the number of ways to permute the groups, because each partition is produced once per ordering of its groups. For labeled groups, such as rooms or distinct roles, multiply instead. Mixing these two situations is the most common error in partition problems.

Traps: double counting a committee that falls into two cases (the cases must be disjoint); forgetting to exclude bad cases in an 'at least' problem; and treating unlabeled groups as labeled. Before adding cases, check that they cover all possibilities and nothing else.

KEY FACTS
  • Casework on a key variable: a sum over disjoint cases, each a product of combinations
  • Fixed member: remove from the pool and reduce the committee size by one
  • Unlabeled groups of equal size: divide by the number of orderings of the groups

Spot it: A condition couples two groups, such as 'at least two women' or 'more men than women', so a single product of combinations does not work.

COMMON MISTAKES
  • Counting a committee in two different cases, which double counts it.
  • Dividing by the number of group orderings when the groups are labeled.
TRY IT

A committee of 4 is chosen from 5 men and 4 women, with at least two women. How many committees are possible?

Practise this lesson (3 problems) →

Decide what counts as the same outcome.

Before choosing a binomial coefficient, state whether the objects and boxes are labelled and whether order matters. The same words can describe very different sample spaces. If a direct count has awkward restrictions, look for a bijection to an unrestricted problem or count the complement.

Inclusion–exclusion is an accounting rule. Write what each event means, then add and subtract intersections with the correct sign. Small cases are useful tests: a formula that fails for two objects cannot become correct merely because the final number is large.

Before you commit to a method

  • Choose the objects before arranging them unless the stages genuinely depend on each other.
  • For casework, prove the cases cover all outcomes and do not overlap.
  • Inclusion–exclusion terms count labelled missing categories, so include their binomial factors.

Two problems to work through

Try the question on paper before opening its solution. For each step, explain why it follows from the previous one.

No adjacent selections

How many ways can three numbers be selected from 1,2,…,101,2,\ldots,10 with no two consecutive?

Show the full reasoning
  1. Write the selected numbers as a<b<ca<b<c with b≥a+2b\ge a+2 and c≥b+2c\ge b+2.
  2. Map the triple to (a,b−1,c−2)(a,b-1,c-2). These are three distinct increasing numbers in 1,…,81,\ldots,8.
  3. The map is reversible: add zero, one, and two to the entries of any increasing triple from eight.
  4. Therefore the count is (83)=56\binom83=56.

Answer: 56

Check or vary it: On a circle, the first and last positions are adjacent too. The linear compression formula does not automatically handle that extra restriction.

Use every labelled box

Five distinct students are assigned to three labelled teams. How many assignments leave no team empty?

Show the full reasoning
  1. Without restrictions, each student has three choices, giving 35=2433^5=243 assignments.
  2. Choose one team to be empty in three ways; all students then choose between the other two, giving 3⋅25=963\cdot2^5=96.
  3. Those subtractions remove assignments with two empty teams twice. Add back (32)⋅15=3\binom32\cdot1^5=3.
  4. The count is 243−96+3=150243-96+3=150.

Answer: 150

Check or vary it: The teams are labelled. If the task asked for an unordered partition into three nonempty groups, divide by 3!3! to obtain 2525.

Make the method stick

Close the solutions and rewrite both arguments from memory. In the topic practice below, begin with an untimed warm-up, then work through the medium problems. If you miss one, write down the first step you could not justify before checking the solution. Retry it on another day without your notes.

Name the structure before counting

Decide what varies and what is fixed: ordered or unordered, repetition allowed or not, labeled or identical, rotations identified or not. Most wrong answers come from one of these four decisions being made by default instead of read from the problem.

Complement when you see 'at least'

'At least one', 'not all', and 'at most' conditions often have a single clean complement, such as 'none'. Count the total, count the complement, and subtract. Check that the complement is truly one case.

Split on a key variable

When a constraint couples two groups, such as 'exactly two women' or 'more men than women', choose one quantity and sum over its values. Confirm that the cases are disjoint and together cover every possibility.

Glue blocks and fix a seat

For adjacency constraints, glue the block and multiply by its internal orders. For circular arrangements, fix one object to remove rotations, then count the rest as a line.

Translate to stars and bars or lattice paths

Sums of counts become stars and bars, and monotone moves become lattice paths. Both produce binomial answers, often after a substitution that shifts the bounds. Write the substitution explicitly so the total is shifted correctly.

Use inclusion-exclusion for structured overlaps

When bad events interact, as with divisibility by several numbers or forbidden adjacencies, sum over the intersections of the events with alternating signs. Check that the answer does not exceed the sum of the event sizes.

Test the formula on a tiny case

Before trusting a formula or recursion, count the case with two or three objects by hand, or by listing. A mismatch on a small case usually reveals an off-by-one, a missed symmetry, or a wrong base case.

Try each one first. “How do I start?” gives the way in; then reveal the solution one step at a time.

Example 1: Ordered codes without repeats

Warm-up · #1–5

A three-letter code is made from the letters A, B, C, D, E, with no letter used twice. How many codes are possible?

  1. (A)10
  2. (B)20
  3. (C)60
  4. (D)120
  5. (E)125
How do I start?

No letter repeats and the order matters, so this is an ordered selection from five distinct letters.

Example 2: Arrangements of MOON

Easy · #6–10

How many distinct four-letter arrangements can be made using each letter of the word MOON exactly once?

  1. (A)6
  2. (B)12
  3. (C)18
  4. (D)24
  5. (E)36
How do I start?

The word has a repeated letter, so divide out the orders of the two O's.

Example 3: Seating with a restricted seat

Medium · #11–15

Four people, Alice among them, are to be seated in a row of four chairs. Alice may not sit in either end chair. How many seatings are possible?

  1. (A)6
  2. (B)8
  3. (C)12
  4. (D)18
  5. (E)24
How do I start?

Place the most restricted object first, then fill the remaining seats freely.

Example 4: Committees with at least two women

Hard · #16–20

A 5-person committee is chosen from 6 men and 4 women. The committee must contain at least 2 women. How many committees are possible?

  1. (A)120
  2. (B)156
  3. (C)186
  4. (D)210
  5. (E)252
How do I start?

The bad cases are few, so complementary counting on the number of women is the cleanest route.

Example 5: Positive entries with an upper bound

Hard · #16–20

How many ordered quadruples (x,y,z,w)(x,y,z,w) of positive integers satisfy x+y+z+w=12x+y+z+w=12 with every entry at most 5?

  1. (A)85
  2. (B)120
  3. (C)125
  4. (D)165
  5. (E)220
How do I start?

Start with positive stars and bars, then remove the few violating cases, checking whether two violations can coexist.

Example 6: Paths that stay below the diagonal

Final five · #21–25

A lattice path from (0,0)(0,0) to (6,6)(6,6) uses unit steps right (1,0)(1,0) and up (0,1)(0,1). How many such paths never rise above the diagonal, so that y≤xy\le x at every point of the path?

  1. (A)84
  2. (B)120
  3. (C)126
  4. (D)132
  5. (E)144
How do I start?

This is a ballot-type boundary condition. Reflection turns the forbidden paths into a count of a different binomial coefficient.

Art of Problem Solving: Counting with Combinations Part 1
Art of Problem Solving
A clear introduction to counting with combinations, the core tool for the committee and selection problems in this topic.
Stars and Bars: A Method to tackle Crazy Counting Problems
Aryaa SK Maths
Watch when you first meet distributions of identical objects, to see how stars and bars turns a hard count into a binomial.
The Principle of Inclusion-Exclusion
CSU Mathematics
Watch to see why the alternating signs in inclusion-exclusion are forced, before attempting the divisibility and overlap problems.
Binomial Coefficients (1/3): Pascal'sTriangle
Michael Barrus
Watch to connect Pascal's triangle with binomial coefficients and the row-sum identities used in the binomial section.

30 problems, easy to hard

6 × Warm-up · #1–56 × Easy · #6–108 × Medium · #11–156 × Hard · #16–204 × Final five · #21–25
30 problems
All 30 problemsWarm-up (#1–10)Medium (#11–15)Hard (#16–25)

Next topic: Probability & Expected Value →