Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(the following assignment was borrowed heavily from Fundamentals of Python by Kenneth Lambert) In this assignment you will be writing a program to estimate the

image text in transcribed

(the following assignment was borrowed heavily from "Fundamentals of Python" by Kenneth Lambert) In this assignment you will be writing a program to estimate the square root of a number using Newton's Method. To do this you will need to request a positive number from the user. You will then estimate the square root of the number using Newton's Method as described below. will then use Python's built-in math library to check your estimate by comparing it to the results of the math library's sqrt() function and note the difference. In the year 1669, Sir Isaac Newton wrote a mathematical treatise in which he described an approximation method for computing the square roots of polynomial functions. This method was later refined to a more generalized form to apply to more numeric and algebraic situations. Recall that the square root of a positive number x is any number y such that yxy=x. Newton discovered that if you estimate the value of y to be a number z (any reasonable initial guess will do) then a better estimate of y is the average of z and the value x/z. This process can be applied repeatedly until you converge on a value, and that is The output of the program is below: Enter a positive number: 3 Newton's estimate of the square root of 3:1.73205081001 Python's estimate of the square root of 3:1.73205089757 The difference between the two methods is: 0.00000000244

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 2 Lnai 6322

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215882X, 978-3642158827

More Books

Students also viewed these Databases questions