SharedMTHS120.ipynbOpen in CoCalc
Author: Thomas Kalinowski
Views : 1
Description: MTHS120 - plotting sequences

Plotting sequences

We plot the sequence an=cos(n)/na_n=\cos(n)/n for n=1,2,,100n=1,2,\dots,100.

In [1]:
p = points([(n,cos(n)/n) for n in range(1,101)]) show(p)

We add the graphs of the functions given by f(x)=1/xf(x)=1/x and g(x)=1/xg(x)=-1/x to illustrate that from limx1/x=0\lim_{x\to\infty}1/x=0 we can deduce limnan=0\lim_{n\to\infty}a_n=0.

In [2]:
x = var('x') p += plot(1/x,x,1,100,color='red') + plot(-1/x,x,1,100,color='red') show(p)
In [ ]: