Skip to Content
A Concise Introduction to Programming in Python
book

A Concise Introduction to Programming in Python

by Mark J. Johnson
December 2011
Beginner
217 pages
8h
English
Chapman and Hall/CRC
Content preview from A Concise Introduction to Programming in Python
Project: Newton’s Metho d
Newton’s method is a powerful technique for numerically computing the
zeros of differentiable functions. It is an iterative technique, meaning that
instead of applying a formula to directly compute the answer, it repeatedly
tries to compute a better approximation until the desired accuracy is reached.
Iteration is just a fancy word for repetition, which we know how to do in
Python using for loops and while loops.
Newton’s method gives a surprisingly simple algorithm for computing
k.
Listing 8.2: Newton’s Method (Algorithm)
# To compute sqrt(k)
Begin with an initial guess x.
Repeat until desired accuracy is reached:
Replace x with ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Standard Library

Python Standard Library

Fredrik Lundh
Numerical Computing with Python

Numerical Computing with Python

Pratap Dangeti, Allen Yu, Claire Chung, Aldrin Yim

Publisher Resources

ISBN: 9781439896952