May 7th, 2015, 3:53 pm
QuoteOriginally posted by: CuchulainnQuoteOriginally posted by: Traden4AlphaIt may be true that the Fibonacci numbers (especially the ones that fit in workaday data types) are easy to calculate or store in a LUT.1. What if you need Fn calculated a great many times, but for arbitrary n and varying floating point F0 and F1?2. What if you need variants of the Fibonacci progression with different coefficients on the sum: Fn+1 = c1*Fn + c2*Fn-1?3. What if you need Fn for extremely high n for some unusual crypto algorithm (e.g., the Fibonacci-number bits of the U[1,000,000,000] Fibonacci number)?The point is that this can be a more general method for approaching recursive series. Fibonacci is just the simple exemplar.1. F0 and F1 are non-negotiable (== 1 whatever)?2. A generalized Pascal's triangle? (* is redundant in general IMO). (x + c1)^n .. Tribonacci, Tetranacci ..3 n = ?1&2. Although F0 and F1 might be fixed for classic Fibonacci, what if you have some AR-like process that posits that the future state of the system is a weighted linear sum of the previous states of the system. One might be doing an MC of millions or billions of starting values for F0 and F1 and desire a fast calculation of FN.3. n might be quite large, millions, billions, or trillions and only be concerns with parts of the bit pattern of a Fibonacci-like process rather than the entire value.This brainteaser is only irrelevant in the strictest sense of the Fibonacci numbers. Many other systems have a recursive structure that is like the Fibonacci system.