In one sentence
Let be the answer for size . Instead of counting head-on, ask: what happens to the last element? In each case, once it is removed, what is left is often the same problem of size or .
So there are four steps: ① express what you want as ; ② work out the initial values by hand; ③ set up the recurrence; ④ get from the recurrence (by iterating, by the characteristic equation, or by computing up to the term you need).
Predict first
How many subsets of (including the empty set) contain no two consecutive integers?
. Counting directly means listing more than a hundred subsets; the recursion needs just one table: .
Example: subsets with no two consecutive numbers
Step 1 / 5- Name the unknown, count the start
Let be the number of subsets of with no two consecutive numbers. : .
Stop 1 · Counting finite sets: derangements (Vol. 1)
A rearrangement of in which no number stays in its original place is called a derangement. Again, look at where the last number goes, and who comes to position .
Example: the recurrence for the derangement numbers Dₙ
Step 1 / 5- Small cases
, (), ().
Stop 2 · Linear recurrences and the characteristic equation (Vol. 5)
Once the recurrence is set up, if it is linear with constant coefficients, the characteristic equation gives the general term directly.
Example: how many strings of length n made of 0, 1, 2 have no two adjacent 0s?
Step 1 / 4- Look at the last digit
Call the number . If the last digit is or , the rest can be any good string: . If the last digit is , the one before it must be or : .
Stop 3 · Iteration of a function (Vol. 2)
is itself a recursion. The key is to find a quantity that makes this recursion simple.
One problem, several solutions
Let (). Find .
Guess, then prove
and . Guess . If it holds for , then .
CostYou need a few terms to see the pattern, then one induction.
Take reciprocals: an arithmetic recursion
Let . Since , we get with . So and .
CostSee through it at once, no guessing.
Stop 4 · Functional equations by recursion (Vol. 2)
For a functional equation on the positive integers, set one variable equal to and you get a recurrence for .
Example: f: N⁺ → R, f(1) = 1, f(m + n) = f(m) + f(n) + mn. Find f(n)
Step 1 / 3- Set one variable to 1
Put : .
Practice
How many subsets of (including the empty set) contain no two consecutive integers?
people each write a greeting card. The cards are put together, and each person takes one at random. In how many ways can this happen so that nobody gets the card they wrote?
How many strings of length made of (the first digit may be ) contain no two adjacent s?
There are circles in the plane; every two of them meet in two points, and no three pass through the same point. Into how many regions do they divide the plane?