MonteCarloPiEstimator is an algorithm that uses the Monte Carlo method to estimate the value of π. The Monte Carlo method is a numerical simulation technique that uses random numbers to obtain approximate results. The algorithm generates random points in a square of side 1 and counts how many of them are inside a quarter circle of radius 1. The ratio between the two numbers, multiplied by 4, gives an estimate of π.
The algorithm is written in C#, an object-oriented and cross-platform programming language. To run the algorithm, you need to have the .NET Framework1 or the .NET Core2 installed on your system. Moreover, you need to have an IDE or a text editor that supports the C# language, such as Visual Studio3, Visual Studio Code or MonoDevelop.
To use the algorithm, follow these steps:
- Clone or download the GitHub repository of the project.
- Open the file Program.cs with your IDE or text editor.
- Compile and run the code.
- Enter the number of attempts to make when prompted.
- Wait for the result of the estimate of π.
The algorithm is distributed under the MIT license, which allows the use, modification and distribution of the code to anyone, as long as the same license is maintained and the authorship of the original author is recognized. The algorithm is based on the Monte Carlo method, which was invented by Stanislaw Ulam and John von Neumann in the 1940s.