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

What changes vs. ordinary induction
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.

How many base cases do you need?

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 .

Which sets are well-ordered?
  • 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

Explicit formula → recursive definition

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.

Writing a recursive definition for a set of integers

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.

Recursive functions on strings (the pattern: say what gives, then what adding one symbol does)
Function Basis Recursive step (, )
length
number of 1s, bit strings , for
number of 0s, bit strings
reversal
power
Recursive sets of strings
Set Basis Recursive step
Palindromes (bit strings)
Tree functions to memorize
Basis (single root) Recursive ()
height
vertices
leaves
internal vertices

Facts (all proved by structural induction): , , .

Structural induction templates

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 , , , .

Definition. Memorize the four cases exactly.

Useful facts: for , for , and (a tower of twos).

6.1 The Basics of Counting

Counting functions, subsets, and products

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 ): .
"At least one" means count the complement


Counting "at least one" directly usually double counts. The complement is almost always easier.

Use it whenever a problem says "or"

"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:

Counting multiples
  • Multiples of in : .
  • Multiples of in : .
  • "Divisible by both and " means divisible by . For 4 and 6 that is 12, not 24.
Circular seating

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 .

How to attack any counting problem
  1. Decide what one outcome looks like (a string? a set? an arrangement?).
  2. Sequence of choices? Multiply (product rule). Make sure each step's count doesn't depend on which earlier choice was made.
  3. Separate cases? Add (sum rule). Make sure cases don't overlap.
  4. "At least one"? Total minus none.
  5. "Or" with overlap? Inclusion–exclusion.
  6. Each outcome counted times? Divide.
  7. Sanity check with a tiny case you can list by hand.

6.2 The Pigeonhole Principle

The two formulas you'll actually use
  1. Guaranteed amount: objects in boxes means some box has .
  2. 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 .
Worst-case reasoning

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.

Classic hole choices
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

Where the formula comes from (from class)

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 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
Bit strings with ones

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).

Substrings: glue blocks together
  • 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 .
"No two X adjacent": the gap method

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: .

Committees with constraints
  • Exactly from group 1 and from group 2: (product rule).
  • At least one woman: .
  • At least one woman and at least one man: .
Binomial values worth memorizing
  • , ,
  • 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

Finding one coefficient: the recipe

For :

  1. Write the general term: .
  2. Match exponents to solve for . If there's no integer solution, the coefficient is 0.
  3. Plug in, keeping the constants and the sign (a negative means ).
Quick facts
  • has terms.
  • Coefficient of in is .
Plug in and to get sums
Plug in Identity Meaning
total number of subsets
() # even-size subsets = # odd-size subsets
Combinatorial proof (from class). Know how to write this.

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 .

Template: count one set in two ways
  1. Describe a set of objects (committees, subsets, bit strings, paths…).
  2. Count it one way, and get the left side.
  3. Count it another way, and get the right side.
  4. Conclude: both count the same set, so they're equal.

6.5 Generalized Permutations & Combinations

The four counting formulas. Memorize this table.

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 :

Stars and bars. Know why it works.

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, .

Equations are stars and bars

The number of solutions of with every an integer is

( = how many items of type ; variables = types.)

Handling constraints
  • 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 .
"Using some or all of the letters"

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.

Multinomial facts
  • Coefficient of in (with ): .
  • Number of distinct terms in : . That's stars and bars, distributing the exponent among variables.
Ask these in order
  1. Are some of the objects identical and you're arranging all of them (letters of a word)? Use .
  2. Does order matter?
    • Yes, with repetition: . Without: .
    • No, with repetition ("choose 12 donuts from 21 kinds", "solutions of "): . Without: .
  3. Constraints? Lower bounds: give them out first. Upper bounds: complement / inclusion–exclusion.