Answered step by step
Verified Expert Solution
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
Problems Part
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 similar to the example with darts points lying insideoutside 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 x
the orientation of the needle, theta pi
The ylocation does not affect the outcome of crosses line or not crossing line
a Generate random x and theta values remember theta pi
b Calculate the x locations of the needle ends eg xendxpm costheta
since length is unit
c Use nplogicaland to find the number of needles that have minimum xend min
and maximum xend max
The ratio xend min and xend maxnumber of needlespi
for large values of number of needles
Build a random walk data set with steps between dxdy to m
If particles take steps, calculate the number of particles that move further than m
Bonus: Can you do the work without any forloops? 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started