Question: Python 5.28 LAB: Buffon needle experiment The Buffon Needle Experiment was devised by Comte Georges-Louis Leclerc de Buffon (1707-1788), a French naturalist. In this experiment
Python
5.28 LAB: Buffon needle experiment The Buffon Needle Experiment was devised by Comte Georges-Louis Leclerc de Buffon (1707-1788), a French naturalist. In this experiment a 1 inch long needle is dropped onto paper that is ruled with lines 2 inches apart. If the needle drops onto a line, we count it as a hit. Buffon discovered the quotient of attempts/hits to be a very significant quantity. In this exercise, you will simulate this experiment to make the same discovery. The link to the full description of the lab is here ACTIVITY 5.28.1: LAB: Buffon needle experiment 0/15 main.py Load default template.. 1 from math import pi, sin 2 from random import random, seed 4 seed(2019) # Seeding the random number generator. Do not change this value 6 trials = int(input()) # Number of trials to perform 8 # FIXME: each time through a trial 9 # Calculate y-low as a random floating point value between 0 and 2.0. 10 # Calculate the angle theta as a random floating point value between 0 and pi, in radians 12 Oetermine if e have a hit so keep count of the hits # Calculate y-high 12 # Determine if we have a hit; if so keep count of the hits 13 14 # Print trials/hits as a floating-point value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
