Exercise 1.45 is a summary of many previous exercises on fixed points.
This topic reviews the fixed point search method we used in Section 1.3.3. When looking for the fixed point of Y-> x/y, this transformation itself does not converge, an average damping is required.
For the transformation y-> X/(y ^ 2), it can also be reduced by an average damping.
However, one average damping is not enough for the four equations. That is to say, for a transformation like y-> X/(y ^ 3), one average damping is insufficient to converge, two Average damping measures are required.
The question follows the abstract principle and requires us to perform multiple tests to find out how many times the average damping is required for the transformation like y-> X/(y ^ N.
First, let's look at the rules we know,
Y-> X/(y ^ 1) requires one average damping.
Y-> X/(y ^ 2) requires one average damping.
Y-> X/(y ^ 3) requires two average damping times.
I guess it will require n/2 average damping?
Of course we can't simply guess it. We need to test it several times.
To facilitate the test, I wrote the following method:
(define (n-rt x n try-average-time) (fixed-point ((repeat average-damp try-average-time) (lambda (y) (/ x (fast-expt y (- n 1)) ) )) 1.0))
In this way, you can randomly specify the n and the corresponding average damping times, and test from five equations to see if the test results match my guess.
The test found that my guess is too unreliable. The test found that the, and equations can all achieve convergence through two average damping times.
Continue to guess (lg n) times. To tell the truth, I guess the degree of mathematics sensitivity before it reaches (LG N) times, after reading the results of many tests, some online students can locate (lg n.
Of course, this time I guessed it.
The final method I write is as follows:
(define (final-n-root x n) (define (nth-root n) (n-rt x n (lg n))) (nth-root n))
The above method calls the previously defined N-RT process for testing, but simply uses (lg n) to calculate the average number of times of damping.
Summary of problems solved by SiC exercises (1.45)