How many ways can you climb a staircase one or two steps at a time?
3 lessons, about 1 h 20 min3 simulations10 problems3 practice questionsPython in every lesson
A recurrence gives each term of a sequence from the terms before it, together with starting values. To set one up, name the count , look at the first or the last step, and split into cases that are smaller copies of the same problem. The Tower of Hanoi, regions cut by lines, staircases, tilings and strings all lead to recurrences, often the Fibonacci one.
A linear recurrence is solved by trying . This gives the characteristic equation . With two different roots and , ; with one repeated root , . The starting values fix and . A constant term is removed by moving to the fixed point first.
A derangement is an order in which nothing stays in its own place. By inclusion and exclusion there are of them, and . About of all orders are derangements. The Catalan numbers count balanced brackets, paths that stay below a diagonal and triangulations.
Log in to join the discussion.
Loading…