perl -e ' $runs = 10000000 ; do { $x = rand(1); $y = rand(1); $cnt++ if $x*$x + $y*$y>1 } foreach (1 .. $runs); print 4*(($runs-$cnt)/$runs)."\n"'