An equation whose solution is a sequence (e.g. 0, 1, 1, 2, 3, 5, 8, .... See Fibonacci numbers & Bernoulli's method). Since a sequence is merely a function defined on a set of integers the theory of difference equations is often similar to the theory of differential equations.

They play an important role in numerical analysis and also in combinatorial analysis, economics, ecology and probability.

# Examples

The difference equation for the sequence above (where s_{0} = 0, s_{1} = 1, etc..) is:

s_{n} - s_{n-1} - s_{n-2} = 0. (See Bernoulli's method.)

The difference equation s_{n} - s_{n-1} - n = 0 (positive integers) has a solution s_{n} = n(n + 1)/2 (there are other solutions).

**Order** of the equation

s_{n} + s_{n-1} = 0, for example, is called an equation of *order* 1.

s_{n} + s_{n-1} + s_{n-2} = 0 is of

*order* 2, etc..

**Linear** equations

- s
_{n} - s_{n-1} - n^{2}s_{n-2} = 1 is called **"linear."**
- s
_{n} - 2(s_{n-1})^{2} = 0 is not.