Live data from Hacker News

The Mathematical Hacker

evanmiller.org

31–40 of 135 posts

Re: The Mathematical Hacker

#32
post #24

Picking on Fibonacci of all things? The goal of fibonacci and factorial examples are to teach recursion. Both fibonacci and factorial are good starting points for a beginner. It can be followed by discussions of dynamic programming where the student can be introduced to recurrence relations and solving them top-down and bottom-up. EDIT: Adding some background on dynamic programming For dynamic programming, the proble…

This is really neither here nor there, but I never understood why factorial is always used as an example of a naturally recursive function, as opposed to, say, sum. It's not as though "product of the numbers from 1 to n" and "sum of the numbers from 1 to n" are somehow inherently different in how recursive they are.

Re: The Mathematical Hacker

#33
I'm in the Yegge school, so far as I think that the mathematical ignorance and, more generally, anti-intellectualism of our industry is its downfall. We see it in the lack of design sense and the awful code that is produced. VisitorFactory nonsense is something that was invented by people who hated math and wanted to tear programming away from its mathematical/problem-solving roots with a bunch of junk complexity that adds nothing.

If you're doing simple things over and over, with the objective function being minimal rejection/loss rate, the anti-intellectual/industrial get-your-boss-off-your-back-oriented development works. Complex work is different. You need to invest a lot of additional energy into elegance and quality that most companies won't pay for.

However, what we do is so intensely collaborative if it's done right that we are teachers more than anything else. Not engineers or programmers. Our job doesn't end when we build the thing: we have to teach people how to use it, so that it's not mindless complexity being inflicted upon them (as is true of many enterprise products) but something that actually makes their lives better (most software doesn't, because bosses have a tendency to force people to use bad software and this makes engineers' lives, and thus products, worse). It's sad to me that this is an extreme minority viewpoint, and that almost no software manager on earth will actually pay for things to be this way.

Re: The Mathematical Hacker

#35
post #24

Picking on Fibonacci of all things? The goal of fibonacci and factorial examples are to teach recursion. Both fibonacci and factorial are good starting points for a beginner. It can be followed by discussions of dynamic programming where the student can be introduced to recurrence relations and solving them top-down and bottom-up. EDIT: Adding some background on dynamic programming For dynamic programming, the proble…

This is really neither here nor there, but I never understood why factorial is always used as an example of a naturally recursive function, as opposed to, say, sum. It's not as though "product of the numbers from 1 to n" and "sum of the numbers from 1 to n" are somehow inherently different in how recursive they are.

When one first encounters factorials, it often is the case that one uses them to calculate ratios of factorials, the simplest bing n!/(n-1)! = n. This example is a natural one to think about recursively. The comparable examples for sums would be the difference of two sums ... and this is rarely done (except perhaps in the case of proofs of the sum of integers from 1 to n, etc.)

Re: The Mathematical Hacker

#36

Earlier quoted context omitted.

This is really neither here nor there, but I never understood why factorial is always used as an example of a naturally recursive function, as opposed to, say, sum. It's not as though "product of the numbers from 1 to n" and "sum of the numbers from 1 to n" are somehow inherently different in how recursive they are.

When one first encounters factorials, it often is the case that one uses them to calculate ratios of factorials, the simplest bing n!/(n-1)! = n. This example is a natural one to think about recursively. The comparable examples for sums would be the difference of two sums ... and this is rarely done (except perhaps in the case of proofs of the sum of integers from 1 to n, etc.)

n(n+1)/2 also exists as a simple direct method of summing a series of 1..n. There's no similar (obvious) shortcut for n!

(I don't count lgamma as obvious...)

Re: The Mathematical Hacker

#37
post #6

I find it disturbing that this article has been written in 2012. While I was reading it I really thought that it was at least 10 years old. Computer science researchers are doing actual mathematics, and they are clearly more in what the article calls "Lisp school" than the "Fortran school". Research in functional programming is mostly mathematics. Lambda calculi (which was originally not developed to be a programming…

Math is a very broad field. The point of this article is that applied math is generally not done in functional programming, and is not typically part of computer science research (more often happens as dedicated applied math research). Types, logic, and category theory are the sort of things the author thinks that functional programming people concern themselves with, and he is raising the point that these mathematic…

I agree - "Mathematics, in the end, does not help you understand computer programming. It is not about finding metaphors, or understanding “fundamentals” that will never be applied. Rather, mathematics is a tool for understanding phenomena in the world." - I couldn't agree more with this. I come from an Electrical Engineering background originally. We did a lot of applied mathematics (in the sense of the article). One year we had a lecturer from the mathematics department who didn't really have a clue about the kind of mathematics an engineer needs. He spent a lot of time proving the most basic/fundamental things, nearly down to the level of 1+1=2. My attitude at the time was "OK that's interesting but so what? I don't need it to get things done in the real world". Its the same thing with the lambda calculus or type theory for me. "OK I get the idea - so what". Its not really of any use to me. Its probably of very little use to anyone except programming language designers and there are very few of them. Its kind of disheartening to me then to see such a focus on these things, article after article. To me it seems that the field is very inward looking in this sense.

For me code is just a tool for modeling/solving problems in the outside world. It is the outside world that is interesting. I think the emphasis in the article is the right one. If more people focused on applied mathematics rather than category theory then we probably would get more innovation. Eric Evans said something similar in Domain Driven Design "Instead, the technical talent goes to work on elaborate frame-works, trying to solve domain problems with technology. Learning about and modeling the domain is left to others. Complexity in the heart of software has to be tackled head-on. To do otherwise is to risk irrelevance."

One problem though is that I do like lisp and its lineage (smalltalk etc). Had to take fortran years ago. Never really liked it.

Re: The Mathematical Hacker

#38
post #27
post #14

Earlier quoted context omitted.

At university in 2005 I studied Mathematics and Computer Science in my first year, hoping for a path into theoretical computer science (e.g. complexity theory). I couldn't find one; mathematics had its discrete side, and made use of programs in many areas, but was uninterested in the theory of computation; computer science was mostly java training (I chose mathematics). So I'm pleased if such research is going on, be…

> I couldn't find one; mathematics had its discrete side, and made use of programs in many areas, but was uninterested in the theory of computation; computer science was mostly java training (I chose mathematics). I don't understand why schools do that. There is so much to know and learn in computer science course, yet somehow learning j2ee takes precedence above everything else.

It's certainly not like that in Germany. There is usually one Java course in the first semester. The rest is math and cs theory.

Re: The Mathematical Hacker

#39
post #6

I find it disturbing that this article has been written in 2012. While I was reading it I really thought that it was at least 10 years old. Computer science researchers are doing actual mathematics, and they are clearly more in what the article calls "Lisp school" than the "Fortran school". Research in functional programming is mostly mathematics. Lambda calculi (which was originally not developed to be a programming…

Math is a very broad field. The point of this article is that applied math is generally not done in functional programming, and is not typically part of computer science research (more often happens as dedicated applied math research). Types, logic, and category theory are the sort of things the author thinks that functional programming people concern themselves with, and he is raising the point that these mathematic…

Okay thank you, I didn't really got that from the article, it makes a lot more sense now. As I see it now the author is saying using maths as an example that what the world needs is not programmers, but rather mathematicians, physicists, biologists, … who can make use of programming in addition to their field's knowledge to solve problems. This is true and I agree, but I'll add that to make programming advance as a tool for everyone to use, we also need computer scientists who can make use of programming in addition to their field's knowledge to solve problems, and that's what I was talking about in my previous comment.

Re: The Mathematical Hacker

#40
post #38
post #27

Earlier quoted context omitted.

> I couldn't find one; mathematics had its discrete side, and made use of programs in many areas, but was uninterested in the theory of computation; computer science was mostly java training (I chose mathematics). I don't understand why schools do that. There is so much to know and learn in computer science course, yet somehow learning j2ee takes precedence above everything else.

It's certainly not like that in Germany. There is usually one Java course in the first semester. The rest is math and cs theory.

It's the same in France. But the language is not necessarily Java, it may also be C, OCaml, Scheme, Python… depending on your university.
Post reply on HN