Counting: Inclusion–Exclusion & Stars and Bars

Study Sheet

Counting: Inclusion–Exclusion & Stars and Bars

The two workhorses of AMC counting

Inclusion–Exclusion

Tip
The principle

ABC=A+B+CABACBC+ABC|A\cup B\cup C| = |A|+|B|+|C| - |A\cap B| - |A\cap C| - |B\cap C| + |A\cap B\cap C|.

In plain terms. Add each group, subtract the double-counted overlaps, then add back what you subtracted too many times.

Example. Integers 11100100 divisible by 2,3,2,3, or 55: 50+33+2016106+3=7450+33+20-16-10-6+3 = 74.

Stars and Bars

Tip
Distributing identical objects

Nonnegative solutions of x1++xk=nx_1+\cdots+x_k=n number (n+k1k1)\dbinom{n+k-1}{k-1}; positive solutions number (n1k1)\dbinom{n-1}{k-1}.

In plain terms. Line up nn identical items and k1k-1 dividers; where the dividers go decides who gets what. Counting the arrangements is one binomial.

Example. Give 1010 candies to 33 kids: (122)=66\dbinom{12}{2} = 66 ways; if each must get one, (92)=36\dbinom{9}{2} = 36.