Given a number x, find y = x1/2. Of course, y = sqrt(x). However, an algorithm m
ID: 1809671 • Letter: G
Question
Given a number x, find y = x1/2. Of course, y = sqrt(x). However, an algorithm must be designed to find y. This can be done by converting the given problem to an optimization problem. Consider minimizing the function f(y) = (y2 - x)2, where f '(y) = 2(y2-x)(2y). Write a script that uses a while loop within a while loop to apply the method of steepest descent. The outer while loop must contain an input statement to receive a value of x, and if the input is not greater than zero, then break out of this loop, which terminates the script. If the input x is greater than zero, then the inner while loop must apply the method of steepest descent to find y. Implement an update method to find ynew given yold like the update method of (4.9). Use yold = x as an initial guess of yopt. See Example 4.14. Find a suitable step size by trial and error. Provide a script listing and a demonstration of its operation for three positive values of x.Explanation / Answer
This is a VERY good observation. This is an example where the inverse of a function is NOT a function:
y
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.