Yichuan Shen

Blog

Blog

Month January, 2012 – View all

Monte Carlo Pi

Unit circle

Today we’re gonna calculate pi. You might say, it doesn’t seem too interesting; it’s an old hat. You may be true, but we’re going to calculate pi using a method, other than approximating a circle with a polygon. So here’s what we do:

  1. We draw the unit circle on our cartesian coordinate system.
  2. We randomly drop points on the square, which contains our unit circle.
  3. The probability of the point dropping on the circle is Pi/4

    Continue reading »