Build independent events whose probabilities tend to zero but whose probabilities sum to infinity. Their indicator variables converge to zero in probability because a deviation at any one late index is unlikely. The second Borel–Cantelli lemma gives infinitely many deviations along almost every path, so almost sure convergence to zero fails.
Choose events that are rare individually and recur infinitely often
Convergence in probability to means that for every ,
Almost sure convergence means . For a fixed , let . The event that deviations of this size recur infinitely often is
If is summable for every positive rational , the first Borel–Cantelli lemma gives almost sure convergence. It requires no independence. For a counterexample, choose independent with and a divergent sum. Then the second Borel–Cantelli lemma gives . Taking separates the two definitions.
The subtle difference is the quantifier. Convergence in probability asks whether the chance of a large error at index goes to zero as you move that index out. Almost-sure convergence asks whether, for almost every complete sequence, there is some last large error. The first Borel–Cantelli lemma says summable error probabilities rule out infinitely many such errors, even without independence. For a counterexample you therefore want probabilities that tend to zero but have a divergent sum. Independence then lets the second lemma give the opposite conclusion.
Check both modes of convergence for the same sequence
Let be independent uniform random variables on and set . For any , the deviation probability from zero is . For , it is zero at every . This proves convergence in probability.
To see why almost sure convergence fails even without quoting the lemma, calculate the probability of a run with no spikes from through . Independence gives
Letting grow shows the probability of no spikes from onward is zero. Taking the countable union over all shows the probability of eventually having no spikes is also zero. Since takes only the values zero and one, convergence to zero would require exactly that eventual behaviour.
Now reuse a single uniform variable at every date in place of . The marginal probabilities are identical. Along any path with , however, the threshold eventually falls below and the indicator stays at zero. This comparison isolates the role of dependence.