Key Points
All 38 must-memorize boxes from every section, in one place. Read this the night before and the morning of the exam.
5.2 Strong Induction & Well-Ordering
| Ordinary induction | Strong induction | |
|---|---|---|
| Inductive hypothesis | ||
| Base cases | usually one | often several |
| Use when | comes from | comes from , , a factor of , … |
Both are valid proof techniques and both are equivalent to the well-ordering property. Strong induction is never wrong to use, just sometimes unnecessary.
If your inductive step reaches back to , you need consecutive base cases, and the inductive step starts once is at least the last base case.
Example: with 3-cent and 5-cent stamps you build from (add a 3-cent stamp), so . You need 3 base cases, , and the step is for .
- Yes: , , (anything of the form "integers some fixed number").
- No: (no least element), and (keep halving), has least element 0 but its subset has none.
Mathematical induction, strong induction, and well-ordering are equivalent: each one can be used to prove the others.
5.3 Recursive Definitions & Structural Induction
Ask: how do I get from ?
| Explicit | Recursive step | Basis |
|---|---|---|
| (arithmetic) | ||
| (geometric) | ||
Always state the basis. A recursive rule without a starting value defines nothing.
Find the period of the pattern. The basis lists one "block" of elements; the recursive step adds the period.
| Set | Basis | Recursive step |
|---|---|---|
| Positive multiples of 5 | ||
| Odd positive integers | ||
| Positive integers not divisible by 7 | ||
| All even integers (incl. negatives) | ||
| Positive powers of 3 | ||
If the set includes negative numbers, you need a rule that goes down too.
| Function | Basis | Recursive step (, ) |
|---|---|---|
| length | ||
| number of 1s, bit strings | , for | |
| number of 0s, bit strings | ||
| reversal | ||
| power |
| Set | Basis | Recursive step |
|---|---|---|
| Palindromes (bit strings) | ||
| Basis (single root) | Recursive () | |
|---|---|---|
| height | ||
| vertices | ||
| leaves | ||
| internal vertices |
Facts (all proved by structural induction): , , .
Integers / sets: Basis: check the listed elements. Step: "Assume (and ) have the property; show (or , , …) does too."
Strings: Basis: prove . Step: assume , prove for every .
Full binary trees: Basis: prove it for the single-vertex tree. Step: assume it for and , prove it for using the recursive formulas for , , , .
Useful facts: for , for , and (a tower of twos).
6.1 The Basics of Counting
Let and .
- All functions : each of the inputs picks one of outputs, so .
- One-to-one functions: if , and if .
- Subsets of an -set: . Each element is in or out, like a bit string.
- Cartesian product: .
- Relations from to (subsets of ): .
Counting "at least one" directly usually double counts. The complement is almost always easier.
"Start with 0 or end with 11": count each, then subtract the strings that do both.
Length-8 bit strings that start with 0 or end with 11:
- Multiples of in : .
- Multiples of in : .
- "Divisible by both and " means divisible by . For 4 and 6 that is 12, not 24.
people around a round table, rotations considered the same: .
If reflections also count as the same ("same two neighbors, ignoring left/right"): .
Class Problem 16: 5 people, same right and left neighbor means same seating, so .
- Decide what one outcome looks like (a string? a set? an arrangement?).
- Sequence of choices? Multiply (product rule). Make sure each step's count doesn't depend on which earlier choice was made.
- Separate cases? Add (sum rule). Make sure cases don't overlap.
- "At least one"? Total minus none.
- "Or" with overlap? Inclusion–exclusion.
- Each outcome counted times? Divide.
- Sanity check with a tiny case you can list by hand.
6.2 The Pigeonhole Principle
- Guaranteed amount: objects in boxes means some box has .
- Minimum number needed: to guarantee some box has at least objects, you need
Reason: objects can be spread with exactly in every box. One more forces a box to reach .
When you need objects of a specific kind, pigeonhole isn't the right tool. Imagine the worst luck: you draw every other kind first, then of the kind you want.
| Problem type | Holes |
|---|---|
| Two integers with the same remainder mod | the remainders |
| Pairs adding to a target (e.g. sum 9 from ) | the pairs |
| Integer midpoint of lattice points | parity patterns: (even, odd), … ( of them) |
| Degrees in a network of computers | possible degrees, of which only can occur |
| One integer divides another (from class) | odd parts: write with odd |
6.3 Permutations & Combinations
Build an -permutation in two steps: choose the objects ( ways), then arrange them ( ways). So
Symmetry: . Choosing who's in is the same as choosing who's out. That's why 5-card hands and 47-card hands from 52 cards are equal in number.
| Order matters | Order doesn't matter | |
|---|---|---|
| Words that signal it | arrange, line up, ranking, 1st/2nd/3rd, officers with titles, strings | committee, subset, hand of cards, team, group, choose |
| Count |
A length- bit string with exactly ones is determined by which positions hold the 1s: .
- "At most ":
- "At least ": , using the complement when that is shorter.
Same for coin flips (heads = 1).
- Required substring(s): glue each into a block and permute the blocks plus the leftover letters.
- Two required substrings that overlap (share letters, like ABC and CDE): merge them into one block (ABCDE).
- Two required substrings that conflict (like CBA and BED, where B would need two different followers): the answer is .
Arrange the others first, then choose gaps for the X's. With others there are gaps (including both ends), and you place the X's into distinct gaps.
8 men and 5 women, no two women adjacent: .
- Exactly from group 1 and from group 2: (product rule).
- At least one woman: .
- At least one woman and at least one man: .
- , ,
- Row 5: 1, 5, 10, 10, 5, 1
- Row 6: 1, 6, 15, 20, 15, 6, 1
- Row 8: 1, 8, 28, 56, 70, 56, 28, 8, 1
- Row 10: 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1
- (e.g. )
To compute by hand, write and cancel before multiplying. Example: .
6.4 Binomial Coefficients & Identities
For :
- Write the general term: .
- Match exponents to solve for . If there's no integer solution, the coefficient is 0.
- Plug in, keeping the constants and the sign (a negative means ).
- has terms.
- Coefficient of in is .
| Plug in | Identity | Meaning |
|---|---|---|
| total number of subsets | ||
| () | # even-size subsets = # odd-size subsets | |
Let . Count the -subsets of , which is , by splitting on whether is chosen:
- Contains : choose the other from , which is .
- Doesn't contain : choose all from , which is .
The cases are disjoint, so by the sum rule .
- Describe a set of objects (committees, subsets, bit strings, paths…).
- Count it one way, and get the left side.
- Count it another way, and get the right side.
- Conclude: both count the same set, so they're equal.
6.5 Generalized Permutations & Combinations
Selecting items from types/objects:
| No repetition | Repetition allowed | |
|---|---|---|
| Order matters | ||
| Order doesn't matter |
Plus: arranging objects where are identical of type 1, …, identical of type :
Represent a selection of items from types as stars and bars (dividers between the types). For example, with 4 types and 6 items:
Every arrangement of stars and bars is one selection, so the count is the number of ways to choose star positions among spots: .
Memory aid: or, equivalently, .
The number of solutions of with every an integer is
( = how many items of type ; variables = types.)
- Lower bound : give to up front. Subtract from the total, then count normally.
- Upper bound : complement. (All solutions) − (solutions with ).
- Two upper bounds: inclusion–exclusion. All − (first violated) − (second violated) + (both violated).
- Inequality : add a slack variable to make it .
Split by length and by which letters are used (sum rule), applying to each case. Organize by how many copies of the repeated letter you use.
- Coefficient of in (with ): .
- Number of distinct terms in : . That's stars and bars, distributing the exponent among variables.
- Are some of the objects identical and you're arranging all of them (letters of a word)? Use .
- Does order matter?
- Yes, with repetition: . Without: .
- No, with repetition ("choose 12 donuts from 21 kinds", "solutions of "): . Without: .
- Constraints? Lower bounds: give them out first. Upper bounds: complement / inclusion–exclusion.