rec23 - 6.006 Intro to Algorithms Recitation 23 May 4, 2011...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
6.006 Intro to Algorithms Recitation 23 May 4, 2011 Newton’s Method Newton’s method is a method that iteratively computes progressively better approximations to the roots of a real-valued function f ( x ) . Its input is an initial guess x 0 and the function f ( x ) . The method goes as follows: 1. Given x 0 and f ( x ) , initialize n = 0 2. Compute x n +1 = x n - f ( x n ) f 0 ( x n ) 3. Repeat step 2 until f ( x n ) is sufficiently close to a root of f ( x ) . An example of Newton’s method in action:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6.006 Intro to Algorithms Recitation 23 May 4, 2011 Deriving Heron’s Method Heron’s method (or the Babylonian method) is an algorithm that approximates S . We can inter- pret this problem as solving for the roots of the function f ( x ) = x 2 - S . Since p ( S ) is a zero for this problem, we can apply Newton’s method to derive a method to solve for square roots. In this particular case, f ( x n ) = x 2 n - S and f 0 ( x n ) = 2 x n . Plugging this into Newton’s method, we get the iterative step
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

rec23 - 6.006 Intro to Algorithms Recitation 23 May 4, 2011...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online