Absolute Convergence and the Ratio and Root Tests
Absolute convergence is the robust kind of convergence: it survives any reordering and it lets you test series with arbitrary signs. The ratio and root tests decide it by comparing a series with a geometric one, and this lesson proves both.
The Convergence Tests survey shows the ratio test in action; here we prove it and its sibling.
Absolute and conditional convergence
A series is absolutely convergent if converges, and conditionally convergent if converges but does not (the alternating harmonic series, from Alternating Series).
Theorem. Absolute convergence implies convergence.
Proof. For every , . Since converges, the Comparison Test (see The Comparison Tests) makes converge. Then
is a difference of two convergent series, so it converges. ∎
Example: has signs in no pattern, but , so it converges absolutely.
Note: Absolutely convergent series can be rearranged freely without changing the sum (Dirichlet's theorem), and two of them can be multiplied term by term (Cauchy product). Riemann's rearrangement theorem says conditionally convergent series have neither property.
The Ratio Test
Let (possibly ).
Proof (). Pick with . Since the ratios tend to , there is with for all . By induction
so the tail of is dominated by the geometric series , which converges because . Comparison finishes the proof.
Proof (). Eventually , so does not tend to 0, and the Test for Divergence applies.
Why says nothing. For and the ratios are and , both , yet one diverges and the other converges. The ratio test only detects geometric-speed decay; -series decay polynomially.
The Root Test
Let . The verdicts are the same as for the ratio test.
Proof (). Pick . Eventually , that is : a direct comparison with a geometric series. For , eventually , so .
The root test is the natural choice when appears in an exponent, as in : here , so it converges.
It is also strictly stronger: whenever the ratio limit exists, the root limit exists and is equal, but the root test can work when the ratios jump around. For the ratios alternate between 2 and (no limit), while .
import math
def ratio(a, n):
return abs(a(n + 1) / a(n))
def root(a, n):
return abs(a(n)) ** (1 / n)
series = {
"n^5 / 3^n": lambda n: n**5 / 3**n,
"n! / n^n": lambda n: math.factorial(n) / n**n,
"(n/(2n+1))^n": lambda n: (n / (2 * n + 1)) ** n,
"2^(-n+(-1)^n)": lambda n: 2.0 ** (-n + (-1) ** n),
}
for name, a in series.items():
rs = [round(ratio(a, n), 4) for n in (20, 21, 100)]
ts = [round(root(a, n), 4) for n in (20, 21, 100)]
print(f"{name:15s} ratio {rs} root {ts}")n^5 / 3^n ratio [0.4254, 0.4206, 0.3503] root [0.7049, 0.6882, 0.4196]
n! / n^n ratio [0.3769, 0.3765, 0.3697] root [0.4152, 0.4133, 0.3799]
(n/(2n+1))^n ratio [0.4999, 0.4999, 0.5] root [0.4878, 0.4884, 0.4975]
2^(-n+(-1)^n) ratio [0.125, 2.0, 0.125] root [0.5176, 0.4838, 0.5035]
Reading the table: has both tests heading to (slowly, because fights the for a long time). has ratio . The last row shows the ratio test failing to settle while the root test gives .
Growth rates: why these tests suit algorithm analysis
The ratio test is really a statement about growth rates. If , then grows or shrinks roughly like . That ranking is the same one used in complexity analysis:
- For a polynomial the ratio : no geometric factor.
- For the ratio is exactly .
- For the ratio is : faster than every exponential.
So converges for every (ratio ), which means eventually beats any exponential . In code this explains why a brute-force search (all permutations, as in the naive Traveling Salesman solver) becomes hopeless much sooner than an subset search:
import math
for n in (10, 15, 20, 25):
print(f"n={n:2d} 2^n={2**n:>10,} n!={math.factorial(n):>34,} n!/2^n ratio step={(n + 1) / 2:.1f}")n=10 2^n= 1,024 n!= 3,628,800 n!/2^n ratio step=5.5
n=15 2^n= 32,768 n!= 1,307,674,368,000 n!/2^n ratio step=8.0
n=20 2^n= 1,048,576 n!= 2,432,902,008,176,640,000 n!/2^n ratio step=10.5
n=25 2^n=33,554,432 n!=15,511,210,043,330,985,984,000,000 n!/2^n ratio step=13.0
Each step multiplies by , which is the ratio test's quotient for that sequence; once it is above 1 the gap only widens.
Exercises
Exercise 1: Absolute, conditional, or divergent?
Classify a) , b) , c) .
Answer
a) absolutely convergent, b) conditionally convergent, c) divergent.
Solution
Exercise 2: Ratio test with a factorial
Decide .
Answer
It diverges: .
Solution
With 2 instead of 5 the limit is and the series converges; is the borderline.
Exercise 3: Root test
Decide .
Answer
It converges absolutely: .
Solution
Exercise 4: Code a test helper
Write estimate_L(a) that prints for using logarithms (so large factorials do not overflow), and apply it to and .
Answer
The first tends to , slowly (5.0, 0.79, 0.54 at ), so it converges. The second gives , so neither the root nor the ratio test decides it.
Solution
Work with and divide by . math.lgamma(n + 1) is .
import math
def estimate_L(log_a):
for n in (10, 100, 1000):
print(f" n={n:4d}: |a_n|^(1/n) ≈ {math.exp(log_a(n) / n):.4f}")
print("n^10 / 2^n")
estimate_L(lambda n: 10 * math.log(n) - n * math.log(2))
print("4^n (n!)^2 / (2n)!")
estimate_L(lambda n: n * math.log(4) + 2 * math.lgamma(n + 1) - math.lgamma(2 * n + 1))n^10 / 2^n
n= 10: |a_n|^(1/n) ≈ 5.0000
n= 100: |a_n|^(1/n) ≈ 0.7924
n=1000: |a_n|^(1/n) ≈ 0.5358
4^n (n!)^2 / (2n)!
n= 10: |a_n|^(1/n) ≈ 1.1896
n= 100: |a_n|^(1/n) ≈ 1.0292
n=1000: |a_n|^(1/n) ≈ 1.0040
Test yourself
For the ratio tends to 1. What can you conclude?
- The series converges
- Nothing from this test
- The series diverges
- It converges conditionally
What does the proof of the ratio test compare the series with?
- A -series
- An integral
- A geometric series with ratio between and 1
- The harmonic series
Which series is conditionally convergent?