CONTENTS

Exercise: The LLN Fails — Running Mean of i.i.d. Cauchy

Problem

The standard Cauchy distribution has density f(x)=π1(1+x2)1f(x) = \pi^{-1}(1 + x^2)^{-1}. It has no finite mean — the integral xf(x)dx\int_{-\infty}^\infty x f(x)\,dx does not exist in the Lebesgue sense.

  1. Simulate N=106N = 10^6 i.i.d. standard Cauchy draws and plot the running mean Xˉn\bar X_n for n=1,2,,Nn = 1, 2, \ldots, N on a log-scale x-axis. Describe what you see. Does the running mean appear to converge?

  2. Repeat part 1 with three different random seeds (e.g. seed = 0, 1, 2). Overlay the three running means on the same plot. Do they converge to the same limit? Do they converge to any limit?
  3. Explain in two or three sentences why the LLN does not apply to the Cauchy distribution. Which assumption of the LLN is violated?

  4. Now consider the running median instead of the running mean. Simulate it and verify that the running median does converge to zero. Why does the LLN's failure for means not imply failure for medians?

Hint

rng.standard_cauchy(size=N) gives an array of Cauchy draws. For the running median, use np.median(X[:n]) for each nn, or a more efficient streaming-median structure if performance matters.
Jump to the solution when you're ready.