MATH 250 · Mathematics for Economics II
Difference Equations and the Cobweb Model
A difference equation links this period to the last, and the cobweb model shows prices that spiral in or out.
Key takeaways
- A difference equation relates a variable at time t to its value at time t − 1; it describes a process that moves in steps.
- The first-order linear form is P_t = a × P_(t−1) + b, and its solution is P_t = P* + (P₀ − P*) × aᵗ, where P* = b/(1 − a).
- The steady state P* is the value that does not change; the term aᵗ decides whether deviations from it fade or grow.
- If |a| is below 1 the path converges; if |a| is above 1 it diverges; a negative a makes it zigzag.
- In the cobweb model, a = −D/B, where D is how much supply responds to price and B is how much demand does, so the market is stable only when supply responds less than demand.
Picture a town of farmers who all grow pumpkins. Each spring they decide how many pumpkins to plant, and they decide based on what pumpkins sold for last fall. Last fall was a good year: prices were high. So every farmer plants extra. In October, the town is buried in pumpkins, the price crashes, and farmers lose money. The next spring they plant far fewer. Come fall, pumpkins are scarce and the price jumps again.
Nobody in this story is foolish. Each farmer reacted sensibly to the information she had. But the whole market lurches up and down, year after year. This is the cobweb model, and it is a perfect first example of a difference equation: a rule that says how this period's value depends on last period's. In this lesson we learn to solve such rules and to tell, from a single number, whether the lurching dies out or grows wilder.
The cobweb story in numbers
Picture Maya again, now as a pumpkin grower. Her town's market works like this.
- Demand depends on this year's price: Qd = 20 − 2P_t. A higher price means fewer pumpkins bought. (Quantities are in thousands, prices in dollars.)
- Supply depends on last year's price, because planting happens a year before selling: Qs = −4 + P_(t−1).
Each year the price adjusts so that the pumpkins grown are all sold: Qd = Qs. That gives
20 − 2P_t = −4 + P_(t−1)
Solve for P_t: 2P_t = 24 − P_(t−1), so
P_t = 12 − 0.5 × P_(t−1)
This is a difference equation. Given last year's price, it gives this year's.
Finding the steady state
Does any price repeat itself forever? Look for a P* with P* = 12 − 0.5 × P*. Then 1.5 × P* = 12 and P* = 8.
Check in the market. At P = 8, demand is 20 − 16 = 4 and supply is −4 + 8 = 4. They match. If the price ever reaches 8, it stays at 8 forever: farmers plant 4, the market clears at 8, and they plant 4 again.
In general, for P_t = a × P_(t−1) + b, the steady state solves P* = a × P* + b, so P* = b/(1 − a). That requires a not equal to 1. (Here a = −0.5 and b = 12, so P* = 12/1.5 = 8 ✓.)
What happens when we start away from the steady state?
Suppose the price starts at P₀ = 10, above the steady state. Let us follow it:
- P₁ = 12 − 0.5 × 10 = 7
- P₂ = 12 − 0.5 × 7 = 8.5
- P₃ = 12 − 0.5 × 8.5 = 7.75
- P₄ = 12 − 0.5 × 7.75 = 8.125
- P₅ = 12 − 0.5 × 8.125 = 7.9375
The price overshoots, undershoots, and each swing is half as big as the last. Notice the pattern. The gap from the steady state is 2, then −1, then 0.5, then −0.25. Each gap is −0.5 times the previous. We can write the solution at once:
P_t = 8 + (10 − 8) × (−0.5)ᵗ = 8 + 2 × (−0.5)ᵗ
Check t = 3: 8 + 2 × (−0.125) = 7.75 ✓. Check t = 4: 8 + 2 × 0.0625 = 8.125 ✓.
The general result is the same. For P_t = a × P_(t−1) + b, the gap from P* gets multiplied by a each period, so after t periods it has been multiplied by aᵗ:
P_t − P* = (P₀ − P*) × aᵗ
Why the zigzag? The sign and size of a
The number a does all the work. Its sign and its size give four behaviors:
| Value of a | What happens |
|---|---|
| 0 < a < 1 | Smooth return to P*, from one side |
| −1 < a < 0 | Zigzag around P* with shrinking swings (convergence) |
| a > 1 | Steady march away from P* (divergence) |
| a < −1 | Zigzag around P* with growing swings (divergence) |
If a = 1 the gap never changes, so there is no single steady state (unless b = 0). If a = −1 the price flips forever between two values. The quantity |a| is what matters for stability. This is the same test as for eigenvalues in Eigenvalues Without Fear: a one-variable difference equation is the simplest version of that story, with its eigenvalue equal to a.
When the cobweb unravels
Change the farmers' habits. Suppose supply responds much more strongly to last year's price: Qs = −10 + 3 × P_(t−1). Demand is unchanged, Qd = 20 − 2P_t. Then
20 − 2P_t = −10 + 3 × P_(t−1), so P_t = 15 − 1.5 × P_(t−1)
The steady state: P* = 15/(1 + 1.5) = 6. (Check: demand 20 − 12 = 8, supply −10 + 18 = 8 ✓.) Here a = −1.5, which is below −1 in size. Start slightly off, at P₀ = 6.5:
- P₁ = 15 − 1.5 × 6.5 = 5.25
- P₂ = 15 − 1.5 × 5.25 = 7.125
- P₃ = 15 − 1.5 × 7.125 = 4.3125
- P₄ = 15 − 1.5 × 4.3125 = 8.53125
The gaps are 0.5, −0.75, 1.125, −1.6875, 2.53: each bigger by a factor of 1.5. The swings widen. In a real market, something eventually breaks, perhaps prices hit zero and farmers quit, or the model's straight lines stop being accurate. The model does not forecast that; it tells you the system is unstable under these supply habits.
The cobweb on a supply-and-demand graph
The name comes from a picture. Draw the usual demand and supply curves with price on the vertical axis. Start at last year's price on the supply curve: that tells you how much farmers brought to market this year. Move horizontally to the demand curve: that is the price at which buyers will take exactly that quantity. That price is this year's price, and it feeds next year's supply. Move vertically back to the supply curve and repeat.
Each step draws a horizontal line, then a vertical one. In the stable case the lines form a spiral that closes in on the crossing point of the two curves. In the unstable case they spiral outward like a web a spider is still weaving. For the first example, the first moves go from a price of 10 to a quantity of 6, which sells at a price of 7; then to a quantity of 3, which sells at 8.5. You can check: supply from a 10 price is −4 + 10 = 6, and demand clears that quantity at 20 − 2P = 6, so P = 7 ✓.
Most of the time you will not draw the web at all. The algebra is faster and tells you the same thing: compute a, then compare |a| with 1.
Where the stability rule comes from
For a general cobweb, let demand be Qd = A − B × P_t and supply Qs = C + D × P_(t−1), with B and D positive. Setting them equal: P_t = (A − C)/B − (D/B) × P_(t−1). So a = −D/B.
The market is stable when |D/B| < 1, meaning D < B. In words: stability needs the supply slope, in quantity per dollar, to be smaller than the demand slope. If producers respond to price more than buyers do, then last year's high price triggers a supply surge that buyers can only absorb at a ruinously low price, and so on, with ever larger swings. In our first example, D = 1 and B = 2, so a = −0.5. In the second, D = 3 and B = 2, so a = −1.5.
Be careful with the geometry. If you draw price on the vertical axis and quantity on the horizontal, then a steep supply line corresponds to a small D (quantity barely responds to price). So the stable case is when supply is steeper than demand in that picture. Which is "steeper" depends on the axes, which is why the algebra is the safer guide.
Real-world links and limits
The cobweb idea was developed in the 1930s to explain boom-and-bust cycles in farm markets such as hogs, where it takes a long time to raise an animal after deciding to breed. It fits markets where production takes a full period and farmers base plans on today's price.
It also has limits. Farmers are not that naive: if they know prices will swing, they will plant against the swing. This is the subject of Adaptive and Rational Expectations and the Lucas Critique. A farmer who forecasts the average price instead of last year's price would never fall into the trap. So the cobweb is best seen as a model of one particular kind of expectation, adaptive and backward-looking, and as a clean way to learn difference equations.
Difference equations are also found far beyond farms. Compound interest is one: a balance A_t = 1.05 × A_(t−1) has a = 1.05, which is above 1, so it grows. Review Exponential Growth and Compounding and you will see the same aᵗ. Debt dynamics, population models and the multiplier process in macroeconomics all follow this pattern.
A common mistake: forgetting the steady-state shift
The most frequent mistake is to write P_t = P₀ × aᵗ. That is the solution only when b = 0, so the steady state is zero. Whenever b is not zero, the path settles around P*, not around zero, and you must add P* back in.
Another is to think |a| < 1 means the price converges to b. It converges to b/(1 − a). Our first example has b = 12, but the price goes to 8.
A third is applying the stability rule to a, forgetting the sign. A negative a with |a| < 1 still converges; it just zigzags.
Words to know
Difference equation an equation that relates a variable in one period to its value in the previous period.
Steady state a value that, once reached, repeats forever; here P* = b/(1 − a).
Cobweb model a market where supply responds to last period's price, producing price swings that spiral in or out.
Convergence the path approaching the steady state as time passes.
Divergence the path moving further from the steady state as time passes.
Adaptive expectations forecasting the future using the recent past, such as expecting this year's price to equal last year's.
Multiplier a the number multiplying last period's value; its size decides stability.
Check yourself
- For P_t = 0.8 × P_(t−1) + 6, find the steady state.
- Starting at P₀ = 40 in question 1, find P₁ and P₂, and describe the path.
- Demand is Qd = 30 − P_t and supply is Qs = −6 + 2 × P_(t−1). Write the difference equation and find the steady state.
- Is the market in question 3 stable? Explain with the value of a.
- In the first lesson example, what is the price in year 6, using the solution formula?
- Why does a negative a produce a zigzag and a positive a a smooth path?
Show the answers
- P* = 6/(1 − 0.8) = 30.
- P₁ = 0.8 × 40 + 6 = 38 and P₂ = 0.8 × 38 + 6 = 36.4; the path falls smoothly toward 30.
- 30 − P_t = −6 + 2 × P_(t−1), so P_t = 36 − 2 × P_(t−1); P* = 36/3 = 12 (check: demand 18, supply −6 + 24 = 18).
- No: a = −2, and |−2| is above 1, so each swing doubles and the price spirals away from 12.
- P₆ = 8 + 2 × (−0.5)⁶ = 8 + 2 × 0.015625 = 8.03125, matching the table.
- A negative a flips the sign of the gap each period, so the price jumps from one side of P* to the other; a positive a keeps the gap's sign, so the price stays on one side.