← Mathematical Foundations

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

\[N_{n+1}=\lambda N_n,\]

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

SymbolMeaning
\(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

\[N_1=120,\qquad N_2=144,\qquad N_3=172.8.\]

The general solution is

\[N_n=N_0\lambda^n.\]

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:

\[N_{n+1}-N_n=(r)N_n,\]

where \(r=\lambda-1\) is the proportional change per step. Rearranging gives

\[N_{n+1}=(1+r)N_n.\]

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

\[N_{n+1}=N_n+rN_n\left(1-\frac{N_n}{K}\right),\]

where \(K\) is carrying capacity and \(r\) controls the per-step response to crowding.

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

\[N^*=F(N^*).\]

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

\[\left|F'(N^*)\right|<1.\]

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 equationOrdinary differential equation
Separate time pointsContinuous time
Specifies the next stateSpecifies instantaneous rate
\(N_{n+1}=F(N_n)\)\(dN/dt=f(N)\)
Step length is part of the biological modelTime 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

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.