L15-sequence2.mws

Calculus II

Lesson 15: Convergence of Sequences

Sequence Convergence

We have used sequences lots of times before. The sequence of estimates to the solution of an equation generated by Newton's Method is one. The sequence of estimates to the integral of a function over an interval obtained by subdividing the interval into more and more subintervals is another. These are examples of potentially infinite sequences. These are sequences we hope converge to the answer we seek, whether it be the solution of an equation or the value of an integral.

Formally, a sequence of numbers is defined as a function f whose domain is the positive integers. The terms of the sequence are the values of the function. So for example the 10th term of the sequence f is f(10).

A sequence f converges to a limit L if each interval containing L contains all but finitely many terms of the sequence. In this case, we would write limit(f(n),n = infinity) = L .

The Maple word limit can be used to calculate many limits of sequences in a painfree manner. For example,

> limit((1+1/n)^n,n=infinity);

exp(1)

The next theorems summarize many of the properties of convergent sequences.

Theorem: If a[n] is an increasing sequence (ie, a[i] <= a[i+1] for all i ), then a[n] converges if there is an upper bound on the terms of a[n] .

Theorem: If a[n] converges to L and b[n] converges to M , then a[n]*b[n] converges to LM , a[n]+b[n] converges to L+M , and a[n]-b[n] converges to L-M . Also, if M <> 0 , then a[n]/b[n] converges to L/M .

Theorem: If a[n] is a sequence of positive numbers and b[n] is a sequence which converges to 0, then if a[n] <= b[n] for all n , then a[n] converges to 0.

Theorem: If f is continuous at x = L , and a[n] is a sequence converging to L , then the sequence f(a[n]) converges to f(L) .

>

Periodic Points of functions.

Let f be a function, and let a be a point in the domain of f. If each value of f is in the domain of f, we can generate the sequence of iterates of a under f as follows: a[1] = f(a) , a[2] = f(a[1]) , and in general a[n+1] = f(a[n]) for each positive integer n. If n is a positive integer such that a[n] = a , but a[i] <> a for for all positive integers i < n, then a is called a periodic point of period n for f.

Period one points are called fixed points . You can locate the fixed points of a function by looking to see where the graphs of y = f(x) and y = x cross. For example, the cosine function has one fixed point, as we can see by plotting.

> plot({cos(x),x},x=-Pi..Pi);

[Maple Plot]

To find the fixed point more precisely, use fsolve .

> fix := fsolve(cos(x)=x,x,0..Pi);

fix := .7390851332

An attracting fixed point is a fixed point a with the property that for points b close to a,

> limit(b[n],n=infinity) = a;

limit(b[n],n = infinity) = a

where b[1] = b , and b[n] = f(b[n-1]) for n = 2, 3 ...

A repelling fixed point is a fixed point a with the property that for points b close (but not equal) to a,

> limit(b[n],n=infinity) <> a;

limit(b[n],n = infinity) <> a

where b[1] = b , and b[n] = f(b[n-1]) for n = 2, 3 , ... .

~

Here is a simple procedure to investigate periodic points and fixed points of a function.

> iterate := proc(f,n,x)
local a,i,s;
a := evalf(x);
s := a;
for i to n do a := f(a);
s := s,a od
end:

For example, to investigate whether the fixed point of the cosine function is attracting or not, we can iterate the function at a point near the fixed point. Using the fixed point of the cos function,

> fix := fsolve(cos(x)=x,x);

fix := .7390851332

> iterate(cos,10,fix-1),fix;

-.2609148668, .9661543793, .5684675409, .8427269503...
-.2609148668, .9661543793, .5684675409, .8427269503...

The fixed point seems to be an attracting one. On the other hand if we look at the fixed points of 2x(1-x),

> f := x-> 2*x*(1-x);

f := proc (x) options operator, arrow; 2*x*(1-x) en...

> fix := fsolve(f(x)=x,x);

fix := 0, .5000000000

> iterate(f,10,fix[1]-.2);

-.2, -.48, -1.4208, -6.87894528, -108.3976669, -237...
-.2, -.48, -1.4208, -6.87894528, -108.3976669, -237...

> iterate(f,10,fix[1]+.1);

.1, .18, .2952, .41611392, .4859262512, .4996038592...

> iterate(f,10,fix[2]+.4);

.9000000000, .1800000000, .2952000000, .4161139200,...
.9000000000, .1800000000, .2952000000, .4161139200,...

It seems that 0 is an repelling fixed point and that .5 is an attracting fixed point. Let's define a visual word to go with iterate. We have added a domain and range to allow you to determine the viewing window.

> viterate := proc(f,n,start,domain,range)
local a, i, s, gra, gpl, fpl, ipl;
a := evalf(start);
gra := [a,f(a)];
for i to n do a := f(a);
gra := gra,[a,a],[a,f(a)];
od:
gpl := plot([gra],color=red);
fpl := plot(f,domain,color=black);
ipl := plot(x->x,domain,color=blue);
print(plots[display]([gpl,fpl,ipl],view=[domain,range]));
end:

> viterate(x->2*x*(1-x),10,.8,-1..1 ,-1..1);

[Maple Plot]

This gives a nice visual tool to investigate fixed points and periodic points of functions.

Problems

Exercise: Use iterate or viterate to check more starting points close the the fixed point of cos. Do you remain convinced that it is a repelling fixed point?

> fx := fsolve(cos(x)=x,x);

fx := .7390851332

> viterate(cos,10,.1,-1..2,-1..1);

[Maple Plot]

2. Find the periodic points of period 2 of y = 2*x*(1-x) . . (Hint: the period points of order two of f would be the fixed points of `@@`(f,2) which are not fixed points of f. Classify them as repelling, attracting, or neither.

Exercise: Let a[n] be a sequence of positive numbers converging to 0. Imagine yourself starting at the origin and travelling east a[1] miles, then turning north and going a[2] miles, then west a[3] miles, and so forth, cycling through the directions as you go through the sequence a[n] . (1) Where do you end up? (2) How far do you travel along your path. Work the answers out for the sequences 1/n and 1/(2^n) .

Solution:

Call the point where we end up [x,y]. Then x = a1-a3+a5-a7 ..., the sum of the alternating series of odd terms of the sequence a[n] and y is the sum of the alternating series of even terms of the sequene. So for the sequence

> a := n-> 1/n;

a := proc (n) options operator, arrow; 1/n end proc...

> x = sum((-1)^n*a(2*n+1),n=0..infinity);

x = 1/4*Pi

> y = sum((-1)^n*a(2*(n+1)),n=0..infinity);

y = 1/2*ln(2)

and for the sequence

> a := n-> 1/2^n;

a := proc (n) options operator, arrow; 1/(2^n) end ...

> x = sum((-1)^n*a(2*n+1),n=0..infinity);

x = 2/5

> y = sum((-1)^n*a(2*(n+1)),n=0..infinity);

y = 1/5

(2) The total distance we travel along the path is the sum of all the distances travelled. So for the sequence

> a := n->1/n;

a := proc (n) options operator, arrow; 1/n end proc...

> 'distance' = sum(a(n),n=1..infinity);

distance = infinity

the distance is infinity! This is perhaps surprizing at first, since each time we turn we go a smaller distance than the last time. On the other hand, for the sequence

> a := n->1/2^n;

a := proc (n) options operator, arrow; 1/(2^n) end ...

> 'distance' = sum(a(n),n=1..infinity);

distance = 1

The distance travelled is only 1 unit.

Exercise: Suppose we wanted to draw the paths described in the above problem. Here is a procedure which will do that. Use it to draw the paths for the sequences an = 1/n , and an = 1/(2^n) .

> cycle := proc(a,m)
local path,i, dir,x,y,pt,ed;
x := evalf(sum((-1)^n*a(2*n+1),n=0..infinity));
y := evalf(sum((-1)^n*a(2*(n+1)),n=0..infinity));
path := [0,0];
dir := 1,0;
for i from 1 to m do
path := path,[path[i][1]+dir[1]*a(i),
path[i][2]+dir[2]*a(i)];
dir := -dir[2],dir[1];
od;
pt := plot([path],scaling=constrained,color=red,thickness=2);
ed := plot({[x,y]},style=point,symbol=box):
plots[display]([pt,ed],title=cat("end at ",convert([x,y],string)));
end:

Solution:

For the sequenc 1/n

> cycle(n->1/n,15);

[Maple Plot]

> cycle(n->1/2^n,15);

[Maple Plot]