Inspired by Joma's favorite interview question Can you solve my favorite interview question? (math + cs), this project further visualizes the dots within the circle and those out of the circle.
This question uses random to generate number from 0 to 1 and ask the number pi.
The trick behind this question is that we have to imagine a circle with radius 1 and a square with a side length of 1.
The 4 times of the radius between the number of point within the circle and the total number of point is pi!
For more, we can look up Monte Carlo, using abundant random number to obtain a targeted result.
-
Notifications
You must be signed in to change notification settings - Fork 0
OssieLin/Pi-Estimate
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published