You are on page 1of 3

Practical 2B : Studying the

convergence and divergence of a


sequence by plotting the sequence
of partial sums
In[62]:= a[m _] := 1 / m
S[n_] := Sum [a[m], {m, 1, n}]
T = Table [S[n], {n, 1, 300 }];
ListPlot [T, PlotStyle → {Orange , PointSize [0.001 ]},
PlotRange → All, AxesLabel → {n, Sum }]
Sum

Out[65]=
3

n
50 100 150 200 250 300

In[13]:= Limit [S[n], n → Infinity ]


Out[13]= ∞
2

In[14]:= b[m _] := 1 / m ^ 2
S1 [n_] := Sum [b[m], {m, 1, n}]
T = Table [S1 [n], {n, 1, 200 }];
ListPlot [T, PlotStyle → {Red, PointSize [0.002 ]}, PlotRange → All, AxesLabel → {n, Sum }]
Sum

1.6

1.5

1.4

Out[17]=
1.3

1.2

1.1

1.0
n
50 100 150 200

In[18]:= Limit [S1 [n], n → Infinity ]


π2
Out[18]=
6

In[31]:= c[m _] := m ^ 2
S2 [n_] := Sum [c[m], {m, 1, n}]
T = Table [S2 [n], {n, 1, 225 }];
ListPlot [T, PlotStyle → {Green , PointSize [0.003 ]}, PlotRange → All, AxesLabel → {n, Sum }]
Sum
6
4 × 10

6
3 × 10

Out[34]= 6
2 × 10

6
1 × 10

n
50 100 150 200

In[35]:= Limit [S2 [n], n → Infinity ]


Out[35]= ∞
3

In[36]:= d[m _] := 1 / 2 ^ m
S3 [n_] := Sum [d[m], {m, 1, n}]
T = Table [S3 [n], {n, 1, 250 }];
ListPlot [T, PlotRange → All, PlotStyle → {Brown , PointSize [0.002 ]}, AxesLabel → {n, Sum }]
Sum

1.0

0.8

0.6
Out[39]=

0.4

0.2

n
50 100 150 200 250

In[40]:= Limit [S3 [n], n → Infinity ]


Out[40]= 1

You might also like