The two loops generate
7 independent samples of 100 values,
6 independent samples of 1000 values,
... and 2 independent samples of 10000000 values.
I wanted to explore the variability of estimates as a function of sample size while keeping the total size of the simulation within reasonable bounds.
This is not quite equivalent to @Reeza's proposition as those consecutive estimates are not independent. But both approaches are instructive.
As for the original question. In numerical analysis, we say that an iterative procedure diverges when the results start moving farther away from the objective, at some point. So, technically, the long/short mean simulation is NOT diverging, as it keeps (very slowly) moving closer to the true value, which is infinity.
What this exercise demonstrates imho is that random simulation can be a very poor estimator sometimes.
... View more