Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem needs to be completed using MATLAB or a similar language. Thank you! Problem 3: Square root approximation through an iter- ative process Geometrically, you

Problem needs to be completed using MATLAB or a similar language. Thank you!
image text in transcribed
Problem 3: Square root approximation through an iter- ative process Geometrically, you can compute the square root of a positive number A by constructing a square with area equal to A. Notice that if a square has the same area A as a rectangle of length L and width W, then length of the square must lie between L and W. Also, you can make any rectangle "more square (while maintaining the same area) by changing its length from L to the average value of the two dimensions L and W; AND by changing its width from W to A divided by the average value of the two dimensions L and W. Mathematically This averaging process can be iterated to generate a sequence of rectangles that become "more and more square The value of VA will always be sandwiched between the length and the width of each rectangle generated by this process; so if we think of the sequence of rectangle lengths as converging to vA, then the absolute error of the approximation will be bouhded by the difference of the length and width of each rectangle. Write a function mySqrt that: Has as input a positive real number A followed by a tolerance level. . Starts with a rectangle of length A and width 1 Generates sequences of lengths L and widths W of rectangles that are getting "more and more square", using the averaging process described above. . Continues until IL-W is no more than the given tolerance. Returns the sequence of L-values as a sequence that converges to v In your prob30, call your mySgrt function to compute sequences that converge to VTo, 3141, v55555 Report the following in the standard output for each of the three square roots: (a) the mumber of iterations needed to get IL-Wi down to les than 10- (b) the absolute error at the final step for each cal. 0 Type here to search

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

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

Define observational learning.

Answered: 1 week ago

Question

What is job enlargement ?

Answered: 1 week ago

Question

what is the most common cause of preterm birth in twin pregnancies?

Answered: 1 week ago

Question

Which diagnostic test is most commonly used to confirm PROM?

Answered: 1 week ago

Question

What is the hallmark clinical feature of a molar pregnancy?

Answered: 1 week ago

Question

Explain how cultural differences affect business communication.

Answered: 1 week ago

Question

List and explain the goals of business communication.

Answered: 1 week ago