Velocity Reviews > Ruby > Fibonacci Benchmark Correction

# Fibonacci Benchmark Correction

Isaac Gouy
Guest
Posts: n/a

 03-20-2005

Nikolai Weibull wrote:
> * http://www.velocityreviews.com/forums/(E-Mail Removed) (Mar 19, 2005 19:10):
> > While acknowledging the comments of Josef, Michael, Nikolai, Joel,
> > Michael, and E, we'll probably change the code for the Fibonacci
> > programs for the simple reason that we refer to the Mathworld
> > definition which uses F(0)=0, so it's more than a little confusing
> > when we don't use that definition for the programs

>
> I don't want to be a dick, but I never said that the code shouldn't

be
> changed. I just figured that there are more important problems than
> deciding the exact starting point of the Fibonacci series (which is,

as
> stated again and again in this thread to no avail it seems,

arbitrary).

Agreed.

> Anyway, consistency is great, so its good that you adhere to the
> material you're quoting. Good luck with the shootout,

If our inconsistency leads off on some tangent like this then we need
to fix even the trivial issues

Mathieu Bouchard
Guest
Posts: n/a

 03-21-2005

On Sat, 19 Mar 2005, Josef 'Jupp' Schugt wrote:

> > This is an incorrect statement of the Fibonacci algotithm.
> > The Fibonacci series is: 0, 1, 1, 2, 3, 5, 8, 13, 21, .....

> The above is an incorrect statement about the nature of mathematics.

[...]
> F(i) == (f**i - F**i) / sqrt(5.0)

There's something else that makes the f(0)=0 series special: they have the
property that f(x) for even x is an even function, and f(x) for odd x is
an odd function.

This fact is quite related to the Binet formula that you state (and that I
quoted above).

> The true reason to give the test a name like 'Fibonacci series' is that
> this is more mnemonic than "benchmarking series Nr. 4711".

... or "Sloane's A000045" :

http://www.research.att.com/cgi-bin/...i?Anum=A000045

__________________________________________________ ___________________
Mathieu Bouchard -=- Montréal QC Canada -=- http://artengine.ca/matju

Robert McGovern
Guest
Posts: n/a

 03-21-2005
Isaac not according to the emails you are sending to the ruby talk
list. Your address is shown as (E-Mail Removed).

See below

On Sun, 20 Mar 2005 13:44:52 +0900, (E-Mail Removed) <(E-Mail Removed)> wrote:
> > > Glenn Parker wrote:

> > (E-Mail Removed) wrote:

>
> Not igouy, but igouy2

Martin DeMello
Guest
Posts: n/a

 03-21-2005
Mathieu Bouchard <(E-Mail Removed)> wrote:
> > F(i) == (f**i - F**i) / sqrt(5.0)

>
> There's something else that makes the f(0)=0 series special: they have the
> property that f(x) for even x is an even function, and f(x) for odd x is
> an odd function.
>
> This fact is quite related to the Binet formula that you state (and that I
> quoted above).

Huh? What precisely are f() and x in this context?

martin

Mathieu Bouchard
Guest
Posts: n/a

 03-21-2005

On Mon, 21 Mar 2005, Martin DeMello wrote:
> Mathieu Bouchard <(E-Mail Removed)> wrote:
> > > F(i) == (f**i - F**i) / sqrt(5.0)

> > There's something else that makes the f(0)=0 series special: they have the
> > property that f(x) for even x is an even function, and f(x) for odd x is
> > an odd function.
> > This fact is quite related to the Binet formula that you state (and that I
> > quoted above).

> Huh? What precisely are f() and x in this context?

f(0)=0
f(x)=f(x-1)+f(x-2)
f(x)=f(x+2)-f(x+1) (equivalent to the previous line)

or f(x)=(a**x-b**x)/(a-b) for a,b = the z-roots of z**2-z-1

then f(-x)=((-1)**x)*f(x)
so f(-x)=+f(x) for x=0 mod 2
and f(-x)=-f(x) for x=1 mod 2

(is that better?)

__________________________________________________ ___________________
Mathieu Bouchard -=- Montréal QC Canada -=- http://artengine.ca/matju

Martin DeMello
Guest
Posts: n/a

 03-21-2005
Mathieu Bouchard <(E-Mail Removed)> wrote:
> so f(-x)=+f(x) for x=0 mod 2
> and f(-x)=-f(x) for x=1 mod 2

Oh, I see what you mean. I got confused by your use of "f(x) for even
x" - in effect, you're referring to two separate functions, one defined
over the even integers and one over the odds.

martin

 Thread Tools

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post dleecurt@cc.usu.edu C++ 28 06-05-2011 04:30 AM Brett Trost Perl 2 01-22-2004 02:04 PM Lance C++ 5 12-02-2003 09:17 AM Alex Vinokur C++ 0 10-29-2003 12:07 PM fighterman19 C++ 11 09-08-2003 02:30 PM

Advertisments