Talk:Fibonacci sequence: Difference between revisions

→‎Alternative: Thanks - you caught the what I hope is one of the last of *many* formulae with Gerard accidentally made invisible :(
(→‎Alternative: Thanks - you caught the what I hope is one of the last of *many* formulae with Gerard accidentally made invisible :()
 
(4 intermediate revisions by 2 users not shown)
Line 51:
<!-- Sorry for the "changing" of someone's comment, but I couldn't read the original formula, so I though an enlarged version would be beneficial to everyone. --- Gerard Schildberger. -->
Fibonacci sequence can also be calculated using this formula.
<big><big><big><math> Fib[n] = \frac{(1+\sqrt{5})^n - (1-\sqrt{5})^n}{2^n \sqrt{5}} </math></big></big></big>
Size of the floating-point type (float, double, long double etc..) will limit how high n can be calulated.
 
Line 207:
Hi [[User:WillNess|WillNess]] , I notice that the ('''fibonacci by folding''') Haskell example has just been moved under the heading 'Iterative'. I wonder if that doesn't risk confusing a little, or even possibly misleading ?
 
Folds are implemented recursively (either directly or indirectly) in the Prelude, and are generally understood as 'recursion schemes' in the sense of MeierMeijer et al. (See, for example, http://blog.sumtypeofway.com/an-introduction-to-recursion-schemes/ and the much-read paper which it references http://maartenfokkinga.github.io/utwente/mmf91m.pdf).
 
I also notice that other examples which have ended up in the 'Iteration' section might risk compounding a reader's confusion – they are either implemented by direct and immediate recursion on helper functions like '''go''' and '''next''', or are expressed in terms of '''zipWith''', '''scanl''' etc, which isare also implemented as a recursive functionfunctions.
 
Perhaps 'iteration' is not quite the clearest or best -fitting term to use here ?
[[User:Hout|Hout]] ([[User talk:Hout|talk]]) 19:31, 2 February 2017 (UTC)
 
FWIW, I would argue that if we need to subdivide, then the main distinction here is '''memoising vs not memoising'''. If we feel a need to subdivide further, and perhaps capture something like the category now labelled "Iterative", then perhaps what we really mean here is closer to ''direct and indirect recursion'' ? [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 19:44, 2 February 2017 (UTC)
9,655

edits