Omniadisce

Computational physics 17.2: Estimating π with random points

Lesson Beginner

Join free to take this lesson

Anyone can look around, but taking a lesson needs a free account. With one, your answers are checked step by step and your progress is saved, so you can stop and pick up where you left off on any device.

9 steps · about 25 min

By the end you can

  • Make random points in a square from two arrays of random numbers
  • Test which points are inside a quarter circle with x2 + y2 < 1
  • Estimate π as 4 × inside ÷ N
  • Work out the error of the estimate against np.pi

Who it is for: Anyone who has done lesson 17.1, and physics lesson 3.1 (Pythagoras).

The steps

  1. A circle in a square
  2. The test for inside
  3. Inside or outside?
  4. What share?
  5. From a count to π
  6. Your estimate of π
  7. How far off?
  8. Two seeds
  9. Why estimate π?

Discussion 0 comments

Log in to join the discussion.

× Enlarged view