Description Arguments Value Author(s) Examples
Compute an approximation of pi using simulation. The idea is to take a certain number of points (B is the number) that goes from -1 to 1 and store they coordinate (x and y). Then using the fact that a circle has an area of pi we can calculate an aproximation of pi. We take the area of the square which is 4, times the total of point that are in the circle, divided by the total of point (B).
B |
A |
seed |
A |
A list
containing the following attributes:
Estimated value of pi
list of all the point that have been generated, we have their x and y coordinates and inside which tell us if the points is in the circle or outside
Julien Kleinmann, Constance Havret, Lumia Claramunt, Sana Ghali, Azza Akamoun
1 | estimate_pi( B=5000, seed = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.