User Tools

Site Tools


estimate_pi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
estimate_pi [2018/10/02 23:08]
cthiel
estimate_pi [2018/10/02 23:09] (current)
cthiel
Line 8: Line 8:
 [[https://​mathorama.com/​pisim.mov|{{:​screen_shot_2018-10-02_at_7.52.17_pm.png}}]] [[https://​mathorama.com/​pisim.mov|{{:​screen_shot_2018-10-02_at_7.52.17_pm.png}}]]
  
-It takes a while to run this simulation to determine an approximate value for π.  Write a program ​using a ''​for''​ loop or a ''​while''​ loop that can run 100,000 dart throws more quickly. ​+It takes a while to run this simulation to determine an approximate value for π.  Write a simple text only program ​that uses a ''​for''​ loop or a ''​while''​ loop so that can run 200,000 dart throws more quickly ​the the graphical version
  
 This works since the ratio of the Area of a circle divided by the Area of the square is pi*r^2 / (2r)^2 = pi/4. The ratio of the darts that land in the circle divided by the darts thrown on the square should be the same ratio, pi/4 (if we throw enough random darts!). So 4 times this proportion is pi! This works since the ratio of the Area of a circle divided by the Area of the square is pi*r^2 / (2r)^2 = pi/4. The ratio of the darts that land in the circle divided by the darts thrown on the square should be the same ratio, pi/4 (if we throw enough random darts!). So 4 times this proportion is pi!
estimate_pi.txt · Last modified: 2018/10/02 23:09 by cthiel