Summary of problems solved by SiC exercises (1.35)

Source: Internet
Author: User

We need to prove that the golden split rate (PHI) is the fixed point of the Transformation Function x => 1 + 1/x, and then use this fact to calculate the value of Phi through the fixed-point process.


The first is the fixed point of the function, which needs to be understood clearly. The subsequent questions are all about the fixed point of the function. The reason why the author designs these exercises is also hope that readers can pay attention to the fixed point of the function.


In fact, I was curious when I was doing the exercise "1.8" about the fixed point. Why does "(x + x/y)/2" constantly approach the square root of x? Why does "(x/y2 + 2y)/3" constantly approach x's cube root?

At that time, I did not go into further consideration when I only focused on the questions. After the first few questions in 1.35, I began to understand the fixed points of the function, in turn, I feel that the method mentioned in exercise "1.8" is easier to understand to approach the root of x.


To complete these exercises, you must first read the 1.3.3 section in the book, which contains the description of the fixed point of the function. In fact, the content in Section 1.3.3 is to describe the process (or function) as a general method to discuss the process's connectivity. However, the author may think that the use of the fixed point of the function can demonstrate the general nature of the process, so the use of the fixed point of the function as a sample. For the fixed point of a function, we can obtain the fixed point of these procedures through a general method outside the process regardless of the internal implementation of the process. Of course, not all functions have fixed points, so this method does not take effect for all functions.


So what we need to know further is: what is the fixed point of a function?


The description in the book is as follows:


If x satisfies f (x) = x, x is called the fixed point of function f.


It sounds a little abstract and not easy to understand. If we use the following example, it may be easier to understand.


We assume that the currently popular Korean cosmetic technology is a function called "cosmetic surgery ()", so we can easily understand the following equation:


Cosmetic surgery (ugly girl) = beauty


An ugly girl is sent to the operating room, and through the "Cosmetic" function, the output is a beautiful girl.


However, in fact, plastic surgery is not so easy and requires 1.1 points to be rounded up, so our function should be like the following:


Cosmetic surgery (ugly girl) = beautiful ugly girl


If we send the "Beautiful ugly girl" to plastic surgery, there will be:


Cosmetic surgery (beautiful ugly girl) = more beautiful ugly girl


Therefore, if we have a function:


Cosmetic surgery (cosmetic surgery (ugly girl )))))))


Then the results should be very close to the beauty.


In the end, if we send beautiful women to face-lifting, the beauty will come out, that is


Cosmetic (beauty) = beauty


This is the time when f (x) = x, that is, "beauty" is the fixed point of the function "cosmetic surgery!




So you can understand what is the fixed point of the function?


After understanding the fixed point of a function, let's look at how to find the fixed point of a function. The method for using cosmetic surgery is simple and rough, that is, to take a photo before and after a casual person is taken. If the difference between the two pictures is large, it means that this person still has a lot of space for plastic surgery. If there is no difference before and after entering, then the result is the fixed point of the function!


If "all wisdom and wisdom" is a typical beauty recognized by the Korean community, you can catch a person, regardless of gender, and send it to Korean plastic surgeons for constant cosmetic operations. The final steps are like "all wisdom and wisdom.

We have come to the fixed point of the "Korean cosmetic surgery" function, that is, "All wisdom and wisdom "!



Further study, you will find that the method for finding the fixed point of the function is not very relevant to the function itself. The function of "facelification" can be used in this way, and the function of "fitness" is also the same, the same is true for the "server tuning" function. The basic idea is to repeatedly call this function until it no longer works for the target.


In this way, you can understand the fixed-point function in the book:

(define tolerance 0.00001)(define (fixed-point f first-guess)  (define (close-enough? v1 v2)    (< (abs (- v1 v2 )) tolerance))  (define (try guess)    (let (( next (f guess)))      (if (close-enough? guess next)  next  (try next))))  (try first-guess))


The fixed-point function uses first-guess as the initial material and calls function f to process it until the input and output values of function f are close-enough.


At this time, we will look back at Chapter 1.1.7's function for finding the square root.


As mentioned in the book, if we want to find the square root of a number x, we need a y to make y ^ 2 = x, A equation y = x/y is derived from y ^ 2 = x, so we need to transform the fixed point of x => x/y.


This method of description is so simple for the mathematical experts, but it is still hard for me to understand the mathematical idiots.


My understanding of the square root method is like this.


First, let's simplify the problem. Change the square root of x to the square root of a known number, for example, the square root of 10.

In this case, we need an x to make x * x = 10.


For example, x1 * x2 = 10, and x1 = x2.


If you want to meet the x1 * x2 = 10 condition, then there will be x1 = 10/x2. This simple mathematical conversion is easy to understand.


Then, if we design a function f (x) which is f (x) = 10/x, the equation above can be written as follows:

X1 = 10/x2 = f (x2)

That is, x1 = f (x2)


If we find the fixed point of the function f (x), f (x) = x means:

X1 = f (x2) = x2

This is the time when x1 = x2.


Congratulations! You have found the square root of 10!


But ..... Unfortunately, as mentioned in the book, changing x => 10/x does not converge!

Simply put, f (x) = 10/x has no fixed point!



If you still don't understand the above x1 and x2, imagine the following scenario:


If you are a plastic surgeon and need to perform plastic surgery on human eyes, the secret that experts tell you is that when the product of the length of two eyes is equal to 10, it is the most beautiful pair of eyes, what would you do?


First of all, you have a common sense, that is, the left and right eyes must be the same, otherwise they will become large and small eyes. What you need to do now is to sort by the secret of the experts until the two eyes are as big as they are.


Well, we are stupid plastic surgeons, and we are starting the operation!


Someone is here, measuring his left eye. The length of his left eye is 2 CM! Ah, what a small eye.

So how big should the right eye be based on the secret? 10/2 = 5! 5CM in the right eye!


The operation is complete! Eye size! The left eye is 2 CM, And the right eye is 5 CM.

This is not the case. Make the left eye the same as the right eye. It's also 5 CM!


Calculate the length of the right eye Based on the secret? The left eye is 5 CM, 10/5 = 2, and the right eye is 2CM!

Check again after the operation! Or eye size! The left eye is 5 CM, And the right eye is 2 CM.


Continue!


Ha! There's no end to it! You can't finish it if you're done!


This is called a non-converged transformation!


What should I do?


Use the "average damping" technique mentioned in the book!


If you find that the length of a person's left eye is 2 CM, And the right eye is 5 CM, the average length of the two eyes should be reasonable!

It should be (2 + 5)/2, that is 3.4


If the left eye is 4CM long, the right eye is about 10/3. 4 = 2.94.


The left eye is 3.4, the right eye is 2.94, or the size of the eye, continue to average, the eye length should be (3.4 + 2.94)/2, about 3.17.


That's right. It's getting closer and closer.


Therefore, the change x => (x + x/10)/2 converges.


We can finally build a pair of beautiful eyes! (God, never let Tech men become plastic surgeons .)




Back to the question itself, the question requires us to prove that the golden split rate (PHI) is the fixed point of the Transformation Function x => 1 + 1/x.


What is the golden split rate? Go back to section 1.2.2 of the book and check the following:


? = 1.6180


How did he obtain it? He obtained it based on equation Phi ^ 2 = Phi + 1.


That is to say, if there is x ^ 2 = x + 1, then x is the golden split rate.


Please note that this is what we have mentioned in the Post-publication. If you go to Baidu to check the golden split rate, this is not the case. Baidu tells us that the porn split rate is 0.618!


So someone asked Baidu whether the golden split rate was 1.618 or 0.618?


In fact, both are true. The so-called golden split is to divide a line segment AB into two segments: AO and OB. If AB/AO = AO/OB, then this line segment AB will be "golden split". At this time, if we record the golden split rate as AB/AO, it will be 1.618, and if we record it as AO/AB, it will be 0.618, this is also a fascinating place for the golden split rate, because 1/1. 618 = 0.618.


Well, for convenience, let's use the expression x ^ 2 = x + 1. We need to prove that the fixed point x of the function 1 + 1/x satisfies x ^ 2 = x + 1.


With the above analysis, you will find the problem is not too difficult.


We have a function f (x) = 1 + 1/x, or two numbers x1 and x2. x1 indicates the function output, and x2 indicates the function input:


X1 = 1 + 1/x2


When we find the fixed point of the function f (x) = 1 + 1/x, it means f (x) = x, that is, x1 = x2.


The equation above is changed to x1 = 1 + 1/x1. At this time, both sides are multiplied by x1, And there is x1 ^ 2 = x1 + 1.


Haha, that is to say, the fixed point x of the function f (x) = 1 + 1/x satisfies the equation x ^ 2 = x + 1, and that of the equation x ^ 2 = x + 1 is Phi!




The second half of the question also requires us to use the fixed-point function to evaluate the Phi based on this fact, which is simple.


(fixed-point (lambda (x) (+ 1 (/ 1 x))) 1)



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.