SigmaField
Mathematical Foundations for Quant Finance
0 of 256 lessons
      1. 1.5.1 SequencesConcept · 25 min
      2. 1.5.2 Arithmetic and geometric seriesConcept · 20 min
      3. 1.5.3 Infinite series and when they convergeConcept · 25 min
      4. 1.5.4 Practice set: seriesPractice set · 20 min
      5. 1.5.5 Case study: annuities, perpetuities and bond pricesCase study · 35 min

Level 1, Precalculus 1.5 Sequences and series Lesson 3 of 5

ConceptLesson 1.5.3 in Level 1, Precalculus. About 25 minutes.

Infinite series and when they converge

What an infinite sum means

A series with no last term, such as 12+14+18+⋯\frac{1}{2} + \frac{1}{4} + \frac{1}{8} + \cdots, cannot be added up term by term. Instead, add the first nn terms to get the partial sum SnS_n (lesson 1.5.2). Then ask whether the sequence S1,S2,S3,…S_1, S_2, S_3, \ldots has a limit (lesson 1.5.1).

nn12351020
SnS_n0.50.750.8750.968750.999020.99999905
1−Sn1 - S_n0.50.250.1250.031250.000980.00000095

The partial sums close in on 1, and the gap 1−Sn1 - S_n halves with every term: it is 12n\frac{1}{2^n}. A square shows why.

Each piece fills half of what is still empty. After nn pieces the empty part is 12n\frac{1}{2^n}, so the filled area closes in on the whole square, 1.

Rule: Sum of an infinite series

∑k=1∞ak=lim⁡n→∞Sn\sum_{k=1}^{\infty} a_k = \lim_{n \to \infty} S_n

If the partial sums have a limit, the series converges and that limit is its sum. If they have none, the series diverges and has no sum. The sum has the same units as the terms.

Try it

np.cumsum gives every partial sum at once (lesson 1.5.2). The last column is the gap 1−Sn1 - S_n.

Python writes very small numbers in e-notation: 9.5367431640625e-07 means 9.54×10−79.54 \times 10^{-7}, the gap after 20 terms.

⌘/Ctrl + Enter runs the cell

The infinite geometric series

Lesson 1.5.2 gave the partial sums of a geometric series with first term aa and ratio rr:

Sn=a 1−rn1−rS_n = a\,\frac{1 - r^n}{1 - r}

Only rnr^n changes as nn grows. When ∣r∣<1|r| < 1, lesson 1.5.1 showed that rn→0r^n \to 0, so SnS_n settles on a1−r\frac{a}{1 - r}. The gap left after nn terms is the part that vanishes: a rn1−r\frac{a\,r^n}{1 - r}.

Rule: Infinite geometric series

a+ar+ar2+⋯=a1−ronly when ∣r∣<1\begin{gathered} a + ar + ar^2 + \cdots = \frac{a}{1 - r} \\ \text{only when } |r| < 1 \end{gathered}

The first term over one minus the ratio. After nn terms the partial sum still misses by a rn1−r\frac{a\,r^n}{1 - r}, which shrinks to 0.

For 12+14+⋯\frac{1}{2} + \frac{1}{4} + \cdots, a=12a = \frac{1}{2} and r=12r = \frac{1}{2}, so the sum is 1/21−1/2=1\frac{1/2}{1 - 1/2} = 1. The gap after nn terms is (1/2)(1/2)n1/2=12n\frac{(1/2)(1/2)^n}{1/2} = \frac{1}{2^n}, as in the table.

A table and the algebra

Take 3+34+316+⋯3 + \frac{3}{4} + \frac{3}{16} + \cdots, with a=3a = 3 and r=14r = \frac{1}{4}. The partial sums are 3, 3.75, 3.9375, 3.984375, 3.99609375, and after 10 terms 3.99999619. The algebra gives the limit: 31−1/4=4\frac{3}{1 - 1/4} = 4.

Repeating decimals

A repeating decimal is an infinite geometric series. 0.999…0.999\ldots is 0.9+0.09+0.009+⋯0.9 + 0.09 + 0.009 + \cdots, with a=0.9a = 0.9 and r=0.1r = 0.1, so it equals 0.91−0.1=1\frac{0.9}{1 - 0.1} = 1 exactly.

0.272727…0.272727\ldots is 0.27+0.0027+⋯0.27 + 0.0027 + \cdots, with a=0.27a = 0.27 and r=0.01r = 0.01. Its sum is 0.270.99=2799=311\frac{0.27}{0.99} = \frac{27}{99} = \frac{3}{11}.

Try it

infinite_geometric is the rule above. The first two lines show the partial sums of 3+34+⋯3 + \frac{3}{4} + \cdots approaching the formula's 4.

The last line agrees with 311\frac{3}{11} up to rounding in the final digit.

⌘/Ctrl + Enter runs the cell

Every ratio

A negative ratio gives an alternating series. 1−12+14−⋯1 - \frac{1}{2} + \frac{1}{4} - \cdots has a=1a = 1 and r=−12r = -\frac{1}{2}, so its sum is 11−(−1/2)=23\frac{1}{1 - (-1/2)} = \frac{2}{3}. Its partial sums 1, 0.5, 0.75, 0.625, 0.6875 land above and below 23\frac{2}{3} in turn, ever closer.

Geometric partial sums settle on a1−r\frac{a}{1 - r}, from one side or from both. The harmonic sums keep rising by about 2.3 every time nn is multiplied by 10, while the sums of 1n2\frac{1}{n^2} level off.

When ∣r∣≥1|r| \ge 1 the series diverges. The terms never shrink, so the partial sums never settle.

rrseriespartial sumswhat they do
11+1+1+⋯1 + 1 + 1 + \cdots1, 2, 3, 4, 5grow without end
−1-11−1+1−⋯1 - 1 + 1 - \cdots1, 0, 1, 0, 1bounce for ever
21+2+4+⋯1 + 2 + 4 + \cdots1, 3, 7, 15, 31grow without end
−2-21−2+4−⋯1 - 2 + 4 - \cdots1, −1-1, 3, −5-5, 11swing wider and wider

The formula gives an answer anyway, and it is wrong. For r=2r = 2 it says 11−2=−1\frac{1}{1 - 2} = -1, a negative sum of positive terms. For r=−1r = -1 it says 12\frac{1}{2}, a value the partial sums never take.

Rule: Terms must shrink to 0

an↛0  ⟹  the series diverges\begin{gathered} a_n \not\to 0 \;\Longrightarrow\; \text{the series diverges} \end{gathered}

If the terms do not tend to 0, each new term keeps moving the partial sum by a sizeable amount, so it cannot settle. Check this before reaching for a formula.

Try it

The cell prints the first six partial sums for each ratio in the text: one that converges and the four that do not.

NumPy prints the whole-number cases without decimal points.

⌘/Ctrl + Enter runs the cell
Check yourself
Which of these series has a sum?

Try every ratio yourself. Slide rr from 0.9 up to 1 and past it, then to −1-1 and below, and watch the dots settle, climb or bounce. The harmonic series, the subject of the next section, is one of the choices too.

Explore

Each dot is a partial sum: the total of the first n terms. Change the series and the ratio and see which totals settle on a number.

01020304000.511.52
Term number 10
0.001953
Total of 10 terms
S10 = 1.998047
Still to go
0.001953
Verdict
The partial sums settle on 2.

Shrinking terms are not enough

The harmonic series 1+12+13+14+⋯1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \cdots has terms that shrink to 0. Yet its partial sums grow without end, only very slowly.

nn101001,00010,000100,0001,000,000
harmonic SnS_n2.9295.1877.4859.78812.09014.393
1+14+19+⋯1 + \frac{1}{4} + \frac{1}{9} + \cdots1.5497681.6349841.6439351.6448341.6449241.644933

Each tenfold increase in nn adds about 2.30 to the harmonic sum, close to ln⁡10\ln 10 (lesson 1.4.3). The sum passes any number you name, given enough terms, so the series diverges. The Proof Gym (stage PG5) proves it.

Squaring the bottoms changes everything. 1+14+19+116+⋯1 + \frac{1}{4} + \frac{1}{9} + \frac{1}{16} + \cdots converges: its partial sums level off at π26≈1.644934\frac{\pi^2}{6} \approx 1.644934. Both series have terms that shrink to 0; only one has a sum.

Rule: Shrinking terms are necessary, not enough

an→0  ⟹  check further\begin{gathered} a_n \to 0 \;\Longrightarrow\; \text{check further} \end{gathered}

Terms that tend to 0 allow a sum but do not promise one. Compare with a series you know, or watch the partial sums as nn is multiplied by 10.

Try it

Partial sums of both series up to a million terms, rounded. dtype=float keeps n2n^2 exact: in the browser, whole-number arrays may be 32-bit, and would overflow past about 2 billion.

The harmonic sums keep climbing. The sums of 1n2\frac{1}{n^2} match π26\frac{\pi^2}{6}, the last line, to five decimal places after a million terms.

⌘/Ctrl + Enter runs the cell

How many terms for a given accuracy

In practice you stop after nn terms and accept a small error. For a geometric series that error is the gap from the rule above. Logarithms (lesson 1.4.4) then say how many terms make it smaller than a tolerance.

Example 1. For 12+14+⋯\frac{1}{2} + \frac{1}{4} + \cdots, the gap after nn terms is 0.5n0.5^n. To be within 10−610^{-6} of 1, solve 0.5n<10−60.5^n < 10^{-6}. Taking logs gives nln⁡0.5<ln⁡10−6n \ln 0.5 < \ln 10^{-6}.

Now divide by ln⁡0.5\ln 0.5, which is negative, so the inequality flips (lesson 0.3.3): n>ln⁡10−6ln⁡0.5≈19.93n > \frac{\ln 10^{-6}}{\ln 0.5} \approx 19.93. The first whole number is 20. Check: the gap is 1.9×10−61.9 \times 10^{-6} after 19 terms and 9.5×10−79.5 \times 10^{-7} after 20.

Example 2. For 1+0.9+0.81+⋯1 + 0.9 + 0.81 + \cdots, the sum is 11−0.9=10\frac{1}{1 - 0.9} = 10 and the gap is 0.9n0.1=10×0.9n\frac{0.9^n}{0.1} = 10 \times 0.9^n. Within 0.01 needs 0.9n<0.0010.9^n < 0.001, so n>ln⁡0.001ln⁡0.9≈65.56n > \frac{\ln 0.001}{\ln 0.9} \approx 65.56: 66 terms. A ratio close to 1 converges slowly.

Rule: Terms needed for a tolerance

gap after n terms=∣a∣ ∣r∣n1−rgap<tol  whenn>ln⁡(tol (1−r)/∣a∣)ln⁡∣r∣\begin{gathered} \text{gap after } n \text{ terms} = \frac{|a|\,|r|^n}{1 - r} \\ \text{gap} < \text{tol} \ \text{ when} \\ n > \frac{\ln\big(\text{tol}\,(1 - r) / |a|\big)}{\ln |r|} \end{gathered}

For ∣r∣<1|r| < 1. Take the first whole number above the bound. A negative ratio uses its size ∣r∣|r|; the bottom 1−r1 - r stays as it is.

Without a formula for the gap, watch it numerically. For 1+14+19+⋯1 + \frac{1}{4} + \frac{1}{9} + \cdots the gap after nn terms is close to 1n\frac{1}{n}: 0.0952 after 10 terms, 0.00995 after 100, 0.0009995 after 1,000. Three correct decimals cost a thousand terms.

Try it

terms_needed adds terms until the gap drops below the tolerance. It agrees with the log bounds: 20 and 66. The third line is the alternating 1−12+⋯1 - \frac{1}{2} + \cdots to within 0.001.

The last loop measures the gap of 1n2\frac{1}{n^2} directly, from π26\frac{\pi^2}{6}.

⌘/Ctrl + Enter runs the cell

Case study 1.5.5 uses the infinite geometric series to price a payment that never stops. Level 2 writes functions such as exe^x as infinite series (module 2.7), and the question of how many terms you need returns there.

Common mistakes

  1. a1−r\frac{a}{1 - r} needs ∣r∣<1|r| < 1. 1+2+4+⋯1 + 2 + 4 + \cdots has no sum, even though 11−2=−1\frac{1}{1 - 2} = -1.
  2. aa is the first term actually added. For 12+14+⋯\frac{1}{2} + \frac{1}{4} + \cdots, a=12a = \frac{1}{2}, not 1, and the sum is 1, not 2.
  3. Keep the sign of a negative ratio. 1−12+14−⋯1 - \frac{1}{2} + \frac{1}{4} - \cdots is 11+1/2=23\frac{1}{1 + 1/2} = \frac{2}{3}, not 11−1/2=2\frac{1}{1 - 1/2} = 2.
  4. Shrinking terms do not guarantee a sum, as the harmonic series shows. They are needed, but not enough.
  5. A partial sum is not the sum. S20S_{20} of 12+14+⋯\frac{1}{2} + \frac{1}{4} + \cdots is 0.99999905, close to 1 but not 1.
  6. Flip the inequality when you divide by ln⁡∣r∣\ln |r|. For ∣r∣<1|r| < 1 it is negative, so << becomes >>.

Infinite series

0 of 12 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.
  8. 8.
  9. 9.
  10. 10.
  11. 11.
  12. 12.
How to type answers
  • Powers with ^: x^7, 2^(1/3), a^-2.
  • Multiply with * or by writing side by side: 3x^2, 2(x+1).
  • ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
  • sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
  • Your first answer to each question is saved: it counts towards your score and brings the question back for review.
  • Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.

Summary card

  • An infinite series means the limit of its partial sums SnS_n. If they settle, it converges; if not, it diverges.
  • a+ar+ar2+⋯=a1−ra + ar + ar^2 + \cdots = \frac{a}{1 - r} when ∣r∣<1|r| < 1, because rn→0r^n \to 0. Otherwise it diverges, whatever the formula says.
  • A negative ratio gives partial sums on both sides of the limit. r=1r = 1 grows, r=−1r = -1 bounces.
  • If the terms do not tend to 0, the series diverges. If they do, check further: ∑1n\sum \frac{1}{n} diverges, ∑1n2\sum \frac{1}{n^2} converges.
  • The gap after nn terms of a geometric series is ∣a∣∣r∣n1−r\frac{|a||r|^n}{1 - r}. Set it below the tolerance and solve with logs.

Free further reading

Optional. This lesson covers what you need; these add more examples and practice. All are free to read.