[PD] fib verb - was converting decimal to binary

padawan12 padawan12 at obiwannabe.co.uk
Fri Jul 7 06:00:17 CEST 2006






I found a closed ofrm of fib which goes

fib(n) = (phi^n - (1-phi)^n)/sqrt(5)
but when I patch it up I get an error.

It seems to be with the second numerator
term, the Pd [pow] doesn't like non integer
negatives. Anyone know how I get around
this? 

THe attached patch "works", only those aren't 
all fib numbers at the output, every few are
rounded to an error because of the effect of
the broken second term.








On Fri, 30 Jun 2006 20:40:56 -0400 (EDT)
Mathieu Bouchard <matju at artengine.ca> wrote:

> On Thu, 29 Jun 2006, Federico wrote:
> 
> > and also: if you divide any fib number by its preceeding number, you get
> > the "magic" number (the one of Pitagora's sectio aurea)
> > (this works better with numbers > 100)
> 
> This is because if a is the golden section and b=-1/a, then:
> 
>    Fib(n) = (a^n - b^n)/(a-b)
> 
> so:
> 
>    Fib(n+1)/Fib(n) = (a^(n+1) - b^(n+1))/(a^n - b^n)
> 
> and because |b|<1, b^n converges towards zero, so:
> 
>    lim n->infinity Fib(n+1)/Fib(n)
>       = lim n->infinity a^(n+1)/a^n
>       = a
> 
>   _ _ __ ___ _____ ________ _____________ _____________________ ...
> | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
> | Freelance Digital Arts Engineer, Montréal QC Canada
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aa-new-fibbonz2.pd
Type: application/octet-stream
Size: 2204 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20060707/cf5e8271/attachment.obj>


More information about the Pd-list mailing list