Go to Post Don't you know anything about programming? It's a black box; you don't need to know how it works. - Chriszuma [more]
Home
Go Back   Chief Delphi > Other > Math and Science
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-06-2008, 18:08
tennispro9911 tennispro9911 is offline
Alumni
AKA: Matt
FRC #2053 (TigerTronics)
Team Role: Alumni
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Endicott
Posts: 86
tennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to behold
Send a message via AIM to tennispro9911
Re: Fibonacci Sequence

A bad computer slows it down by a linear multiplier. Say if my computer is 2.0 Ghz and your computer is 200 MHz then it would take your comp about 10 times longer to run the same program, depending on things running in the background. I doubt your computer is slower than 200 MHz, so if it takes a whole night to run, then it would still take an hour or so to run on a "fast" computer. That said, obviously if you don't calculate every term in between, you can calculate the nth term much much faster, which is why I could calculate the millionth in 29 sec instead of a few hours.
__________________
2053 Alumni

Reply With Quote
  #2   Spotlight this post!  
Unread 23-06-2008, 18:09
tennispro9911 tennispro9911 is offline
Alumni
AKA: Matt
FRC #2053 (TigerTronics)
Team Role: Alumni
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Endicott
Posts: 86
tennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to behold
Send a message via AIM to tennispro9911
Re: Fibonacci Sequence

I used Java. I used the BigInteger class. Otherwise I would have roundoff errors as you said.
__________________
2053 Alumni

Reply With Quote
  #3   Spotlight this post!  
Unread 23-06-2008, 18:45
ComradeNikolai ComradeNikolai is offline
Registered User
AKA: Nicholas
FRC #2603 (Team Hornet)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Medina, Ohio
Posts: 203
ComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to behold
Re: Fibonacci Sequence

Ah, yes, Java. I should learn that sometime... after I finish learning C++ and learn Python. Maybe if I hook myself up with the AP CS exam next year, I'll be motivated enough to learn Java (our school doesn't offer AP CS, but I was able to take AP English without the class this year, so I don't see a difference there).

What kind of hardware do you have on the computer you did that on?
Oh, just FYI, I think the computer I did this on originally has 256 MB RAM and less than a 1 GHz processor... not fun...
__________________
I cut myself shaving with Occam's razor.

Reply With Quote
  #4   Spotlight this post!  
Unread 23-06-2008, 18:53
tennispro9911 tennispro9911 is offline
Alumni
AKA: Matt
FRC #2053 (TigerTronics)
Team Role: Alumni
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Endicott
Posts: 86
tennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to behold
Send a message via AIM to tennispro9911
Re: Fibonacci Sequence

I'm on a Lenovo laptop right not. T40. 1 GB RAM, 1.59 GHz processor. So its not the latest and greatest, but at the same time it works well, and faster than your machine. My home desktop is better. I'm going to run it on that and see what happens. For kicks I'd see how high I can get. I got to the 10,000,000th term in about 37 minutes, and I'm guessing it would take around 50 hours to get to 100,000,000 if the pattern continues.
__________________
2053 Alumni

Reply With Quote
  #5   Spotlight this post!  
Unread 23-06-2008, 20:34
ComradeNikolai ComradeNikolai is offline
Registered User
AKA: Nicholas
FRC #2603 (Team Hornet)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Medina, Ohio
Posts: 203
ComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to behold
Re: Fibonacci Sequence

Try the 100 000 000 and post the results... THAT would take a lot of text documents.
__________________
I cut myself shaving with Occam's razor.

Reply With Quote
  #6   Spotlight this post!  
Unread 23-06-2008, 22:42
tennispro9911 tennispro9911 is offline
Alumni
AKA: Matt
FRC #2053 (TigerTronics)
Team Role: Alumni
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Endicott
Posts: 86
tennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to behold
Send a message via AIM to tennispro9911
Re: Fibonacci Sequence

I'll try to. I think I found a way to make my program significantly faster. With a new algorithm and my desktop computer it took ~9 sec to get the millionth term and 3:22:000 for the 5,000,000th. I'll try 100 mil. My guess is about 15-20 hour run time.
__________________
2053 Alumni

Reply With Quote
  #7   Spotlight this post!  
Unread 23-06-2008, 23:39
Ian Curtis Ian Curtis is offline
Best Available Data
FRC #1778 (Chill Out!)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Puget Sound
Posts: 2,520
Ian Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond repute
Re: Fibonacci Sequence

Quote:
Originally Posted by tennispro9911 View Post
I'll try to. I think I found a way to make my program significantly faster. With a new algorithm and my desktop computer it took ~9 sec to get the millionth term and 3:22:000 for the 5,000,000th. I'll try 100 mil. My guess is about 15-20 hour run time.
If you're going for speed, wouldn't it be a little bit faster to just use the explicit definition?
__________________
CHILL OUT! | Aero Stability & Control Engineer
Adam Savage's Obsessions (TED Talk) (Part 2)
It is much easier to call someone else a genius than admit to yourself that you are lazy. - Dave Gingery
Reply With Quote
  #8   Spotlight this post!  
Unread 23-06-2008, 23:45
tennispro9911 tennispro9911 is offline
Alumni
AKA: Matt
FRC #2053 (TigerTronics)
Team Role: Alumni
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Endicott
Posts: 86
tennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to behold
Send a message via AIM to tennispro9911
Re: Fibonacci Sequence

I tried that, but it didn't work for me, with such large numbers. Feel free to see if you can get it to work yourself.
__________________
2053 Alumni

Reply With Quote
  #9   Spotlight this post!  
Unread 24-06-2008, 11:19
ComradeNikolai ComradeNikolai is offline
Registered User
AKA: Nicholas
FRC #2603 (Team Hornet)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Medina, Ohio
Posts: 203
ComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to beholdComradeNikolai is a splendid one to behold
Re: Fibonacci Sequence

Would you care to share this new algorithm? I'm interested to see it.
__________________
I cut myself shaving with Occam's razor.

Reply With Quote
  #10   Spotlight this post!  
Unread 11-11-2008, 21:55
bobwrit's Avatar
bobwrit bobwrit is offline
//No Comment
AKA: ...
FRC #1977 (Loveland High Robotics)
Team Role: Alumni
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Somewhere
Posts: 298
bobwrit is just really nicebobwrit is just really nicebobwrit is just really nicebobwrit is just really nicebobwrit is just really nice
Re: Fibonacci Sequence

I found a mathimatical function to define it, thus eliminating recursion. Have fun...
Code:
((x^n)-(-x)^(-n))/sqrt(5)
where x is (1+sqrt(5))/2 and n is the Nth term of the sequence.
__________________

FRC Team 1977 Alumni

Has Attended:2008 Colorado regional
2009 Colorado Kickoff
2009 Colorado Regional
2010 Colorado Kickoff
2010 Colorado Regional




The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka!"(I found it!), but rather, "Hmm.... That's funny" ---Isaac Asimov
Chance favors the prepared mind ---Louis Pasteur
And you can tell me, that I can't make a diffrence because I'm just one, but one is all it takes to start it. And you can tell me, that I can't change the world because I'm too young, but I wont stand here and be your target. ---FM Static
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mechanics of a 3 speed shifting sequence sanddrag Technical Discussion 3 27-02-2005 00:34
[FVG]: Opening Sequence Joshua May FIRST-related Organizations 16 24-06-2004 00:00
RC bootup sequence Venkatesh Programming 17 18-11-2003 20:56
PB_Mode Sequence DKolberg Programming 3 17-03-2003 10:54
Competition Sequence for PBasic ttedrow Programming 12 23-01-2003 08:49


All times are GMT -5. The time now is 07:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi