
Hi Community Members,
A solution to last week’s challenge can be found here.
This challenge was submitted by Ashley Talai (@aatalai). Thank you, Ashley, for this week’s challenge, as we celebrate Pi Day!
Every year in the United States, March 14, or 3/14, is Pi (π) Day! Pi is a mathematical constant represented by the Greek letter pi (π) that is the ratio of a circle’s circumference to its diameter, approximately equal to 3.14159.
Among many methods available to estimate pi, one is called the Monte Carlo simulation. This method helps solve problems by simulating randomness. The Monte Carlo simulation for pi is a probabilistic method used to estimate its value using random sampling. The technique leverages the relationship between a square and an inscribed quarter circle, calculating pi based on the proportion of randomly generated points that fall inside a circle.
The datasets for this challenge contain randomly generated coordinates for X and Y within a square. The scope is limited to 100 rows for each dataset. X and Y are uniformly distributed between 0 and 1.
Your task for this challenge is to estimate pi and the percentage of variance from actual pi. To do so, you need to:
- Combine the X and Y coordinates.
- Determine whether a point is inside or outside the circle.
- Calculate the total number of simulations.
- Calculate the total number of simulations inside the circle.
- Finally, calculate the estimation of pi and the percentage of variance from actual pi.
HINT: If you find yourself stuck, check out our hints in the workflow file as to how to estimate pi.
If you would like more information regarding the Monte Carlo simulation, check out this article: Estimating Pi with Monte Carlo in Excel.
Need a refresher? Review the following lessons in Academy to gear up:
Good luck!
The Academy Team
Source:
https://en.wikipedia.org/wiki/Pi#:~:text=The%20number%20%CF%80%20(%2Fpa%C9%AA,diameter%2C%20approximately%20equal%20to%203.14159.