For problem set #2 Newton's Method, I'm confused about two things: 1. After the initial guess does the step size increase by epsilon? 2. If I wanted to use a bisection search algorithm to speed up the program I don't know how to determine the upper bound of the search space. Thanks
In reply to question 1, after your initial guess, you need to calculate a new guess based on "Newton's Method." Or \[x_{1}=x_{0} - (f(x_{0}) \div f \prime(x_{0}))\] Then you check the new \[x_{n}\] to see if it's within some epsilon of zero. If it isn't, calculate it again, check again, etc. I just got mine to work about an hour ago. As for question #2, I don't know. I thought about trying to optimize my code, but then got caught up in this hangman game.....
I guess to clarify, you need to check your initial guess first to see if it's within some epsilon of zero, then calculate the new \[x_{1}\]...
Newtons Method of successive approximation is an optimization. Binomial search may not work for finding the root of a polynomial - the search space isn't bounded - you'ld have to start making guesses then decide if the guess could be used as an upper or lower bound then you'ld have to find an opposite bound.
Thanks to you both. I was able to get the code to run correctly.
Join our real-time social learning platform and learn together with your friends!