How to resolve the algorithm Golden ratio/Convergence step by step in the Phix programming language
How to resolve the algorithm Golden ratio/Convergence step by step in the Phix programming language
Table of Contents
Problem Statement
The golden ratio can be defined as the continued fraction Thus
ϕ
1 +
1
/
ϕ
{\displaystyle \phi =1+{1/\phi }}
. Multiplying both sides by
ϕ
{\displaystyle \phi }
and solving the resulting quadratic equation for its positive solution, one gets
ϕ
( 1 +
5
)
/
2 ≈ 1.61803398875
{\displaystyle \phi =(1+{\sqrt {5}})/2\approx 1.61803398875}
. The golden ratio has the slowest convergence of any continued fraction, as one might guess by noting that the denominators are made of the smallest positive integer. This task treats the problem of convergence in a somewhat backwards fashion: we are going to iterate the recursion
ϕ
n + 1
= 1 +
1
/
ϕ
n
{\displaystyle \phi _{n+1}=1+{1/\phi _{n}}}
,
ϕ
0
= 1
{\displaystyle \phi _{0}=1}
, and see how long it takes to get an answer.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Golden ratio/Convergence step by step in the Phix programming language
Source code in the phix programming language
You may also check:How to resolve the algorithm 100 doors step by step in the Falcon programming language
You may also check:How to resolve the algorithm Date format step by step in the Liberty BASIC programming language
You may also check:How to resolve the algorithm Take notes on the command line step by step in the C# programming language
You may also check:How to resolve the algorithm S-expressions step by step in the Raku programming language
You may also check:How to resolve the algorithm Exceptions step by step in the Lasso programming language