Live data from Hacker News

The Mathematical Hacker (2012)

evanmiller.org

11–20 of 186 posts

Re: The Mathematical Hacker (2012)

#11
> 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.

Re: The Mathematical Hacker (2012)

#12
The suggested "efficient" solutions for fibonacci and factorial only work on small inputs as they return the result as a long int. For these small instances the use of floating point functions like pow, sqrt, and exp is likely less efficient than a simple iterative solution. For larger instances using bignums as output, floating point computations do not even offer an alternative.

It's true though that mathematics offers faster integer only (e.g. matrix based) methods of computing fibonacci.

Re: The Mathematical Hacker (2012)

#13
"Again, no recursion is required as long as one knows that a factorial is actually a special case of the gamma function. (The implementation of log-gamma is usually a polynomial approximation which requires constant time to evaluate.)"

A prime idea behind using recursive techniques is that for many complex problems you do not have to know the "special case" as you can break complex problems into simpler pieces that can be solved via recursion.

Re: The Mathematical Hacker (2012)

#14
Kind of agree but my argument would be that solving math problems exercises the same mental muscles that programming uses and vice versa. Doing one improves the other. Saying that it is necessary or essential is a false dilemma. They are complementary. Is computation mathematically based - that seems obvious. Does programming get done despite programmers lack of understanding the math of computation - obviously quite a bit.

Re: The Mathematical Hacker (2012)

#15
"Writing software" = "writing down math".

Consider:

* "Writing software" means arranging symbols (bits in a machine language, UTF or ASCII characters in a high-level language) in certain permitted ways, to transform an input sequence of symbols (e.g., a stream of byte values representing user actions from a video game controller) into an output sequence of symbols (e.g., byte values representing pixel RGB colors for display on a screen).

* "Writing down math" (e.g., to prove something, or to solve a problem) means arranging symbols ('x', '2', '+', etc.) in certain permitted ways, to transform an input sequence of symbols (representing mathematical notions) into an output sequence of symbols (representing other mathematical notions). Turing, Church, Curry, Gödel, and many others realized this in the 1920's and 1930's.

That said, most self-described "software developers" are typically working to solve relatively simple problems for immediate practical application, whereas most self-described "mathematicians" are typically working to solve highly complex problems, often highly abstract in nature, without regard for practical application.

Re: The Mathematical Hacker (2012)

#16
post #13

"Again, no recursion is required as long as one knows that a factorial is actually a special case of the gamma function. (The implementation of log-gamma is usually a polynomial approximation which requires constant time to evaluate.)" A prime idea behind using recursive techniques is that for many complex problems you do not have to know the "special case" as you can break complex problems into simpler pieces that c…

I would be surprised if there is not some kind of loop in the code that is used to evaluate the gamma function. You can also define factorial like for example the number of different permutations of any set of a given size.

Re: The Mathematical Hacker (2012)

#17
I used to work on these problems in school all the time, but once I decided to join industry I encountered a bunch of these Lisp-style engineers who love computation in the abstract but not the application thereof. Scala seemed to attract a lot of folks like this. Maybe if I had gone into scientific computing I would have found more.

I get to use these skills every so often though. When I was designing one of our early two-level caches at $WORK, I wrote an analysis of chosen TTLs and jitter values by looking at microservice latency distributions. I've debugged a nasty concurrency issue by modeling it in TLA+ and then fixing the bug (full disclosure: once I thought through the TLA+ model, the bug was fairly obvious to me, but the modelling itself was the valuable exercise.) I've used MILP solvers for capacity planning our boxes. I've designed queue backpressure through probabilistic analysing. Each of these things has been crucial in designs I've used, but I only encounter a problem like this once every some years. (And these days I often write more docs than code.)

Re: The Mathematical Hacker (2012)

#18
post #9

In Steve Yegge’s linked post: > Math is a lot easier to pick up after you know how to program. In fact, if you're a halfway decent programmer, you'll find it's almost a snap. This couldn’t be more wrong. Mathematics is the hardest thing I have ever done. I’m sorry, but mathematics is orders of magnitude more intensive and difficult than most programming. A simple fact that shows this is the amount of programmers who…

Implementing numerical solutions for math concepts can give you insight into the math ex. Newton-Raphson Method or FFT. I would not sell yourself short on being able to understand. You may not be skilled at doing all the symbol manipulation required for what people consider typical "math" but that does not mean you cannot understand it.

Re: The Mathematical Hacker (2012)

#20
post #2

(2012)

Discussed:

https://news.ycombinator.com/item?id=4796586 (2012, 1 comment)

https://news.ycombinator.com/item?id=4915328 (2012, 133 comments)

https://news.ycombinator.com/item?id=6953774 (2013, 102 comments)

https://news.ycombinator.com/item?id=20142828 (2019, 86 comments)

Post reply on HN