Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedPlease 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 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions

Question

=+ d. a professor deciding how much to prepare for class

Answered: 1 week ago