Live data from Hacker News

The Mathematical Hacker (2012)

evanmiller.org

81–90 of 186 posts

Re: The Mathematical Hacker (2012)

#81

Earlier quoted context omitted.

I disagree because Math is programming. All those symbols you see map to a set of steps (a program.). It’s just knowing what subroutine every esoteric symbol stands for that’s hard. I will agree it’s been more difficult learning math than programming for myself as well: but that’s because math is geared and targeted for people who like doing symbolic logic by hand. Math people think we’re a level below them (we are i…

>All those symbols you see map to a set of steps (a program.) Simply not true. Most mathematical statements, e.g. proofs of existence have no relation to a "program". >math is geared and targeted for people who like doing symbolic logic by hand. No, it is not. There is absolutely nothing interesting about symbol manipulation, it is always the least interesting part of a proof. It usually is the part the author handwa…

>Simply not true.

Okay. What is a proof other than a step by step explanation for why something’s true? You’re getting caught up in “program” when it’s objectively the case that all math follows a series a steps. A lot of those steps are “handwavy” I’ll give you that. That’s not relevant to what I said though.

>there is nothing interesting about symbol manipulation

Cool. You missed my entire point again. Math education is geared towards a certain set of people who pick up on (and gain an interest in) the language of math. Only once you get to higher level math do you even start to get alternative visualizations etc (at which point you’ve weeded out a ton of people who would have benefited from e.g. visualizing numbers as groups of shapes). There are a million ways to teach math and we’re leaving a lot of people behind. That was my point

Re: The Mathematical Hacker (2012)

#82
post #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 of…

The matrix based method for Fib can be understood as applying the closed-form solution over Q(sqrt5). OP seems to miss this point.

My thoughts at this point in the original article was:

Well - if you want to demonstrate how mathematics helps here, then you should mention that computing the n-th fibonnaci number can be computed as the n-th power of the matrix [[1,0],[1,1]], and that the most efficient way to compute powers (in any associative domain) is the repeated squaring algorithm.

Re: The Mathematical Hacker (2012)

#83
post #60

Earlier quoted context omitted.

I disagree because Math is programming. All those symbols you see map to a set of steps (a program.). It’s just knowing what subroutine every esoteric symbol stands for that’s hard. I will agree it’s been more difficult learning math than programming for myself as well: but that’s because math is geared and targeted for people who like doing symbolic logic by hand. Math people think we’re a level below them (we are i…

I think the math you've been exposed to is mostly on the computational side (compute an integral, solve an equation, etc). Much (most?) of math is quite different from it. Proving that there is a well ordering of the reals, and simultaneously proving that it is impossible to show you such an ordering: Very different from skills needed in programming.

I disagree. You’re only able to prove that ordering of the reals (and that it’s impossible to show) because you are computing the abstract structure underlying the reals (which is based on some lower level ideas etc.) Just because a problem is computationally hard with a step by step CPU doesn’t mean it isn’t computation.

This is actually a problem of interest to me, so I’ve definitely been exposed to it and the limits of modern computation. But I’m not speaking strictly about the modern day CPU.

Re: The Mathematical Hacker (2012)

#84

Earlier quoted context omitted.

I would hard disagree that undergrad level Analysis or even just the trickier corners of vector calculus are within the bounds of what programmers can easily pick up without dedicated and guided study. Everybody's gangster until they have to parameterize some bullshit helical structure in R3. Comparable levels of programming, what we expect of CS juniors, are regularly picked up by "the guy who is good with Excel" in…

> I wouldn't even begin to understand how to self-teach myself Stokes Theorem or some shit Input it into a proof assistant, and rely on the same sort of feedback "does the computer accept your proof, or get stuck". The hard job of formalizing stuff for this purpose has seen significant progress, e.g. by the Lean mathlib project.

> Input it into a proof assistant, and rely on the same sort of feedback "does the computer accept your proof, or get stuck". The hard job of formalizing stuff for this purpose has seen significant progress, e.g. by the Lean mathlib project.

As a math teacher who disagrees with the premise of the GGP post ("This couldn’t be more wrong. … I’m sorry, but mathematics is orders of magnitude more intensive and difficult than most programming"), and thinks that any good programmer can learn mathematics—of course there are code wodgers out there who don't really understand their craft of programming, and so can't translate that knowledge to facilitate an understanding of mathematics—I think I also disagree with this. I've never tried it, but I can't imagine someone learning about Stokes's theorem in anything like this way. One of the many axes along which I imagine this failing are that the state of human readability in proof assistants is, well, let's say it's less well developed than the, cough, stellar state of the art in compiler error messages.

But, more importantly, you can, at least in principle, know every single step in a proof of Stokes's theorem without understanding in any real sense why it's true—and a proof assistant in particular will force you into the weeds of minutiae that absolutely do not help to build any intuitive picture—and, even if you manage in the process to piece together that understanding of why it's true, you will never thereby gain an understanding of why it's interesting (e.g., among other things, its connections to physics and the entrée it offers to differential geometry).

Re: The Mathematical Hacker (2012)

#85

Earlier quoted context omitted.

I would hard disagree that undergrad level Analysis or even just the trickier corners of vector calculus are within the bounds of what programmers can easily pick up without dedicated and guided study. Everybody's gangster until they have to parameterize some bullshit helical structure in R3. Comparable levels of programming, what we expect of CS juniors, are regularly picked up by "the guy who is good with Excel" in…

> I wouldn't even begin to understand how to self-teach myself Stokes Theorem or some shit Input it into a proof assistant, and rely on the same sort of feedback "does the computer accept your proof, or get stuck". The hard job of formalizing stuff for this purpose has seen significant progress, e.g. by the Lean mathlib project.

Self teach Stokes Theorem by inputting it into a proof assistant? Are you serious? That is very inefficient; the OP was talking about learning the kind of vector calculus taught in first calculus sequence. I think just watching a short YouTube video and doing a few exercises will work and is a proven method. Proofs of theirebs are very often much more complicated than applying them (understatement intended).

Re: The Mathematical Hacker (2012)

#86
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…

I'd agree: there's a common misconception that math is "objective." Even if one agrees on the axioms (Axiom of Choice [1]), one must reach consensus on definitions, which seem to be consciously chosen to allow generalization of theorems to more mathematical objects; that is, building connections between previously disparate fields of math, e.g. algebra and geometry, calculus and geometry, etc. Why have many domain-sp…

> That said, I think when people speak of math, they speak of its application to the real-world, not the proofs.

I think it very much depends on who the people are. I'm a math teacher, and, when I speak of math, I definitely don't just mean its applications to the real world. I definitely think programming—in the sense of thinking about the craft, not just cudgelling the computer into doing what one wants—is good preparation for learning the proof-theoretic arts of mathematics.

Re: The Mathematical Hacker (2012)

#87
post #24

> 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 h…

I 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 seq…

I 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.

Re: The Mathematical Hacker (2012)

#88

I really like this article, but there’s something the author is not considering: https://lee-phillips.org/lispmath/

As pointed out above - the most efficient to compute large fibonacci numbers is to compute the matrix power [[1,0],[1,1]]^n using repeated squaring. Or you could use the known identities to compute Lucas numbers, which amount to the same thing. The lispmath talks about computing fib(40000) in 100..200 ms, the repeated squaring approach computes the same number in < 5 ms (on my not very powerful machine).

Re: The Mathematical Hacker (2012)

#89

Earlier quoted context omitted.

>All those symbols you see map to a set of steps (a program.) Simply not true. Most mathematical statements, e.g. proofs of existence have no relation to a "program". >math is geared and targeted for people who like doing symbolic logic by hand. No, it is not. There is absolutely nothing interesting about symbol manipulation, it is always the least interesting part of a proof. It usually is the part the author handwa…

>Simply not true. Okay. What is a proof other than a step by step explanation for why something’s true? You’re getting caught up in “program” when it’s objectively the case that all math follows a series a steps. A lot of those steps are “handwavy” I’ll give you that. That’s not relevant to what I said though. >there is nothing interesting about symbol manipulation Cool. You missed my entire point again. Math educati…

>Okay. What is a proof other than a step by step explanation for why something’s true?

Cooking instructions are a series of steps as well. Would you also claim cooking, mathematics and programming really are all the same thing?

Re: The Mathematical Hacker (2012)

#90
post #65

Earlier quoted context omitted.

I never said that mathematics "is about computation." What I did say is that writing down mathematics is equivalent to writing software. Both require the use of a formal system .

>I never said that mathematics "is about computation." But programming is about computation. If mathematics isn't about computation as well, then they are not alike. >What I did say is that writing down mathematics is equivalent to writing software. It is not. That is plainly false. E.g. mathematics considers objects which are not computable and makes non-computable calculations with those objects. I am aware that yo…

>> What I did say is that writing down mathematics is equivalent to writing software.

> It is not. That is plainly false.

Whether the two look the same or not, maths and computer programs are in fact fundamentally isomorphic. [1]

[1] https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspon...

Post reply on HN