Darts
The expression rand(1,n) computes a row of n random numbers between 0 and 1.
Let d2 be the distance squared from the center of the circle.
>> d2 = (x .^ 2) + (y .^ 2);
Let in be a row of 0’s and 1’s signifying whether the dart is in (1) or not in (0) the circle. Note 1 is used for true and 0 for false.
Let hits be the cumulative sum of darts in circle
Let f be cumulative fraction of hits
Let pi be successive approximations to pi