[gambit-list] Golden Section and Gambit Scheme

Marc Feeley feeley at iro.umontreal.ca
Thu Oct 27 13:16:16 EDT 2011


On 2011-10-27, at 9:46 AM, Steve Graham wrote:

> So here are the solutions and code:
> 
> Gambit v4.6.1
> >  (/ (+ -1 (expt 5 .5)) 2)
> .6180339887498949
> >  (/ (- -1 (expt 5 .5)) 2)
> -1.618033988749895
> >  
> The main solution for A is .6180339887498949, and because B = 1, then C = 1.6180339887498949
> 
> Many thanks to Scott Olsen author of The Golden Secret, Marc Feeley (main author of Gambit Scheme), Keith Flower (for porting of Gambit to the Android OS), Google (for helping me to remember/find the solution to a quadratic equation and providing picture-capable Gmail), Microsoft (for making Word handle equations) and my math teachers for a stroll down memory lane and a most interesting adventure for today.
> 
> Steve
> 

No problem!

By the way, one of the nice properties of the fibonacci sequence is its relation to the golden ratio (the limit n->oo of fib(n)/fib(n-1) is the golden ratio, or its inverse, I can never remember).  Here is a demonstration which you can try on your iPhone:

> (define (fib n)
    (let loop ((i n) (a 1) (b 1))
      (if (= i 0) a (loop (- i 1) b (+ a b)))))
> (fib 20)
10946
> (exact->inexact (/ (fib 1000) (fib 999)))
1.618033988749895
> (exact->inexact (/ (fib 999) (fib 1000)))
.6180339887498949
> (fib 1000)
70330367711422815821835254877183549770181269836358732742604905087154537118196933579742249494562611733487750449241765991088186363265450223647106012053374121273867339111198139373125598767690091902245245323403501

Marc




More information about the Gambit-list mailing list