Monte Carlo methods: Difference between revisions

m
Line 1,506:
const [x, y] = [rnd(), rnd()];
 
return (x ** x2) + (y ** y2) < 1 ? (
1 + a
) : a;
Line 1,535:
});
})();</lang>
 
{{Out}} For example:
<pre>1000 samples: 3.064
9,655

edits