in reply to Re: Monte Carlo approximation of PI
in thread Monte Carlo approximation of PI

But if you want to factor in the discreteness, with the same argumenation it follows that using <= 1 will lead to an overestimated pi.

Abigail

Replies are listed 'Best First'.
Re: Monte Carlo approximation of PI
by robartes (Priest) on Apr 04, 2003 at 12:10 UTC
    Indeed, well spotted. So to make the algorithm even slower, we might actually have to run it twice, once with  < 1 and once with  <= 1, and then take the average of the two. Oh well :).

    CU
    Robartes-

      I just ran a simulation with 16 million uniformely distributed points, and using both < 1 and <= 1 give estimates of 3.141020.

      Round-off errors probably pay their toll as well, even on my 64bit perl.

      Abigail

        OK. Let's file the < vs <= issue under 'premature (or even unnecessary) optimization' then (although not optimization in the speed sense :) ).

        CU
        Robartes-