Code
using Distributions, Plots, Statistics, Random, LaTeXStrings
Random.seed!(1234)
S = 100
n = 2:400
distribution = Exponential(1)
dgp(n) = rand(distribution, n)
μ = mean(distribution)
fig = plot()
for s in 1:S
data = dgp(maximum(n))
plot!(fig, n, abs.(mean.(data[1:i] for i in n) .- μ), alpha=0.2, label=false, color=:blue)
end
plot!(fig, n, 1 ./ sqrt.(n), label=L"n^{-1/2}", color=:red, lw=3)
fig