01 · Lesson 05
Difference equations
A difference equation describes how a quantity is updated from one separate time point to the next. It is suitable when observations or biological events occur in daily, seasonal, generational or other discrete steps.
Scenario: one breeding season at a time
A population of annual plants produces seeds, then the adult plants die. Because generations do not substantially overlap, it is natural to count the population once per breeding season rather than describe every instant continuously.
Let \(N_n\) be the population at season \(n\). A simple update is
where \(\lambda\) is the multiplication factor per season. The equation reads: “the next population equals \(\lambda\) times the current population.”
State, index and update rule
| Symbol | Meaning |
|---|---|
| \(n\) | Discrete time index: \(0,1,2,\ldots\) |
| \(N_n\) | Population at the current time point |
| \(N_{n+1}\) | Population at the next time point |
| \(\lambda\) | Dimensionless growth factor per step |
The initial value \(N_0\) is required. Once \(N_0\) and the rule are known, repeated substitution generates the trajectory.
Iterating the model
Suppose \(N_0=100\) and \(\lambda=1.2\). Then
The general solution is
- If \(\lambda>1\), the population grows.
- If \(\lambda=1\), it remains constant.
- If \(0<\lambda<1\), it declines toward zero.
A decimal result may represent an expected population or density. If the model is meant to track literal individuals, an integer-valued or stochastic formulation may be more appropriate.
Change form and update form
The same rule can be written using the one-step change:
where \(r=\lambda-1\) is the proportional change per step. Rearranging gives
Here \(r=0.2\) means a 20% net increase per complete step, whereas \(\lambda=1.2\) is the factor by which the state is multiplied. Confusing these two quantities produces incorrect updates.
Density-dependent growth
Unlimited geometric growth eventually becomes unrealistic. A discrete logistic model is
where \(K\) is carrying capacity and \(r\) controls the per-step response to crowding.
- When \(N_n\) is much smaller than \(K\), growth is approximately proportional to \(N_n\).
- When \(N_n=K\), the added change is zero.
- When \(N_n>K\), the crowding term is negative.
Unlike the continuous logistic ODE, the discrete model can oscillate or become highly irregular when \(r\) is large. Discrete updating is therefore not merely a different notation for the same dynamics.
Equilibria
An equilibrium \(N^*\) remains unchanged by the update. For a model \(N_{n+1}=F(N_n)\), it satisfies
For the discrete logistic model, the equilibria are \(N^*=0\) and \(N^*=K\). Finding an equilibrium does not establish whether nearby trajectories approach it. Stability must also be checked.
Local stability
For a one-dimensional update \(N_{n+1}=F(N_n)\), an equilibrium is locally stable when
The derivative measures how a small deviation is multiplied during one update. A magnitude below one makes sufficiently small deviations shrink. A negative derivative can make deviations alternate from one side of the equilibrium to the other.
Difference equation versus ODE
| Difference equation | Ordinary differential equation |
|---|---|
| Separate time points | Continuous time |
| Specifies the next state | Specifies instantaneous rate |
| \(N_{n+1}=F(N_n)\) | \(dN/dt=f(N)\) |
| Step length is part of the biological model | Time varies continuously |
Euler’s method also produces a difference equation, but there the update is a numerical approximation to an underlying ODE. In a genuinely discrete biological model, the update rule itself is the model.
Deterministic updating versus a DTMC
A deterministic difference equation gives one definite next state from the current state. A discrete-time Markov chain instead assigns probabilities to possible next states. Both use fixed time points, but only the DTMC represents random transitions. The detailed construction of DTMC epidemic models belongs to the Python programming pathway.
Conditions and limitations
- Define what one time step represents biologically.
- Keep growth factors and per-step rates conceptually distinct.
- Check that updates preserve non-negativity and any population bounds.
- Do not assume that a smaller numerical step represents the same biological model unless the rule was derived for that step.
- Examine equilibrium stability; an equilibrium value alone does not describe nearby behaviour.
- Declare whether non-integer results represent counts, densities or expectations.
What this lesson adds
You can now build and iterate a difference equation, distinguish growth factors from proportional change, find equilibria, interpret local stability, and explain the differences between a discrete biological model, an ODE approximation and a DTMC.