Shared-uniform counterexample to the second Borel-Cantelli lemma (source code)

= Shared-uniform counterexample to the second Borel-Cantelli lemma

Choose one <random variable> $U$ with the <continuous uniform distribution> on $[0,1]$, and reuse it in every <event>:
$$
A_n=\left\{U\leq\frac1{n+1}\right\},\qquad n\geq1.
$$
Each <probability> is $1/(n+1)$, so their <harmonic series> diverges, just as in <summable and harmonic event probabilities>. But the <events> are decreasing: $A_{n+1}\subseteq A_n$. For every outcome $U=u>0$, all indices with $n+1>1/u$ fail. Only finitely many <events> occur on that outcome. The <limsup of events> is exactly $\{U=0\}$, a <zero-probability event>. This is a concrete closed-interval version of the shrinking-interval dependence example.<Probability: Theory and Examples (fifth edition) by Rick Durrett>[§2.3, Example 2.3.6, printed p. 70: shrinking intervals with divergent total probability]{ref}

The missing assumption is visible already in two <events>. For $i<j$, their <intersection> is $A_j$, hence
$$
\mathbb P(A_i\cap A_j)=\frac1{j+1}
\ne\frac1{(i+1)(j+1)}=\mathbb P(A_i)\mathbb P(A_j).
$$
Moreover, the whole tail <union> is just $A_m$, with <probability> $1/(m+1)\to0$. This calculation explains directly why divergence alone fails: overlapping <events> keep spending their individual <probabilities> on the same outcomes.

Let $N=\sum_{n\geq1}\mathbf1_{A_n}$ be the total number of occurrences, a sum of <indicator random variables>. Although $N<\infty$ <almost surely>, <Tonelli theorem> gives $\mathbb E[N]=\sum_{n\geq1}1/(n+1)=\infty$. More explicitly, $\mathbb P(N\geq k)=1/(k+1)$ for $k\geq1$: very small positive values of $U$ give very long, but finite, initial runs. Infinite <expected value> does not imply a positive <probability> of an infinite count.

\Image[/borel-cantelli-independent-and-shared-uniform-traces.png]
{title=Equal harmonic event probabilities with fresh independent inputs or one shared input}
{description=Each row is one finite simulation of the <indicator random variables> of $A_n$ for $1\leq n\leq120$; a dot means the <event> occurred. Fresh <independent random variables> allow scattered returns; a shared <uniform random variable> yields an initial run followed by zeros. The horizontal axis uses a <logarithmic scale> to show early runs clearly. These finite simulations illustrate the two models and cannot prove infinitely many occurrences or eventual stopping.}