1 Preliminaries: Sequences and Difference Equations

1.1 Sequences

A sequence is a set of numbers formed according to some definite rule. For example the sequence

{ 1 , 4 , 9 , 16 , 25 , } ( 1 )

is formed by the squares of the positive integers.

If we write

y 1 = 1 , y 2 = 4 , y 3 = 9 ,

then the general or n t h term of the sequence (1) is y n = n 2 . The notations y ( n ) and y [ n ] are also used sometimes to denote the general term. The notation { y n } is used as an abbreviation for a whole sequence.

An alternative way of considering a sequence is to view it as being obtained by sampling a continuous function. In the above example the sequence of squares can be regarded as being obtained from the function

y ( t ) = t 2

by sampling the function at t = 1 , 2 , 3 , as shown in Figure 1.

Figure 1

No alt text was set. Please request alt text from the person who provided you with this resource.

The notation y ( n ) , as opposed to y n , for the general term of a sequence emphasizes this sampling aspect.

Task!

Find the general term of the sequence { 2 , 4 , 8 , 16 , 32 , } .

The terms of the sequence are the integer powers of 2: y 1 = 2 = 2 1 y 2 = 4 = 2 2

y 3 = 8 = 2 3 so y n = 2 n . Here the sequence { 2 n } are the sample values of the continuous function y ( t ) = 2 t at t = 1 , 2 , 3 ,

An alternative way of defining a sequence is as follows:

  1. give the first term y 1 of the sequence
  2. give the rule for obtaining the ( n + 1 ) th term from the n th .

A simple example is

y n + 1 = y n + d y 1 = a

where a and d are constants.

It is straightforward to obtain an expression for y n in terms of n as follows:

y 2 = y 1 + d = a + d y 3 = y 2 + d = a + d + d = a + 2 d y 4 = y 3 + d = a + 3 d y n = a + ( n 1 ) d

(2)

This sequence characterised by a constant difference between successive terms

y n + 1 y n = d n = 1 , 2 , 3 ,

is called an arithmetic sequence.

Task!

Calculate the n th term of the arithmetic sequence defined by

y n + 1 y n = 2 y 1 = 9 .

Write out the first 4 terms of this sequence explicitly.

Suggest why an arithmetic sequence is also known as a linear sequence.

We have, using (2),

y n = 9 + ( n 1 ) 2 or

y n = 2 n + 7

so y 1 = 9 (as given), y 2 = 11 , y 3 = 13 , y 4 = 15 ,

A graph of y n against n would be just a set of points but all lie on the straight line y = 2 x + 7 , hence the term ‘linear sequence’.

No alt text was set. Please request alt text from the person who provided you with this resource.

1.2 Nomenclature

The equation

y n + 1 y n = d (3)

is called a difference equation or recurrence equation or more specifically a first order, constant coefficient, linear, difference equation.

The sequence whose n th term is

y n = a + ( n 1 ) d (4)

is the solution of (3) for the initial condition y 1 = a .

The coefficients in (3) are the numbers preceding the terms y n + 1 and y n so are 1 and 1 respectively.

The classification first order for the difference equation (3) follows because the difference between the highest and lowest subscripts is n + 1 n = 1.

Now consider again the sequence

{ y n } = { 2 n }

Clearly

y n + 1 y n = 2 n + 1 2 n = 2 n

so the difference here is dependent on n i.e. is not constant. Hence the sequence { 2 n } = { 2 , 4 , 8 , } is not an arithmetic sequence.

Task!

For the sequence { y n } = 2 n calculate y n + 1 2 y n . Hence write down a difference equation and initial condition for which { 2 n } is the solution.

y n + 1 2 y n = 2 n + 1 2 × 2 n = 2 n + 1 2 n + 1 = 0

Hence y n = 2 n is the solution of the homogeneous difference equation

y n + 1 2 y n = 0 (5)

with initial condition y 1 = 2.

The term ‘homogeneous’ refers to the fact that the right-hand side of the difference equation (5) is zero.

More generally it follows that

y n + 1 A y n = 0 y 1 = A

has solution sequence { y n } with general term

y n = A n

1.3 A second order difference equation

Second order difference equations are characterised, as you would expect, by a difference of 2 between the highest and lowest subscripts. A famous example of a constant coefficient second order difference equation is

y n + 2 = y n + 1 + y n or y n + 2 y n + 1 y n = 0 (6)

The solution { y n } of (6) is a sequence where any term is the sum of the two preceding ones.

Task!

What additional information is needed if (6) is to be solved?

Two initial conditions, the values of y 1 and y 2 must be specified so we can calculate

y 3 = y 2 + y 1 y 4 = y 3 + y 2

and so on.

Task!

Find the first 6 terms of the solution sequence of (6) for each of the following sets of initial conditions

  1. y 1 = 1 y 2 = 3
  2. y 1 = 1 y 2 = 1
  1.    { 1 , 3 , 4 , 7 , 11 , 18 }
  2.    { 1 , 1 , 2 , 3 , 5 , 8 , } (7)

The sequence (7) is a very famous one; it is known as the Fibonacci Sequence . It follows that the solution sequence of the difference equation (6)

y n + 1 = y n + 1 + y n

with initial conditions y 1 = y 2 = 1 is the Fibonacci sequence. What is not so obvious is what is the general term y n of this sequence.

One way of obtaining y n in this case, and for many other linear constant coefficient difference equations, is via a technique involving Z transforms which we shall introduce shortly.

1.4 Shifting of sequences

Right Shift

Recall the sequence { y n } = { n 2 } or, writing out the first few terms explicitly,

{ y n } = { 1 , 4 , 9 , 16 , 25 , }

The sequence { v n } = { 0 , 1 , 4 , 9 , 16 , 25 , }   contains the same numbers as y n but they are all shifted one place to the right. The general term of this shifted sequence is

v n = ( n 1 ) 2 n = 1 , 2 , 3 ,

Similarly the sequence

{ w n } = { 0 , 0 , 1 , 4 , 9 , 16 , 25 , }

has general term

w n = ( n 2 ) 2 n = 2 , 3 , 0 n = 1

Task!

For the sequence { y n } = { 2 n } = { 2 , 4 , 8 , 16 , } write out explicitly the first 6 terms and the general terms of the sequences v n and w n obtained respectively by shifting the terms of { y n }

  1. one place to the right
  2. three places the the right.
  1. { v n } = { 0 , 2 , 4 , 8 , 16 , 32 } v n = 2 n 1 n = 2 , 3 , 4 , 0 n = 1
  2. { w n } = { 0 , 0 , 0 , 2 , 4 , 8 } w n = 2 n 3 n = 4 , 5 , 6 , 0 n = 1 , 2 , 3

The operation of shifting the terms of a sequence is an important one in digital signal processing and digital control. We shall have more to say about this later. For the moment we just note that in a digital system a right shift can be produced by delay unit denoted symbolically as follows:

Figure 2

No alt text was set. Please request alt text from the person who provided you with this resource.

A shift of 2 units to the right could be produced by 2 such delay units in series:

Figure 3

No alt text was set. Please request alt text from the person who provided you with this resource.

(The significance of writing z 1 will emerge later when we have studied z transforms.)

Left Shift

Suppose we again consider the sequence of squares

{ y n } = { 1 , 4 , 9 , 16 , 25 , }

with y n = n 2 .

Shifting all the numbers one place to the left (or advancing the sequence) means that the sequence { v n } generated has terms

v 0 = y 1 = 1 v 1 = y 2 = 4 v 2 = y 3 = 9

and so has general term

v n = ( n + 1 ) 2 n = 0 , 1 , 2 ,

= y n + 1

Notice here the appearance of the zero subscript for the first time.

Shifting the terms of { v n } one place to the left or equivalently the terms of { y n } two places to the left generates a sequence { w n } where

w 1 = v 0 = y 1 = 1 w 0 = v 1 = y 2 = 4

and so on.

The general term is

w n = ( n + 2 ) 2 n = 1 , 0 , 1 , 2 ,

= y n + 2

Task!

If { y n } = { 1 , 1 , 2 , 3 , 5 , } n = 1 , 2 , 3 , is the Fibonacci sequence, write out the terms of the sequences { y n + 1 } , { y n + 2 } .

y n + 1 = { 1 , 1 , 2 , 3 , 5 , } where y 0 = 1 (arrowed), y 1 = 1 , y 2 = 2 ,

y n + 2 = { 1 , 1 , 2 , 3 , 5 , } where y 1 = 1 , y 0 = 1 (arrowed), y 1 = 2 , y 2 = 3 ,

  

It should be clear from this discussion of left shifted sequences that the simpler idea of a sequence ‘beginning’ at n = 1 and containing only terms y 1 , y 2 , has to be modified.

We should instead think of a sequence as two-sided i.e. { y n } defined for all integer values of n and zero. In writing out the ‘middle’ terms of a two sided sequence it is convenient to show by an arrow the term y 0 .

For example the sequence { y n } = { n 2 } n = 0 , ± 1 , ± 2 , could be written

{ 9 , 4 , 1 , 0 , 1 , 4 , 9 , }

  

A sequence which is zero for negative integers n is sometimes called a causal sequence.

For example the sequence, denoted by { u n } ,

u n = 0 n = 1 , 2 , 3 , 1 n = 0 , 1 , 2 , 3 ,

is causal. Figure 4 makes it clear why { u n } is called the unit step sequence .

Figure 4

No alt text was set. Please request alt text from the person who provided you with this resource.

The ‘curly bracket’ notation for the unit step sequence with the n = 0 term arrowed is

{ u n } = { , 0 , 0 , 0 , 1 , 1 , 1 , }

  

Task!

Draw graphs of the sequences { u n 1 } , { u n 2 } , { u n + 1 } where { u n } is the unit step sequence.

No alt text was set. Please request alt text from the person who provided you with this resource.