Ad
  • Custom User Avatar

    This is a fun introduction to what's called "Monte Carlo integration". I like to describe it as "the drunkard's dartboard".

    It's also even slower at converging than the 4/1 - 4/3 + 4/5 - 4/7 + ... arctangent series. The error in an average of n random values is proportional to 1/sqrt(n), while the arctangent series error is proportional to 1/n.

    So, if averaging N trials gives you 2 decimal places of pi, you'll need 100N trials to get 3 decimal places.