Discord

INAIO Guide Stage 1 4Sequences and Recurrences

4.3 Recurrence relations

Model a step-by-step problem with starting values and a rule that builds each new value from earlier ones.

Many problems happen in steps. A balance changes each month; a population changes each year; the number of ways to solve a size-nn problem may depend on the answers for smaller sizes. A recurrence relation is an equation that describes a value using one or more earlier values. It gives us a way to model such a process or solve a problem by building its answer step by step.

Recurrences appear throughout mathematics, from sequences and counting to algorithms, probability, and growth models. This is foundational to intermediate work built on sequences and equations. OpenStax's sequence lesson is a place to practise both recurrence rules and direct formulas.

A basic idea: start, update, repeat

Suppose a collection starts with 22 objects and gains 33 after every round. Let ana_n mean its size after nn rounds. The starting value is a0=2a_0=2. The rule for the next round is

an+1=an+3(n≥0).a_{n+1}=a_n+3\qquad(n\ge0).

Here ana_n is the current value and an+1a_{n+1} is the next one. The rule says to take the current size and add 33. Starting from 22, it produces a1=5a_1=5, a2=8a_2=8, and a3=11a_3=11. Those values form a sequence: 2,5,8,11,…2,5,8,11,\ldots.

A recurrence needs both a starting value and an update rule. The rule an+1=an+3a_{n+1}=a_n+3 by itself could also produce 10,13,16,…10,13,16,\ldots if it started at a0=10a_0=10. The starting value is called an initial condition. If the rule uses two earlier values, it may need two initial conditions. The index tells us which value is the start and when each update applies.

To set up a recurrence in a new problem, ask three questions: What quantity am I tracking? What is known at the start? How does one step change it? For a counting problem, the last question can become: how can an answer for a larger case be assembled from answers for smaller cases?

A quick tour of recurrences

The example above uses one previous value. In general, we can write

an+1=F(an),a0 given.a_{n+1}=F(a_n),\qquad a_0\text{ given}.

Here FF stands for the operation that turns the current value into the next one. To unroll the recurrence, apply that operation repeatedly: a1=F(a0)a_1=F(a_0), a2=F(a1)a_2=F(a_1), and so on. Write each step in order, using the new value only after it has been calculated.

Two familiar cases are an+1=an+da_{n+1}=a_n+d, which gives an=a0+nda_n=a_0+nd, and an+1=rana_{n+1}=ra_n, which gives an=a0rna_n=a_0r^n. The formula for ana_n is an explicit rule: it finds a term directly from its index. The recurrence is a recursive rule: it finds that term from earlier terms. For the opening example, the explicit rule is an=2+3na_n=2+3n. Both describe the same sequence, but a recurrence can be easier to write when the process itself is step by step.

The update can be more varied than adding or multiplying. For example, an+1=ran+ca_{n+1}=ra_n+c combines both operations; an+1=an+(n+1)a_{n+1}=a_n+(n+1) also depends on the round number. Neither is covered by the simple arithmetic or geometric formula without further work.

For two previous terms, a rule can look like

wn=wn−1+wn−2(n≥2),w0, w1 given.w_n=w_{n-1}+w_{n-2}\quad(n\ge2),\qquad w_0,\ w_1\text{ given}.

Compute in increasing index order so that both inputs already exist. In applied models, check whether the update could give an impossible value, such as a negative item count, and stop or revise the model when its assumptions fail.

The count for a four-step staircase receives arrows from the three-step and two-step counts: 3 plus 2 equals 5.The count for a four-step staircase receives arrows from the three-step and two-step counts: 3 plus 2 equals 5.
A final one-step move and a final two-step move form separate cases.

Application 1: a balance after interest and payment

A balance starts at B0=100B_0=100 units. At the end of each period, it first grows by 10%10\% and then a payment of 2020 units is made. What are the next three balances?

  1. Write the order of operations. Interest multiplies the old balance by 1.11.1, then payment subtracts 2020: Bn+1=1.1Bn−20B_{n+1}=1.1B_n-20.
  2. Update three times. B1=110−20=90B_1=110-20=90; B2=99−20=79B_2=99-20=79; B3=86.9−20=66.9B_3=86.9-20=66.9.
  3. Check the interpretation. The rule applies while the payment is possible. If a later update would make the balance negative, a real payment plan would instead finish at zero; the simple recurrence would no longer describe it.

Adding 10%10\% after subtracting 2020 would be a different model.

Application 2: climbing a short staircase

You may climb either one or two steps at a time. How many different step sequences reach the top of a four-step staircase?

  1. Name the count. Let wnw_n be the number of ways to reach step nn. There is one way to stand at step 00 (do nothing), so w0=1w_0=1; w1=1w_1=1.
  2. Split by the last move. A path to step nn ends with a one-step move from n−1n-1 or a two-step move from n−2n-2. These cases are separate, so wn=wn−1+wn−2w_n=w_{n-1}+w_{n-2}.
  3. Calculate. w2=2w_2=2, w3=3w_3=3, and w4=5w_4=5. The five sequences are 11111111, 112112, 121121, 211211, and 2222, where each digit is a move length.

The recurrence counts a large staircase without listing every path.

Resources

SourceTitleWhy read it
OpenStaxSequences and their notationsCompare recursive and explicit formulas.

Finished this module? Mark it done.

Comments

Stuck on something, spotted a mistake, or found a resource that helped you? Tell us below.

Loading comments