courses › Counting & Discrete Math

Recurrences

level 42 course

Sequences defined step by step, and their shortcuts.

Pen and paper is fine · no calculator needed why?

Learn first (about 3 minutes)

Opens at level 42.

Sign in to start

Builds on: Sequences & series (not open yet)

the lesson

The idea, the techniques and a tip for each skill, right here. The Learn page adds worked examples for every skill and untimed practice.

Read the lesson · about 3 minutes

The idea

A recurrence builds a sequence one term at a time from the terms before it. aₙ = 3aₙ₋₁ − 1 says: to get the next term, triple the last one and take away 1. Fibonacci adds the two terms before.

Stepping through works for a few terms, if you keep careful count of which term you are on. For terms far out, spot the pattern and use a closed form, a formula that gives the nth term directly. The Tower of Hanoi doubles its moves and adds one for each extra disk, which gives 2ⁿ − 1.

Techniques

Step and label

A term a few steps out, including Fibonacci.

  1. Write each term with its label: a₁, a₂, a₃, and so on.
  2. Apply the rule to the last term, or the last two for Fibonacci, to get the next.
  3. Stop at the label the question asks for.
worked example

Example: a₁ = 3 and aₙ = 2aₙ₋₁ + 1. What is a₅?

  1. a₂ = 2 × 3 + 1 = 7.
  2. a₃ = 15, a₄ = 31, a₅ = 63.

Answer: 63

Double and add one

The fewest moves for the Tower of Hanoi.

  1. To move n disks: move n − 1 aside, move the biggest, then move the n − 1 back on top.
  2. So each extra disk doubles the moves and adds one: 1, 3, 7, 15.
  3. That is one less than a power of 2: 2ⁿ − 1.
worked example

Example: What is the minimum number of moves to solve the Tower of Hanoi with 8 disks?

  1. 2 to the power 8 is 256.
  2. 256 − 1 = 255.

Answer: 255

Spot the closed form

A term far out, where stepping would take too long.

  1. Write the first four or five terms.
  2. Compare them with powers of 2, squares, or a start times powers of 3.
  3. Check it against the start and the rule: it must give the terms the rule gives. Then use it.
worked example

Example: a₀ = 0 and aₙ = aₙ₋₁ + 2n − 1. What is a₁₂?

  1. Terms: 0, 1, 4, 9, 16, the squares.
  2. So aₙ = n², and a₁₂ = 12 × 12 = 144.

Answer: 144

Tips by skill

  • TipFibonacci: Write the terms with their numbers and add the last two each time. Stop at the term asked for.
  • TipStep through a rule: Apply the rule once per step and label each term, so you stop at the right one.
  • TipTower of Hanoi: Each extra disk doubles the moves and adds one, so n disks take 2ⁿ − 1 moves.
  • TipSpot the formula: Write the first few terms and match them to powers of 2, squares, or a start times powers of 3.

Watch out for

  • Losing count of the terms. Starting from F₁, F₁₂ is the twelfth number you write.
  • Going one step too far or stopping one short. Label every term as you write it.
  • Forgetting the minus 1 in 2ⁿ − 1.

skills · practice stats

From rounds of this course only: box, review and test-out answers are left out. Once a skill has 40 tries, it compares your first 20 tries with your last 20.

rest ladder

Win 3 of your last 4 rounds and the course rests. A win is 90% right, within 2× the round's par. Pass the review when it comes back and the next rest is longer.

  1. 1 day
  2. 3 days
  3. 7 days
  4. 14 days
  5. 30 days
  6. 60 days
  7. mastered · every 90 days

your rounds

No rounds yet.