`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
Kindly revert for any queries
Thanks.
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...
x2 when x E [0,1]. 1. (Total marks 12) Suppose f(x) (a) Sketch the periodic odd extension of this function on the interval [-3,31. You do NOT need to indicate what happens at any discontinuities. (4 marks) (b) Sketch the periodic even extension of this function on the interval -3,31. You do NOT need to indicate what happens at any discontinuities (4 marks) (c) The following graph shows f (x) along with a partial sum of the sine series for...
3. In a Monte Carlo method to estimate T, we draw n points uniformly on the unit square [0, 1]2 and count how many points X fall inside the unit circle. We then multiply this number by 4 and divide by n to find an estimator of T (a) What is the probability distribution of X? b) What is the approximate distribution of 4X/n for large n? (c) For n- 1000, suppose we observed 756 points inside the unit circle....
1. (25 points) The figure below shows the contour plot of f(x,y)-3 -1 - 2y+y. (Credit for the figure is due to UMich instructors.) 6.00U 6.000 1.5 1.0 0.5 0.0 0.5 1.0 1.5 6.000 2.0-1.5-1.0-0.5 0.0 0.5 1.0 1.5 (a) Find all critical points of f. There should be six. Mark them on the contour plot. (Think, but don't write, about how to guess the critical points from the contour plot.) (b) Find f-,) v(,),and fp()-fy(, y) (c) Try to...
Game Description: Most of you have played a very interesting game “Snake” on your old Nokia phones (Black & White). Now it is your time to create it with more interesting colors and features. When the game is started a snake is controlled by up, down, left and right keys to eat food which appears on random locations. By eating food snake’s length increases one unit and player’s score increases by 5 points. Food disappears after 15 seconds and appears...