Fibonacci Benchmark Correction

I

Isaac Gouy

Nikolai said:
* (e-mail address removed) (Mar 19, 2005 19:10):

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 :)
 
M

Mathieu Bouchard

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/access.cgi/as/njas/sequences/eisA.cgi?Anum=A000045

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

Robert McGovern

Isaac not according to the emails you are sending to the ruby talk
list. Your address is shown as (e-mail address removed).

See below
 
M

Martin DeMello

Mathieu Bouchard said:
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
 
M

Mathieu Bouchard

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
 
M

Martin DeMello

Mathieu Bouchard said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top