Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(Buffon's Needle) Use MatLab and not complicated code. Objectives . Develop an algorithm to simulate the Buffon's Needle experiment. . Implement the algorithm in MATLAB
(Buffon's Needle) Use MatLab and not complicated code.
Objectives . Develop an algorithm to simulate the Buffon's Needle experiment. . Implement the algorithm in MATLAB . Study the Buffon's Needle problem via the MATLAB simulation. Buffon's Needle A long long time ago in a land known as France, a naturalist by the name of Georges-Louis Leclerc, Comte de Buffon began to ponder a gambling problem Suppose we have a floor made of parallel strips of wood, each the same width, and we drop a needle onto the floor. What is the probability that the needle will lie across a line between two strips? Mr. Buffon went on to work out the probability in detail, and you can view the full derivation on the wikipedia page which is linked at the end of this section. For this class, all that we need to know is that was used a lot in the derivation, and so in the end we can do some algebra to get an expression that estimates a value for t which is based on the probability that a needle crosses a line 2L est tP Where L is the length of the needle, t is the distance between grid lines, and P is probability that a needle crosses a line. With the equation in this form it is easy to imagine running an experiment to estimate P; simply drop a known number of needles and then count how many cross a line. If we were able to drop the needles randomly enough, then we could get a pretty good estimate for the probability of a needle crossing a line This allows us to write an expression for P as: P- cross Where N is total number of needles dropped, and ncross is the number of needles which cross a line. In that case, the expression becomes: 2LN lest tncross If we make a further assumption that the length of the needle is equal to the spacing between the lines, then the expression becomes: 2N ncross Now we're looking a problem that we can easily solve with a for-loop. We'll use a random num- ber generator to drop virtual needles on a virtual grid, and then count how many cross the line. Built-in functions are allowed. 1, -estimate (2 pts) A script which uses a for-loop to estimate a value for and consistently returns a value that is accurate to 2 significant figures for trials with at least 100,000 exper iments. The simulation should scale relatively well. In other words, I should absolutely be able to run a trial with 10,000 needles in under 1 minute. Objectives . Develop an algorithm to simulate the Buffon's Needle experiment. . Implement the algorithm in MATLAB . Study the Buffon's Needle problem via the MATLAB simulation. Buffon's Needle A long long time ago in a land known as France, a naturalist by the name of Georges-Louis Leclerc, Comte de Buffon began to ponder a gambling problem Suppose we have a floor made of parallel strips of wood, each the same width, and we drop a needle onto the floor. What is the probability that the needle will lie across a line between two strips? Mr. Buffon went on to work out the probability in detail, and you can view the full derivation on the wikipedia page which is linked at the end of this section. For this class, all that we need to know is that was used a lot in the derivation, and so in the end we can do some algebra to get an expression that estimates a value for t which is based on the probability that a needle crosses a line 2L est tP Where L is the length of the needle, t is the distance between grid lines, and P is probability that a needle crosses a line. With the equation in this form it is easy to imagine running an experiment to estimate P; simply drop a known number of needles and then count how many cross a line. If we were able to drop the needles randomly enough, then we could get a pretty good estimate for the probability of a needle crossing a line This allows us to write an expression for P as: P- cross Where N is total number of needles dropped, and ncross is the number of needles which cross a line. In that case, the expression becomes: 2LN lest tncross If we make a further assumption that the length of the needle is equal to the spacing between the lines, then the expression becomes: 2N ncross Now we're looking a problem that we can easily solve with a for-loop. We'll use a random num- ber generator to drop virtual needles on a virtual grid, and then count how many cross the line. Built-in functions are allowed. 1, -estimate (2 pts) A script which uses a for-loop to estimate a value for and consistently returns a value that is accurate to 2 significant figures for trials with at least 100,000 exper iments. The simulation should scale relatively well. In other words, I should absolutely be able to run a trial with 10,000 needles in under 1 minuteStep 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