Home » Monte Carlo Estimation of Pi

Monte Carlo Estimation of Pi

1950

A classic illustration of the Monte Carlo method is estimating the value of \(\pi\). By inscribing a circle of radius \(r\) within a square of side length \(2r\), the ratio of their areas is \(\frac{\pi r^2}{(2r)^2} = \frac{\pi}{4}\). Randomly scattering points within the square and counting the fraction \(p\) that fall inside the circle provides an estimate: \(\pi \approx 4p\).

The procedure for estimating [latex]\pi[/latex] is straightforward and highlights the core Monte Carlo principle. Consider a unit square in the Cartesian plane with vertices at (0,0), (1,0), (1,1), and (0,1). A quarter circle of radius 1 is inscribed within this square, centered at the origin. The area of the square is 1, and the area of the quarter circle is \(\frac{\pi(1)^2}{4} = \frac{\pi}{4}\). The ratio of the quarter circle’s area to the square’s area is therefore \(\frac{\pi}{4}\).

To estimate this ratio, we generate a large number, \(N\), of random points \((x, y)\) where both \(x\) and \(y\) are uniformly distributed between 0 and 1. Each point has an equal chance of landing anywhere within the square. A point \((x, y)\) falls inside the quarter circle if its distance from the origin is less than or equal to 1, which is determined by the condition \(x^2 + y^2 \le 1\). We count the number of points, \(M\), that satisfy this condition. The ratio \(\frac{M}{N}\) is an estimate of the ratio of the areas, \(\frac{\pi}{4}\). Therefore, we can approximate \(\pi\) as \(\pi \approx 4 \frac{M}{N}\). According to the law of large numbers, as \(N\) approaches infinity, this approximation converges to the true value of \(\pi\). However, the convergence is slow, with the error decreasing proportionally to \(\frac{1}{\sqrt{N}}\), making it a very inefficient method for calculating \(\pi\) to high precision compared to deterministic algorithms.

UNESCO Nomenclature: 1202
– Computer sciences

Type

Software/Algorithm

Disruption

Incremental

Usage

Widespread Use

Precursors

  • concept of pi as the ratio of a circle’s circumference to its diameter
  • cartesian coordinate system
  • pythagorean theorem
  • uniform probability distribution
  • development of pseudo-random number generators

Applications

  • pedagogical tool for teaching probability and simulation
  • simple benchmark for random number generators
  • introductory problem in computational science courses

Patents:

NA

Potential Innovations Ideas

Professionals (100% free) Membership Required

You must be a Professionals (100% free) member to access this content.

Join Now

Already a member? Log in here
Related to: pi, estimation, Monte Carlo, simulation, random numbers, area, probability, numerical integration, circle, square.

Leave a Reply

Your email address will not be published. Required fields are marked *

AVAILABLE FOR NEW CHALLENGES
Mechanical Engineer, Project, Process Engineering or R&D Manager
Effective product development

Available for a new challenge on short notice.
Contact me on LinkedIn
Plastic metal electronics integration, Design-to-cost, GMP, Ergonomics, Medium to high-volume devices & consumables, Lean Manufacturing, Regulated industries, CE & FDA, CAD, Solidworks, Lean Sigma Black Belt, medical ISO 13485

We are looking for a new sponsor

 

Your company or institution is into technique, science or research ?
> send us a message <

Receive all new articles
Free, no spam, email not distributed nor resold

or you can get your full membership -for free- to access all restricted content >here<

Related Invention, Innovation & Technical Principles

Scroll to Top

You May Also Like