Question: python (10 Points) The Buffon Needle Erperiment was devised by Comte Georges-Louis Leclerc de Buffon (1707 1788), a French naturalist. In this experiment a 1

 python (10 Points) The Buffon Needle Erperiment was devised by ComteGeorges-Louis Leclerc de Buffon (1707 1788), a French naturalist. In this experiment

python

(10 Points) The Buffon Needle Erperiment 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 To simulate the Buffon needle experiment, you will need to generate two random numbers: one random number to describe where the tail of the needle landed on the y-axis and another to describe the angle of the needle with respect to the x-axis. A random floating point number between 0 and 1.0 can be generated using the function random), which you need to import from the Python module also named random. So, at the top of your python program you will need the following code: from random import random Which says to import the function random () from the random module. You could then, for example, generate a random number between 0 and 100 with the following code: from random import random some-float-between-0-and-100-100.0*random() print some float_beteen_0_and 100 For this experiment, you may generate the coordinate of where the tail of the needle landed Vtail as a number between 0 and 2.0. Likewise, the angle the needle makes with respect to the x-axis will randomly be something between 0 and radians. The head of the needle yhead may then be computed as: headytail + sin(e) If the head of the needle yhead is greater than 2.0, you count that simulated attempt as a hit. Likewise, if yhead is less than 2.0, do not count that attempt as a hit. The trigonometric function sin) is available from the math module, as is the numerical constant T. You can import these for use in your program by adding the following statement to the top of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!