Recurrence relations in this visualization
A recurrence relation gives each term of a sequence from the terms before it. Together with a first term , the rule fixes the whole sequence: , then , and so on. With it adds q at every step, an arithmetic sequence; with it multiplies by p, a geometric one. The left view plots to against n; the right one draws the rule itself, as the line .
Why the difference from the fixed point is geometric
When , one value stays where it is under the rule: the fixed point , the solution of . Subtract that equation from and q drops out: . Each step multiplies the difference by p, so the differences form a geometric sequence, and . The yellow bars are these differences. From 0 with and they are −6, −3, −1.5, …, so : the terms come as close to 6 as you like but never reach it, and . With and there is no fixed point, and .
Where the sequence goes
Where the sequence goes depends on p. If , the distance shrinks and the sequence tends to α, from one side when p is positive, and from above and below in turn when it is negative. If , the distance grows, and every start except α itself is pushed away. With the distance keeps its size, and the terms alternate between and . The cobweb shows why. Go up from to the line to get , then across to the diagonal to use it as the next input. Its axes are and , not n: the path is the calculation, not a graph of the sequence. α is where the line crosses the diagonal. A line less steep than the diagonal pulls the path in toward α; a steeper one pushes it out.
A loan works this way. A balance charged 1% a month, with 100 paid each month, follows , whose fixed point is 10000: the interest on 10000 is exactly the payment. A balance of 9000 falls to about 8873.17 after a year; one of 11000 grows to about 11126.83, though the same 100 is paid every month.
Things to notice
- The rule alone does not fix a sequence: every first term gives a different one.
- Each Fibonacci number uses the two before it, so that sequence needs two starting terms.
- When the rule is not linear, there can be several fixed points, some that pull the terms in and some that push them away, as in the logistic map.
Controls
- Drag the first term: the blue point at n = 0 up or down, or the hollow blue start along the cobweb's axis. It catches the fixed point. The wheel and the field set it too.
- The knobs turn p and q; their fields, like the first term's, take exact values such as 1/3.
- With the keyboard, Tab to either blue point and use the arrow keys; hold Shift to move by whole numbers.