5 ms·
> Rather, mathematics is a tool for understanding phenomena in the world: the motion of the planets, the patterns in data, the perception of color, or any of a
by wwweston 4y ago
> Rather, mathematics is a tool for understanding phenomena in the world: the motion of the planets, the patterns in data, the perception of color, or any of a myriad things in the world that might be understood better by manipulating equations.
OK, so on one hand I love this point, and I'd love for it to be more broadly understood and appreciated, especially since my educational background is Mathematics and my CS has been practical, half self-taught, and frankly patchier than I'd like.
But:
> Fortran-school programmers view the computer as an advanced tool for doing mathematics.
If we're understanding "mathematics" as numerical/analytical work + engineering (maybe applied mathematics) I can see this.
But the Lisp programmer talking in terms of recursive fibonnaci definitions is doing something that can quite adequately be described as mathematics, though it's also mathematics to figure out the closed form and understand why you might or might not use it. Not sure if it's mathematics to simply know a given closed form, though it's something mathemeticians sometimes do.
And I'm more skeptical that Lisp programmers don't do all this stuff: recursive demonstrations of fibonacci numbers are usually in textbooks to teach recursion rather than present an optimal way of computing fibonacci numbers, because it's simpler than starting with dynamic programming, and you're gonna need recursion to effectively solve some problems.
Not only that but a higher level, I think that a lot of developers (Lisp included) are already reaching into the very mathematical skills of domain modeling at one level or another -- often first with a different set of tools than a mathematician might bring, but a similar kind of work. If Miller's overall point is that we all could do a better job with more of a mathematician's tools, I agree, but then again as someone who came into industry with a math undergrad's tools the utility of those might be overemphasized here.
Or maybe I just don't appreciate what I already have.
- userxyz 4y agoI think the author is making two points among others: 1. LISP based text/books always present the same two cliche examples 2. They never go beyond (1) given how much they talk about recursion. He mentions sqrt of 5 in the explicit formula of Fibonacci sequence and how that could be explored in more detail to find out where that comes from. For that you need to know [0]. That's part of a larger suit of theorems on sequences. This stuff together with theory that surrounds the Gamma function can easily take up a whole book. But there are a ton of books that treat either one really nicely: most textbooks on discrete math and real analysis. [0] https://ibb.co/TR1f5Gz https://ibb.co/TR1f5Gz
- zozbot234 4y agoNon image-based link: https://en.wikipedia.org/wiki/Linear_recurrence_with_constant_coefficients#Solution_with_distinct_characteristic_roots https://en.wikipedia.org/wiki/Linear_recurrence_with_constan... (Also, https://en.wikipedia.org/wiki/Constant-recursive_sequence#Closed-form_characterization https://en.wikipedia.org/wiki/Constant-recursive_sequence#Cl... )
- userxyz 4y agoI see someone disagreed with me. Not sure about what, but just in case I will show how to derive a formula for Fibonacci using the above. You be the judge if it belongs in a LISP programming textbook, even though this particular result is very elementary. Recurrence relation for Fibonacci is F_k = F_(k-1) + F_(k-2) for k=> 2 with F_0 = F_1 = 1. Also, t^2 - t - 1 = 0 implies t = (1 + sqrt(5))/2, (1 - sqrt(5))/2. Both of these facts satisfy the conditions of the linked theorem and so we have F_n = x((1 + sqrt(5))/2)^n + y((1 - sqrt(5))/2)^n for n=>0. Now F_0 = x + y = 1 and F_1 = x(1 + sqrt(5))/2 + y(1 - sqrt(5))/2 = 1 from which it follows that x = (1 + sqrt(5))/2sqrt(5) and y = -(1 - sqrt(5))/2sqrt(5) meaning F_n = (1 + sqrt(5))/2sqrt(5)((1 + sqrt(5))/2)^n + (-1 + sqrt(5))/2sqrt(5)((1 - sqrt(5))/2)^n. This math (complete with a universe of theorems and their proofs) can obviously be extended in many different directions in such a way that it can take over your whole book.
- wwweston 4y agoI don't think anyone finds recurrence relations, closed form expressions, or their derivation controversial or disagreeable in any way. On the other hand, the implication that Lisp textbooks -- or other language texts that use fibonacci or like examples for recursion examples -- shouldn't be using simple recursive definitions as an illustration if there exists a closed form may well raise some eyebrows. What do you want, Collatz Sequences? Additionally, there's an air of attacking the sophistication of devs who choose Lisp specifically, which is the kind of thing that people frequently do find disagreeable (even if there's a reasonable case for it). Fibonacci and other linear recurrence relations are used because they're simple and often familiar intros that can help conceptualize the way recursion can reduce problems to smaller versions of themselves (which is very much mathematical thinking). They're not there because they represent limits of how Lisp devs generally do or should think.