Lesson 6 of 15

Convergence Tests

Convergence Tests

Several tests help determine whether a series converges without computing the sum.

Ratio Test

For (\sum a_n) with (a_n > 0), compute:

L=limnan+1anL = \lim_{n \to \infty} \frac{a_{n+1}}{a_n}

  • If (L < 1), the series converges
  • If (L > 1), the series diverges
  • If (L = 1), the test is inconclusive

Root Test

Compute:

L=limnannL = \lim_{n \to \infty} \sqrt[n]{|a_n|}

Same conclusion rules as the ratio test.

Comparison Test

If (0 \le a_n \le b_n) for all (n) and (\sum b_n) converges, then (\sum a_n) converges.

Numerical Approximation

We approximate the limit in the ratio/root test using large (n):

def ratio_test(f, n=1000):
    return f(n + 1) / f(n)

Your Task

Implement:

  1. ratio_test(f, n) -- returns (f(n+1) / f(n)) as an approximation of the ratio test limit
  2. root_test(f, n) -- returns (|f(n)|^{1/n}) as an approximation of the root test limit
  3. convergence_verdict(L) -- returns "converges" if (L < 1), "diverges" if (L > 1), "inconclusive" if (L = 1)
Pyodide loading...
Loading...
Click "Run" to execute your code.