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:
- If (L < 1), the series converges
- If (L > 1), the series diverges
- If (L = 1), the test is inconclusive
Root Test
Compute:
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:
ratio_test(f, n)-- returns (f(n+1) / f(n)) as an approximation of the ratio test limitroot_test(f, n)-- returns (|f(n)|^{1/n}) as an approximation of the root test limitconvergence_verdict(L)-- returns"converges"if (L < 1),"diverges"if (L > 1),"inconclusive"if (L = 1)
Pyodide loading...
Loading...
Click "Run" to execute your code.