Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . 4 Problems Part 4 1 . Buffon's needle problem is another way to estimate the value of pi with random numbers. The

1.4 Problems Part 4
1. Buffon's needle problem is another way to estimate the value of \pi
with random numbers. The goal in this Monte Carlo estimate of \pi
is to create a ratio that is close to 3.1415926... similar to the example with darts points lying inside/outside a unit circle inside a unit square.
Buffon's needle for parallel
lines
In this Monte Carlo estimation, you only need to know two values:
the distance from line 0, x=[0,1]
the orientation of the needle, \theta =[0,2\pi ]
The y-location does not affect the outcome of crosses line 0 or not crossing line 0.
a. Generate 100 random x and theta values remember \theta =[0,2\pi ]
b. Calculate the x locations of the 100 needle ends e.g. xend=x\pm cos\theta
_since length is unit 1.
c. Use np.logical_and to find the number of needles that have minimum xend min<0
and maximum xend max>0
. The ratio xend min<0 and xend max>0number of needles=2\pi
for large values of number of needles
.
2. Build a random walk data set with steps between dx=dy=1/2 to 1/2 m
. If 100 particles take 10 steps, calculate the number of particles that move further than 0.5 m.
Bonus: Can you do the work without any for-loops? Change the size of dx and dy to account for multiple particles.

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

Why is break-even analysis a misnomer?

Answered: 1 week ago

Question

licensure as a psychologist in the respective jurisdiction; and

Answered: 1 week ago

Question

I'm not understand this excel. Please help me.

Answered: 1 week ago

Question

a score of 70 or higher on the test?

Answered: 1 week ago