1.1.7 Example: Square Roots by Newton's Method Flashcards

1
Q

The contrast between mathematical functions and computer procedures is a reflection of

A

The general distinction between describing the properties of things and describing how to do things, or, the distinction between declarative knowledge and imperative knowledge.

In mathematics, we are usually concerned with declarative (what is) descriptions whereas in computer science, we are usually concerned with imperative (how to) descriptions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The most common way to compute square roots

A

Newton’s method of successive approximation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Newton’s method of successive approximation

A

Whenever we have a guess y for the value of the square root of a number x, we can perform simple manipulation to get a better guess (one closer to the actual square root) by averaging y with x/y.

For example, we can compute the square root of 2 as follows. Suppose our initial guess is 1:

Guess, Quotient, Average

1, (2/1) = 2, ((2 + 1)/2) = 1.5

1.5, (2/1.5) = 1.3333, ((1.3333 + 1.5)/2) = 1.4167

1.4167, (2/1.4167) = 1.4118, (1.4167 + 1.4118)/2) = 1.4142

1.4142 … …
Continuing this process, we obtain better and better approximations of the square root.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

radicant

A

the number whose square root we are trying to compute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly