If area of the inscribed circle is πr2, then the area of square is 4r2. The probability of a random point landing inside the circle is thus π/4. This probability is numerically found by choosing random points inside the square and seeing how many land inside the circle (red ones). Multiplying this probability by 4 gives us π.
