- 1. Sequences with Maple.
- 2. Using Maple to investigate the formal definition of the limit of a sequence.
- 3. Sequences-pattern recognition.
- 4. The graph of a sequence.

In Maple, a sequence is distinguished from a set by using square brackets instead of curly braces to list the elements. Thus defines a sequence which has four terms, but is a set which contains only the 3 elements 1, 2 and 3. A sequence can be given by listing the elements as above, in which case,

to get the third term, we would type in
**S[3]**
and we would get 2 for the answer. Note that if we define S as a set, then
**S[3]**
will not give the same answer. Try some examples to get a better sense of what is going on.

To generate sequences in mathematics, it is convenient if we can just give a rule for how to compute the n'th term (this really makes sense since a sequence is simply a function whose domain is the Natural numbers). Maple allows us to do the same, using the command
**seq**
. For example to obtain the first eighteen terms of the sequence
, we could type in

`> `
**seq(sqrt(n-3),n=3..20);**

Notice that the result is not given in square braces, so in order to make a sequence in the mathematical sense from this output, we have to enclose the result in square brackets like the following:

`> `
**S:=[seq(sqrt(n-3),n=3..20)];**

Now we can retrieve the fourth element by just typing in

`> `
**S[4];**

Strictly speaking, Maple calls the output of the
**seq**
command a sequence, and a sequence enclosed in square braces is called a list. But we will call such lists sequences as well. Also, the
**seq**
command cannot be used to create infinite sequences.

We can plot a sequence on a vertical axis (the traditional range axis for a function) by plotting a sequence of ordered pairs whose
*x*
-coordinate is zero.

Error, missing operator or `;`

`> `
**T:=[seq([0,S[n]],n=1..18)];**

`> `
**plot(T,-.1..0.1,style=point,symbol=circle,scaling=constrained);**

(You may have to grab the graph with your mouse and stretch it to make it look right).

Again, since a sequence is a function we may want to graph the ordered pairs (n,s(n)), so this time, we make the

*x*
-coordinate
*n*
, and the
*y*
-coordinate S[
*n*
].

`> `
**T:=[seq([n,S[n]],n=1..18)];plot(T,style=point,symbol=diamond);**

To get Maple to evaluate the limit of a sequence, you must enter the rule determining the terms in the limit command.

For example:

`> `
**limit(sqrt(n-3),n=infinity);**

Error, (in limit) invalid limiting point

**Submission:**

Use Maple to create a list of the first 20 terms of the sequence . Then make pictures as above.

Finally, estimate the limit of the sequence from the picture, and then find the actual limit using the limit command.

**Submission worksheet:**

`> `

**2.**
**Using Maple to investigate the formal definition of the limit of a sequence.**

Recall the formal definition of the limit of a sequence. It looks alot like the definition of the limit of a function, so it should be easy to remember.

=
*L *
if for every
where
there is an
*N*
such that
implies

Consider the sequence , we first create a graph of enough terms to guess the limit, and then we make a graph illustrating the N corresponding to .

`> `
**plot([seq([n,n/(n+1)],n=1..50)],style=point);**

The graph shows that is a good guess for the limit. Now to find the N corresponding to

, try various starting values for n in the plot above.

`> `
**plot([seq([n,n/(n+1)],n=2..100)],style=point);**

`> `
**plot([seq([n,n/(n+1)],n=5..100)],style=point);**

`> `
**plot([seq([n,n/(n+1)],n=9..100)],style=point);**

It looks like if , then the , so the N called for in the definition can be taken as N=9.

**Submission:**

(a) Use a graph to guess the value of the limit .

(b) Use a graph of the sequence in part (a) to find the smallest values of
*N *
that correspond to
= 0.1 and

= 0.001 .

**Submission worksheet:**

`> `

**3. **
**Sequences-pattern recognition.**
** **

A
sequence
is a function whose
domain
is the set of
positive integers
. Depending on the context, we can define these objects in different ways with Maple. For instance, the sequence whose
*n*
'th term is given by
can be defined as a function of the variable
*n*
as follows:

`> `
**a1:=n->n/(2*n+1);**

Also, if we only want to look at a few of the terms of the sequence, we could use the seq command in Maple to generate them as follows:

`> `
**a2 := [seq(n/(2*n+1),n=1..20)];**

What are the differences? In a1, we can ask for the 500th element of the sequence, but since we only generated 20 elements for a2 we can't do this. Also, there is a subtle distinction in how you refer to an element of the sequence with these two notations. Suppose, for example, we want the 15th element. Then notice the use of the
**parentheses**
and
**square braces**
below:

`> `
**a1(15); a2[15];**

On the other hand, what if we try to print the 500'th element in the sequence.

`> `
**a1(500); a2[500];**

Error, invalid subscript selector

The error message results because a2[500] is not defined.

**Submission:**

For the following sequences:

a) Find a formula for the sequence as a function.

b) Use the seq command to generate the first 25 terms of the sequence.

c) Check that both versions give the same value for the 20'th element of the sequence.

1)
,
**. . . **

2)
,
** . . .**

3)
,
**. . . **

4)
,
**. . .**

**Submission worksheet:**

`> `

In order to investigate properties of a sequence it is sometimes helpful to look at its graph. The graph of a sequence can be thought of as a set of ordered pairs where the first coordinate is always a positive integer. Thus the graph of a sequence is a collection of
**disconnected**
dots.
** **
To plot such objects with Maple, we must give it a list of ordered pairs. For example, to get a graph of (a finite portion) of the sequence in the example in activity 1, we plot the first 100 pairs as follows:

`> `
**plot([seq([n,n/(2*n+1)],n=1..100)],style=point);**

This graph is pretty helpful to us in determining properties of the sequence. First, it looks as if the sequence is monotonically increasing, and appears to be bounded about by 1/2, which would make it convergent by the Monotone Sequence Theorem. In fact, the sequence appears to converge to 1/2, which we can verify directly, by using Maple to take a limit.

`> `
**Limit(n/(2*n+1),n=infinity)=limit(n/(2*n+1),n=infinity);**

Error, (in Limit) unable to determine value of limit variable

Since the limit as of both the numerator and denominator is , we can use L'Hopital's rule to calculate this limit as well.

`> `
**Limit(n/(2*n+1),n=infinity)=diff(n,n)/diff(2*n+1,n);**

Error, (in Limit) unable to determine value of limit variable

The method of graphing can also yield evidence that a series which is not monotonic converges, and allow one to estimate the value to which the sequence converges. For example, consider the graph of the sequence below.

`> `
**plot([seq([n,(-2/3)^n],n=1..100)],style=point);**

The sequence appears to be bounded both above (by 4/9) and below (by -2/3), alternating between positive and negative values, and convergent to 0. Let us confirm this fact by taking the limit in Maple.

`> `
**Limit((-2/3)^n,n=infinity)=limit((-2/3)^n,n=infinity);**

Error, (in Limit) unable to determine value of limit variable

**Submission:**

For the sequences below,

a) Graph the first 100 terms of the sequence.

b) Decide if the graph indicates that the sequence is monotone increasing or decreasing, or neither.

c) Estimate the limit from the graph

d) Confirm your limit estimate by using Maple to compute the limit.

1)

2)

3)

4)

**Submission worksheet:**

`> `

`> `

`> `