---
title: A Simple Guide to Using Monte Carlo Simulation to Estimate Pi
description: A Simple Guide to Using Monte Carlo Simulation to Estimate Pi
---

[Minitab Blog](https://blog.minitab.com/en/blog)

# [A Simple Guide to Using Monte Carlo Simulation to Estimate Pi](https://blog.minitab.com/en/blog/michelle-paret/a-simple-guide-to-using-monte-carlo-simulation-to-estimate-pi-v2)

 Written by [Minitab Blog Editor](https://blog.minitab.com/en/blog/author/minitab-blog-editor) | Mar 23, 2015, 4:00:00 AM

Monte Carlo simulation has all kinds of [useful manufacturing applications](https://blog.minitab.com/blog/adventures-in-statistics/understanding-monte-carlo-simulation-with-an-example?hsLang=en). And - in celebration of [Pi Day](http://www.piday.org/) - I thought it would be apropos to show how you can even use Monte Carlo simulation to estimate pi, which of course is the mathematical constant that represents the ratio of a circle’s circumference to its diameter. For our example, let’s start with a circle of radius 1 inscribed within a square with sides of length 2.

We can then use Monte Carlo simulation to randomly sample points from within the square. More specifically, we can randomly sample points using a uniform distribution where the minimum is -1 and the maximum is +1:

Since:

Then the ratio of the two areas - we'll call it *r* - can be represented as:

We can use the Monte Carlo Simulation tool in [Companion by Minitab](http://www.minitab.com/products/companion/) to run a simulation with 1,000,000 iterations.

As shown in the output below, the results of the simulation are that 78.56% of the values will fall outside of the circle. (Since Monte Carlo simulation uses random sampling, this number will not be exactly the same every time you run a simulation.)

In other words, our *r* is 0.7856. Therefore, if we use the *r* value generated using Monte Carlo simulation, we have:

Solving for pi, we multiply 0.7856 \* 4 which gives us an approximation for pi of 3.1424. And that is how we can use Monte Carlo simulation to estimate pi.

[View full post](https://blog.minitab.com/en/blog/michelle-paret/a-simple-guide-to-using-monte-carlo-simulation-to-estimate-pi-v2)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Minitab Blog Editor"
  },
  "dateModified" : "2025-07-05T23:25:13.730Z",
  "datePublished" : "2015-03-23T04:00:00Z",
  "headline" : "A Simple Guide to Using Monte Carlo Simulation to Estimate Pi",
  "image" : {
    "@type" : "ImageObject",
    "height" : 864,
    "url" : "https://3447555.fs1.hubspotusercontent-na1.net/hubfs/3447555/B2BML%20-%20NEW%20FILE%20MANAGER%20STRUCTURE/Blog%20Images/Imported_Blog_Media/circleinsidesquare-3.jpg",
    "width" : 864
  },
  "mainEntityOfPage" : "https://blog.minitab.com/en/blog/michelle-paret/a-simple-guide-to-using-monte-carlo-simulation-to-estimate-pi-v2",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Minitab Blog"
  }
}
```