Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 4 (12 marks) Let p be the probability that three random points on the edges of the unit square form an obtuse triangle (see
Question 4 (12 marks) Let p be the probability that three random points on the edges of the unit square form an obtuse triangle (see the figure). P3 C P2 b P1 (a) Write a MATLAB function with calling sequence function [p, stderror] = approxProb(Nreps) to estimate the probability p. Your MATLAB function should return your estimate of p and the standard error fo the estimator, given the number of repetitions as an input argument. (b) Run the simulation 10 times and print the probability p with 4 decimal places for Nreps = 100 and Nreps = 10,000, respectively. Describe what do you observed. (c) Determine by simulation the number of repetitions for the standard error to be less than 1 x 10-3, i.e. the estimate for p should have 2 decimal place accuracy. (d) Estimate the number of repetitions you would need for 3 decimal place accuracy. Explain your answer. Question 4 (12 marks) Let p be the probability that three random points on the edges of the unit square form an obtuse triangle (see the figure). P3 C P2 b P1 (a) Write a MATLAB function with calling sequence function [p, stderror] = approxProb(Nreps) to estimate the probability p. Your MATLAB function should return your estimate of p and the standard error fo the estimator, given the number of repetitions as an input argument. (b) Run the simulation 10 times and print the probability p with 4 decimal places for Nreps = 100 and Nreps = 10,000, respectively. Describe what do you observed. (c) Determine by simulation the number of repetitions for the standard error to be less than 1 x 10-3, i.e. the estimate for p should have 2 decimal place accuracy. (d) Estimate the number of repetitions you would need for 3 decimal place accuracy. Explain your
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