I have a figure like so :
Now the question asks to
1) generate 100 samples of iid - 2D uniform random variables in the unit-square. 2) count how many samples generated fall within the quarter unit-circle centered at the origin.
What I've done so far:
approach 1 generate two vectors of random samples using
runif in R.
and then I'm finding out if the area of the rectangle
(samples_x * samples_y) is less than the area of the quarter circle
approach 2 generate two vectors of random samples using runif in R
samples_x ^ 2 + samples_y ^ 2 is less than or equal to radius square (
Is either train of thought correct?
3) the question asks later,
- use these samples generated to estimate the area of the inscribed quarter circle.
- use the estimated area to estimate the value of pi.
Which I have no idea as to how to solve. I've been looking at estimation of population but it's mostly count the samples in a small area and divide by the total area.
By that method, would that mean I should estimate using samples falling within the circle and divide by 100 to estimate area?
any pointers, help ,suggestions, opinions? much appreciated.