Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help solving with Maple programming language You will nced to use the function rand)It has ways that it can be used, randis a random
Please help solving with Maple programming language
You will nced to use the function rand)It has ways that it can be used, randis a random 12 digit number and rand (a..b is a random number generator x where the output of x between a and b. is a random number For example try the following commands and ensure that you understand what they do: > rand() evalf(rand)/10 13) > rand(1..6) > rand(1..6) > Xt-rand( 1 . . 6) ; [seq (X () , 10 ) ); > count:-0 > for n from 1 to 1000 do > count: "count+' if' ( ( )-1 , 1 , 0 ) > od: > evalf (count/1000); Question #1: Calculate an estimate for Pi/4 by sampling points that are chosen uniformly in the range of -11]x [-1..1] and testing if they lie in the circle of raduis 1 or not (explain why the procedure below will be an estimate for pi/4. We will need to break this problem down into several steps so you should write a function (possibly several) for each of these. 1. A function pick_val which picks a random number between -1 and 1 2. A function pick pointwhich picks a random point whose x and y values are between -1 and 1 3. A function test in cirele which accepts a point p [x,yl and returns true if x 2 y 2 rand() evalf(rand)/10 13) > rand(1..6) > rand(1..6) > Xt-rand( 1 . . 6) ; [seq (X () , 10 ) ); > count:-0 > for n from 1 to 1000 do > count: "count+' if' ( ( )-1 , 1 , 0 ) > od: > evalf (count/1000); Question #1: Calculate an estimate for Pi/4 by sampling points that are chosen uniformly in the range of -11]x [-1..1] and testing if they lie in the circle of raduis 1 or not (explain why the procedure below will be an estimate for pi/4. We will need to break this problem down into several steps so you should write a function (possibly several) for each of these. 1. A function pick_val which picks a random number between -1 and 1 2. A function pick pointwhich picks a random point whose x and y values are between -1 and 1 3. A function test in cirele which accepts a point p [x,yl and returns true if x 2 y 2Step 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