How to compute 'pi' with a gun [Comment calculer 'pi' avec un fusil ]

How to compute 'pi' with a gun [Comment calculer 'pi' avec un fusil].




It suffices to use a square target with an inscribed circle inside. Then shoot randomly the target. In this picture there are NG=20692 shots inside the circle (Green points) and NR=5719 outside (Red points). The full square contains NG+NR=20692+5719=26411 points (Green and Red). Please note that two shots fired at the same point count as one and only one.

R being the circle radius, the areas of the circle and the square are respectively:

                            2
                    C = pi*R
 
                             2
                    S = (2*R)

K being a certain constant, C and S can be approximated using the point numbers:
                    
                    C ~ K*NG
                    
                    S ~ K*(NG+NR)
Hence:
                                2
                     C      pi*R      pi
                    --- = -------- = ----
                     S          2     4
                           (2*R)
 
                            C          K*NG         20692
                    pi = 4*--- ~ 4*----------- = 4*------- = 3.13
                            S       K*(NG+NR)       26411

assuming a perfect random process...


(CMAP28 WWW site: this page was created on 09/08/2021 and last updated on 06/04/2026 23:21:52 -CEST-)



[See the generator of this picture [Voir le générateur de cette image]]

[See all related pictures (including this one) [Voir toutes les images associées (incluant celle-ci)]]

[Please visit the related ImagesDidactiques picture gallery [Visitez la galerie d'images ImagesDidactiques associée]]
[Please visit the related NumberTheory picture gallery [Visitez la galerie d'images NumberTheory associée]]

[Go back toMathematics - A Virtual Instrument For Exploring Space Time And Beyond [Retour à {a chapter of 'Mathematics-AVirtualInstrumentForExploringSpaceTimeAndBeyond'}]]

[The Y2K Bug [Le bug de l'an 2000]]
[Are we ready for the Year 2038 [Notre informatique est-elle prête pour l'An 2038]?]

[Site Map and Help [Plan du Site et Aide]]
[Mail [Courrier]]
[About Pictures and Animations [A Propos des Images et des Animations]]


Copyright © Jean-François COLONNA, 2021-2026.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2021-2026.