Monte Carlo Method The following computer program approximates the area of the region

Chapter 5, Problem 78

(choose chapter or problem)

Monte Carlo Method The following computer program approximates the area of the region under the graph of a monotonic function and above the -axis between and Run the program for and for several values of N2. Explain why the Monte Carlo Method works. [Adaptation of Monte Carlo Method program from James M. Sconyers, Approximation of Area Under a Curve, MATHEMATICS TEACHER 77, no. 2 (February 1984). Copyright 1984 by the National Council of Teachers of Mathematics. Reprinted with permission.] 10 DEF FNF(X)=SIN(X) 20 A=0 30 B=/2 40 PRINT Input Number of Random Points 50 INPUT N2 60 N1=0 70 IF FNF(A)>FNF(B) THEN YMAX=FNF(A) ELSE YMAX=FNF(B) 80 FOR I=1 TO N2 90 X=A+(B-A)*RND(1) 100 Y=YMAX*RND(1) 110 IF Y>=FNF(X) THEN GOTO 130 120 N1=N1+1 130 NEXT I 140 AREA=(N1/N2)*(B-A)*YMAX 150 PRINT Approximate Area:; AREA 160 END

Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.

Becoming a subscriber
Or look for another answer

×

Login

Login or Sign up for access to all of our study tools and educational content!

Forgot password?
Register Now

×

Register

Sign up for access to all content on our site!

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back