Solve for golden ratio value using recursion?

270 Views Asked by At

The golden ratio is defined as:

$$\frac a b = \frac {a+b} a.$$

It comes down to:

$$\varphi = 1 +\frac 1 \varphi.$$

Is there a way to solve for $\varphi$ computationally/recursively? Is there any other way to solve it?

1

There are 1 best solutions below

2
On BEST ANSWER

Aside from the quadratic construction provided by fleablood, there is also a way to solve for $\varphi$ recursively.

As $\varphi$ is the sole attractive stationary point of $f(x)=1 + \frac{1}{x}\,$, we can define the sequence $(x_n)_{n=0}^\infty$, where $x_{n+1} := 1+\frac{1}{x}$ and for any $x_0 \not \in \{1 - \varphi, 0\}$, we have

$$\lim_{n \to \infty}{x_n} = \varphi$$

(If $x_0 = 0$, then $x_1$ is undefined, and if $x_0= 1-\varphi$, then all $x_n = 1-\varphi$, as $1-\varphi$ is the other stationary point of $f$, but is unstable.)

EDIT: After further investigation, the limit of the sequence is undefined not just in the case of $x_0 = 0$, but for all $x_0$ in the sequence $(y_n)_{n=0}^\infty$ where $y_0:=0$ and $y_{n+1} := \frac{1}{y_n - 1}$. Interestingly, this sequence, defined by the inverse of the function defining $(x_n)_{n=0}^\infty$, converges to $1-\varphi$, and its defining function has an unstable stationary point at $\varphi$.