On this page
Toss a fair coin forever. How long are the longest runs of heads compared with the number of tosses so far? Whether an event happens infinitely often or only finitely often is settled by two short results named after Émile Borel and Francesco Paolo Cantelli, who stated them in the first decades of the 20th century (Wikipedia: Borel–Cantelli lemma). Borel's paper appeared in 1909 in the Rendiconti del Circolo Matematico di Palermo (DOI record).
This is university probability, but you only need tools a JEE student already has: summing a series and checking whether it converges.
What does the Borel–Cantelli lemma say?
Take a sequence of events A_1, A_2, A_3 and so on. Mathematicians write "A_n i.o." (infinitely often) for the event that infinitely many of them happen.
First Borel–Cantelli lemma: if the sum of P(A_n) over all n is finite, then P(A_n i.o.) = 0, as stated in Theorem 2.3.1 of Rick Durrett's textbook Probability: Theory and Examples.
The proof is one line. Let N be the number of events that happen. The expected value of N is the sum of the P(A_n), which is finite, so N itself must be finite with probability 1. Nothing here asks whether the events affect each other: the first lemma needs no independence (Wikipedia).
A quick example from the same Wikipedia article: if P(X_n = 0) = 1/n², the probabilities add up to π²/6, so with probability 1 the value X_n is zero for only finitely many n.
What is the second Borel–Cantelli lemma?
Second Borel–Cantelli lemma: if the events A_n are independent and the sum of P(A_n) is infinite, then P(A_n i.o.) = 1 (Theorem 2.3.7 in Durrett).
Independence does its work in the proof. The chance that none of A_M, ..., A_N happens is the product of the (1 − P(A_n)). Since 1 − x ≤ e^(−x), that product is at most e^(−sum of P(A_n)), which goes to 0 when the sum diverges. So after any point M, some later event is certain to happen.
Independence can be weakened to pairwise independence, though the proof becomes harder; this is due to N. Etemadi in 1983 (Wikipedia).
Why does independence matter?
Without independence, a divergent sum proves nothing. Durrett's Example 2.3.6 (Probability: Theory and Examples) picks a random point x between 0 and 1 and lets A_n be the event that x lies in (0, 1/n). Then P(A_n) = 1/n and the harmonic series diverges, yet any x lies in (0, 1/n) only while n < 1/x, so only finitely many A_n happen. The events are nested, not independent.
Blunter still: let every A_n be the same event, "the first toss is heads". The probabilities add to infinity, but A_n happens infinitely often with probability 1/2, not 1.
How long is the longest run of heads in n tosses?
This is Durrett's Example 2.3.12 (Probability: Theory and Examples). Let ℓ_n be the length of the run of heads ending at toss n, and L_n the longest run in the first n tosses. For a fair coin, P(ℓ_n = k) = (1/2)^(k+1), so the chance that the run ending at toss n is at least k long is (1/2)^k.
Upper bound. Put k = (1 + ε) log₂ n for any ε > 0. Then P(ℓ_n ≥ k) is at most n^−(1+ε), which sums. By the first lemma, only finitely many tosses end a run that long.
Why not use the second lemma for the lower bound? With k = log₂ n the probability is 1/n and the harmonic series diverges, but runs ending at tosses n and n + 1 share tosses, so the events are not independent.
The fix. Cut the first n tosses into disjoint blocks of length about (1 − ε) log₂ n. Blocks share no tosses, so they are independent, and the chance that no block is all heads is at most exp(−n^ε / (2 log₂ n)). That sums too, so the first lemma applies again.
The conclusion is that L_n / log₂ n → 1 with probability 1. For 1,024 tosses, log₂ n is 10, so the yardstick for the longest run is about 10 heads. The book's Exercise 2.3.3 adds a twist: the run ending at toss n keeps climbing back near log₂ n, yet also drops to 0 infinitely often.
A three-question checklist
What exactly is A_n? Write it as a sentence about the n-th trial.
Does the sum of P(A_n) converge? Compare it with 1/n^p: p > 1 converges, p ≤ 1 diverges.
If it diverges, are the events independent? If not, look for independent pieces, as the disjoint blocks were.
If the series tests in step 2 feel shaky, the Fermi Concept Library covers every concept in mathematics, so you can patch the gap. When a proof stalls, the Fermi Problem Library has a step-by-step solver that explains the reasoning rather than printing an answer.



