Looking closer at the law of rare events it seems that possibly you're setting the window too large and/or the circumferance too small to see the limit convergence to the Poisson distribution. Your description refers to an 9-size window but the code uses 10% of the circumference (100). Fixing the range test per BrowserUK's post and setting the window to 9 seems to pull up similar numbers for mean and variance.