Hacker News new | ask | show | jobs
by QML 2678 days ago
The fastest way to compute a Fibonacci number is to simply look in up on the Internet -- not kidding. There was a coding challenge that I did a couple months back which required the cumulative sum of powers of two and the fibonacci sequence, and I just did that. We can talk about faster, general algorithms but most of the time, we are bounded by resources. For example, for the nth Fibonacci number, n will be bounded by some constant. So why not look it up? It's good for playing with theory though.

Edit: Fibonacci may be a specific example, but I wondered how much wasted computation has been spent on calculating the same problem on the same input.

1 comments

If you're wondering about wasted computation, consider how much energy is expended when you look up a Fibonacci number on the internet.