SICP exercise 1.35

From Drewiki

Jump to: navigation, search

Problem

Show that the golden ratio \phi\, (see section 1.2.2 of the text) is a fixed point of the transformation x \mapsto 1 + 1/x, and use this fact to compute \phi\, by means of the fixed-point procedure.

Solution

The fixed point of the function is

1 + 1/x = x\,

Solving for x, we get

x^2 = x + 1\,

x^2 - x - 1 = 0\,

Using the quadratic equation to solve for x, we find that one of the roots of this equation is \frac{1 + \sqrt{5}}{2}, which is the golden ratio \phi\, (approximately 1.6.18).

Using the fixed-point procedure from the text to compute the numeric value:

 

The result produced by Chicken Scheme 3.1 on Mac OS X 10.5 on a MacBook Pro is

 
Personal tools