Mathematical biology Some of the best-known difference equations have their origins in the attempt to model
population dynamics. For example, the
Fibonacci numbers were once used as a model for the growth of a rabbit population. The
logistic map is used either directly to model population growth, or as a starting point for more detailed models of population dynamics. In this context, coupled difference equations are often used to model the interaction of two or more
populations. For example, the
Nicholson–Bailey model for a host-
parasite interaction is given by :N_{t+1} = \lambda N_t e^{-aP_t} :P_{t+1} = N_t(1-e^{-aP_t}), with N_t representing the hosts, and P_t the parasites, at time t.
Integrodifference equations are a form of recurrence relation important to spatial
ecology. These and other difference equations are particularly suited to modeling
univoltine populations.
Computer science Recurrence relations are also of fundamental importance in
analysis of algorithms. If an
algorithm is designed so that it will break a problem into smaller subproblems (
divide and conquer), its running time is described by a recurrence relation. A simple example is the time an algorithm takes to find an element in an ordered vector with n elements, in the worst case. A naive algorithm will search from left to right, one element at a time. The worst possible scenario is when the required element is the last, so the number of comparisons is n. A better algorithm is called
binary search. However, it requires a sorted vector. It will first check if the element is at the middle of the vector. If not, then it will check if the middle element is greater or lesser than the sought element. At this point, half of the vector can be discarded, and the algorithm can be run again on the other half. The number of comparisons will be given by :c_1=1 :c_n=1+c_{n/2} the
time complexity of which will be O(\log_2(n)).
Digital signal processing In
digital signal processing, recurrence relations can model feedback in a system, where outputs at one time become inputs for future time. They thus arise in
infinite impulse response (IIR)
digital filters. For example, the equation for a "feedforward" IIR
comb filter of delay T is: :y_t = (1 - \alpha) x_t + \alpha y_{t - T}, where x_t is the input at time t, y_t is the output at time t, and \alpha controls how much of the delayed signal is fed back into the output. From this we can see that :y_t = (1 - \alpha) x_t + \alpha ((1-\alpha) x_{t-T} + \alpha y_{t - 2T}) :y_t = (1 - \alpha) x_t + (\alpha-\alpha^2) x_{t-T} + \alpha^2 y_{t - 2T} etc.
Economics Recurrence relations, especially linear recurrence relations, are used extensively in both theoretical and empirical economics. In particular, in macroeconomics one might develop a model of various broad sectors of the economy (the financial sector, the goods sector, the labor market, etc.) in which some agents' actions depend on lagged variables. The model would then be solved for current values of key variables (
interest rate, real
GDP, etc.) in terms of past and current values of other variables. ==See also==