Basically, It throws a dart at a random position and then sees if it lands in the square or the circle. It counts as being in both the square and the circle if it lands in the circle, but not the other way around. Pi would be roughly C/S*4 where C is the number of darts that lands in the circle, and S would be the number of darts that lands in the square. The more darts that are thrown, the more accurate the approximation would be.