Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Of course. And if a student realizes that — or it's pointed out constructively — a lightbulb might go off!

The (pedagogical) advantages of ℚ(φ) are that it seems like less of a trick to the student and Binet's formula is more apparent. It also gives them more surface area to explore.

A lot of students believe that mathematical know-how and practical problem-solving are at odds (especially since recursion is inherently "mathematical" to most beginners). IME exercises like this help prevent that false dichotomy from forming.

So, algorithmically equivalent, pedagogically distinct.

(BTW, not saying that the matrix implementation is bad or anything, it's the contrast in appearance and equivalence in computation together that makes for the learning.)



> The (pedagogical) advantages of ℚ(φ) are that it seems like less of a trick to the student and Binet's formula is more apparent.

That seems very counter-intuitive to me, as the matrix form is a direct expression of the Fibonacci function's definition, and Binet's formula follows from the eigenvalues and eigenvectors of the matrix. I guess this ties in to the students you're teaching not liking math?

> A lot of students believe that mathematical know-how and practical problem-solving are at odds (especially since recursion is inherently "mathematical" to most beginners).

This is also counter-intuitive to me. I was under the impression that beginners tend to overestimate the importance of mathematical skill to programming. Do you have a more concrete example, or an explanation of what you mean by recursion not being seen as practical for problem solving?


This depends a lot on what order you learn things.

If you start with, say, empirically discovered relationships in the regular pentagon and pentagram, then you can figure out φ (ratio of the diagonal to the side of a pentagon) must satisfy φ^2 = φ + 1. Proving that this relationship must hold for the regular pentagon is not too hard.

Then start taking powers of φ based on that definition, and you can if you like define the Fibonacci numbers as the coefficient F[i] in φ^i = F[i]φ + F[i-1]. Or define the Fibonacci numbers in the conventional way and simply demonstrate that they show up in the above expression.


The number of off-by-one errors I see in "professional" code suggests to me that professionals underestimate the importance of mathematical reasoning to programming.


I don't think off by one errors are related to mathematical reasoning; all programmers know how to count. They're more likely caused by rushed reasoning, when programmers are pushed to get something out without time to think about all the corner cases.


I think this is a good example of what I'm talking about with people overestimating the importance of mathematics to programming. Taking more math classes won't help you avoid off-by-one errors.


No, but learning how to program correctly using mathematical reasoning will. See for example A Discipline of Programming. If you derive a loop using those or similar techniques, you will never have an off-by-one error, among others. And once you achieve proficiency it's no more difficult than basic arithmetic.

There may be a lack of clarity here though. I am referring to the actual technical skill of writing computer programs. If by "programming" you mean "the activities you need to do to have a job as a software engineer" then I can attest that no actual ability to write programs is required whatsoever, or at least the walking proof by construction who showed me this provided no evidence thereof and still maintains their position. Which is sad, since even people with no real idea of how to write programs can be somewhat productive via copy-paste cargo cult programming.


You don't need any special reasoning to know how to write a loop. This is just a basic thing people get taught.

What does it mean to use mathematical reasoning to derive a loop, and what error does this derivation prevent?


Yes, I am a big fan of the “golden integers” and “golden rationals”. They are very useful when trying to work out any kind of metrical geometry questions w/r/t the symmetry system of the pentagon, icosahedron, 120-cell, etc.

I think a lot more students should spend significant time with Zometool construction toys while in school, and should work out a lot of the arithmetic of golden integers for themselves. (If you are a math teacher, I recommend getting some of these.)

If you use Wildberger’s “rational trigonometry”, then it is possible to answer essentially every metrical geometry question about configurations of Zometool using golden rational arithmetic without ever resorting to approximations. The squared length between every pair of Zome-constructible points is a golden integer and the squared sine of every Zome-constructible angle is a golden rational number.

I’m just pointing out that “It's possible to use Binet's formula, too [using golden integers]” is not actually any different in practice than the matrix computation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: