Question

Problem 2. Figure 1 shows the function f (x) = v 1-x2 along with 200 random points distributed uniformly in the unit square.

1.0 0.8 0.6 0.4t 0.0 0.0 0.2 0.4 0.6 1.0 Figure 1: 200 uniformly distributed points in the unit square, and the curve f(x)- V

Problem 2. Figure 1 shows the function f (x) = v 1-x2 along with 200 random points distributed uniformly in the unit square. Use this information to estimate t. Explain your method.
1.0 0.8 0.6 0.4t 0.0 0.0 0.2 0.4 0.6 1.0 Figure 1: 200 uniformly distributed points in the unit square, and the curve f(x)- V1-r' 0.8
0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

clc
clear all
x=rand(1,200);
y=rand(1,200);
f=@(x) sqrt(1-x^2);
fplot(f,[0,1]);
hold on;
plot(x,y,'*b');
disp('Approximation of pi is');
PI=sum(y<=sqrt(1-x.^2))/200*4

MATLAB R2018a Figure ② ▼| rch Documentation Log In EDITOR naertfEile Edit View Insert Iools Desktop Wndow Help Find Files Go​​​​​​​

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Problem 2. Figure 1 shows the function f (x) = v 1-x2 along with 200 random points distributed uniformly in the unit square. Use this information to estimate t. Explain your method. 1.0 0.8 0.6 0.4t...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT