I graduated in 1990 in Electrical Engineering and since then I have been in university, doing research in the field of DSP. To me programming is more a tool than a job.
It turns out also in DSP, it is a classical example of use of z-trasform for beginners. Actually, the exact form has two terms: phi above and 1/phi and the n-th term is something like C*(phin +1/phin ) (more or less, I am going by memory and I am too lazy now to do the computation... ;-)). Of course, since 1/phi is smaller than one, 1/phin goes rapidly to zero and you get a wonderful approximation with only phin already for small n.
I only know it because my Theory of Computability professor used the “one trillionth Fibonacci number” as a limit to our newfound power understanding recursive solutions. (To find the Fn, you need to find Fn-1 + Fn-2. To find those two numbers, you need to find Fn-2 + 2*Fn-3+Fn-4. This gets towards heat death of the universe level amount of instructions fairly quickly. The loop with saved state gets you down to hours IIRC.)
Then he dropped that this equation existed and my mind kinda exploded.
It wasn’t until trying to get that Project Euler question 2 to complete in under 30 seconds that I ever implemented this. It’s simpler than I expected going in.
Yeah, it’s not too hard to put together an inefficient solution using recursion (since that’s how the equation is written). If you’re clever, you might save computations in a list. Or, maybe you write an iterative solution which only needs two variables at any give time.
That said, an equation like this is next level. Haha
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Clever! I didn't realize there was an equation that could so closely approximate the series.
It turns out also in DSP, it is a classical example of use of z-trasform for beginners. Actually, the exact form has two terms: phi above and 1/phi and the n-th term is something like C*(phin +1/phin ) (more or less, I am going by memory and I am too lazy now to do the computation... ;-)). Of course, since 1/phi is smaller than one, 1/phin goes rapidly to zero and you get a wonderful approximation with only phin already for small n.
I only know it because my Theory of Computability professor used the “one trillionth Fibonacci number” as a limit to our newfound power understanding recursive solutions. (To find the Fn, you need to find Fn-1 + Fn-2. To find those two numbers, you need to find Fn-2 + 2*Fn-3+Fn-4. This gets towards heat death of the universe level amount of instructions fairly quickly. The loop with saved state gets you down to hours IIRC.)
Then he dropped that this equation existed and my mind kinda exploded.
It wasn’t until trying to get that Project Euler question 2 to complete in under 30 seconds that I ever implemented this. It’s simpler than I expected going in.
Yeah, it’s not too hard to put together an inefficient solution using recursion (since that’s how the equation is written). If you’re clever, you might save computations in a list. Or, maybe you write an iterative solution which only needs two variables at any give time.
That said, an equation like this is next level. Haha