Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics Of A Networked World Semantics For Grid Databases First International Ifip Conference Icsnw 2004 Paris France June 2004 Revised Selected Papers Lncs 3226

Authors: Mokrane Bouzeghoub ,Carole Goble ,Vipul Kashyap ,Stefano Spaccapietra

2004 Edition

3540236090, 978-3540236092

More Books

Students also viewed these Databases questions