Live data from Hacker News

Why math is painful to read

matusiak.eu

61–70 of 106 posts

Re: Why math is painful to read

#61
post #12

Really good point. That always annoys me with most formulas. I have to dig back several paragraphs (with no scope/indexing tool) to figure out what the individual variables mean. And a lot of papers do not even bother to explain some variable but just assume the reader already knows it. One of the earlier commenters made this mistake very prominently enthusing over Maxwell's equations. Yes of course the formula looks…

Maxwell's equations were not "written down to explain it to someone who doesn't already know what it means". They, quite simply were written down to express relationships between the motion of charge, and the behavior of electric and magnetic fields as a consequence.

You have to understand the physics behind the equations (what's charge? what's an electric field) as well as the mathematical structure (what's a vector space? what's a line integral?) in order to make use of them. They are equations used to answer questions like "What happens to the strength of this magnetic field if I increase the velocity of this charged particle responsible for generating it"? They aren't meant to be explanatory (but have the beautiful side-effect of explaining how light propagates in a vacuum.)

Re: Why math is painful to read

#63
post #41

Earlier quoted context omitted.

> When you try to write the algorithm, you're going to be reminded of its meaning, fast. Exactly, and forced to replace implicit assumptions with explicit instructions to make it work.

But that said, what about pure existence proofs? There are algorithms that we can prove exist, but we have no idea how to find them.

The programming is a tool to aid learning, not replace all the other tools at your disposal. Use it when it helps.

Re: Why math is painful to read

#64
No doubt about it, mathematical notation can be difficult to read. It's terse, conceptually dense, operators are commonly overloaded, etc., etc.

But that's not why it's hard to read. Math is hard to read, I think, because math is hard:

(1) Some core mathematical concepts are fundamentally difficult. Notions like infinity (and different kinds of infinity!) are entirely foreign to our daily experience.

(2) In addition, mathematics is more abstract than most programming. Tim Gowers, in his lovely little book Mathematics: A Very Short Introduction, writes:

    What is the black king in chess? This is a strange question, and the most satis-
    factory way to deal with it seems to be to sidestep it slightly. What more can one
    do than point to a chessboard and explain the rules of the game, perhaps paying
    particular attention to the black king as one does so? What matters about the
    black king is not its existence, or its intrinsic nature, but the role that it
    plays in the game.
    
    The abstract method in mathematics, as it is sometimes called, is what results
    when one takes a similar attitude to mathematical objects.
This sort of abstraction is, I think, abhorred by many programmers. But it's the reason single-letter variable names are common in mathematics. There's no way to describe what a mathematical object is with a name relating it to some real-world, concrete, familiar thing, as programmers often try to do. You can only describe what it does by writing down some rules it obeys.*

(3) In math, concepts are inherently more hierarchical than is common in programming. As programmers, we're all familiar with building higher-level things from lower-level pieces. And we try, and often succeed, in building them up in ways that let other people use them without needing to know much of anything about the lower-level pieces. In math, there's a similar accretive process, but because the concepts are so much more abstract, it's often impossible to understand how a high-level concept behaves without understanding how its lower-level constituents behave. Mathematical concepts are conceptually hierarchical, whereas pieces of programs are often structurally hierarchical, but conceptually (nearly) orthogonal.

* — (A controversial aside.) An object-oriented mindset can exacerbate the problem by demanding that we reify concepts into objects that represent what they "are". This is often impossible, hence the inscrutable object names we've all laughed and despaired at.

Phil Karlton's well known witticism comes to mind:

    There are only two hard things in computer science: cache invalidation and naming
    things.  
Naming things is hard because, just like in math, we sometimes lack a familiar semantic reference for the concepts we deal with as programmers.

Conversely, in functional languages, there's less need to think about what something "is", because the natural way of programming is to define relations (functions) on a small number of core data structures. Interestingly, single-letter variable names are also common in some functional languages, like Haskell, because it generally doesn't matter what the data is so long as you know what you can do with it. And that information is embodied in its type, expressed in its type signature, and enforced by the type-checker at compile time.

Re: Why math is painful to read

#65
post #27

Earlier quoted context omitted.

I don't think anything, I was recalling what I heard Sussman say at a conference, which he makes clear in http://en.wikipedia.org/wiki/SICM . Though I saw him a good 8 years after the book, so I'm sure he'd grown some new opinions. He is of the opinion that if you can't write the algorithm, you don't understand it; forcing students to write the algorithm aids in teaching them a real understanding. He spent quite a bi…

He is of the opinion that if you can't write the algorithm, you don't understand it; forcing students to write the algorithm aids in teaching them a real understanding. Absolutely. I had memorized the notation for derivatives. Until I was able to realize how the notation tied to finite numerical approximations, I never really understood it. If you don't know what I'm talking about, the right way to approximate (d^2/d…

That is fine for you, not everyone needs to know about Wiener path integral formulation of quantum mechanics ... which is based on functions that are almost continuous everywhere but nowhere differentiable (the set of functions that are differentiable and with which you are familiar is a set of measure zero i.e. it is comparable to using only integers instead of real numbers). The limit process, which you discard as not meaning anything, is essential to understand the Wiener path integral formalism. Fortunately, mathematicians and physicists did not "lose sight of that" ... and are able to go beyond what your limited understanding would limit you to. I don't mean this in a deragotary way - you obviously don't need to understand at a deeper level than you do; few people do ... but to those that need this deeper level, the mathematical formalism that you dismiss is, in fact, essential.

Edit: my apology for making an unwarranted assumption about what your level of understanding is.

Re: Why math is painful to read

#66
post #16

It seems to me like the author approaches math looking for a concise & elegant programming language, but instead just finds...math. The notion of scope as an integral part of mathematics is a particularly interesting suggestion. Mathematics is the study of abstract, quantitative truths (and falsehoods), and these truths, being universal, have universal scope (although you can constrain some truths as special cases of…

The notion of scope as an integral part of mathematics is a particularly interesting suggestion. Mathematics is the study of abstract, quantitative truths (and falsehoods), and these truths, being universal, have universal scope (although you can constrain some truths as special cases of more general truths, but I doubt this is what the author had in mind). To consider this a problem indicates that the author is searching for a tool rather than a way of thinking.

The scope issue is not just for theorems. In programming, scope is about what meanings get bound to what symbols, whether those symbols are types, operators, data, etc. Even in math, we can see a notion of "binding" vs. "bound" vs. "free" occurrences of a symbol: seeing something like "∀x∈N.x+k≥0" would make me think "Ok, I see what `x' is, but what's this `k'?" Treating every definition like it's at top-level makes for unreadable code and unreadable math. Ever had to search back through a document looking for the definition of some notation only to find it buried in an earlier proof of an unrelated theorem without so much as a "Definition: …" marker? I would much prefer not to have to do that again.

Transferred to another domain, "Why should we need scope? What good would that do?" becomes "Why should pronouns have antecedents? What good would that do?" It is important to acknowledge that mathematical notation is also a tool for explaining the ideas one has discovered with it.

Re: Why math is painful to read

#67
post #21
post #16

It seems to me like the author approaches math looking for a concise & elegant programming language, but instead just finds...math. The notion of scope as an integral part of mathematics is a particularly interesting suggestion. Mathematics is the study of abstract, quantitative truths (and falsehoods), and these truths, being universal, have universal scope (although you can constrain some truths as special cases of…

Completely agree with you, but from your experience, how many fewer do both very well? I have always been interested in both and I can't imagine having one tool without the other, as they both enhance the way that I think about things. Programming makes the concepts of variables and sigma notation even easier to understand, while math makes it far easier to solve problems. Do people actually get by in programming wit…

How much math do you think it took to program this website?

Re: Why math is painful to read

#68
post #23

Frankly, there are 2 kinds of programmers. People who do this: val result = directProduct(cyclicGroupOfDegree3, finiteAbelianGroupOfDegree7) and the second kind, people like me, who do this: // Compute the direct product of 2 cyclic groups val z = dP( cg1, cg2 ) You can easily guess that the 2nd kind are math majors. If my math professor started writing everything out in plain English like the first example, he'd nev…

To me, I highly prefer the first expression you've written (well, without the exaggerated style you've given it). The second may save you some time in the short run, but when you come back to your code in a year, you think you'll know what dP means? Differential of P? Distance to P? Distance from P?

I realize you've got a comment above it, but if you really code like that then you are very different from any code I've come across where the programmers used short, non-descriptive variable names.

As my coding has improved over the years, I've gone from an imperative, abbreviated variable style to a functional, long-named variable style. Even with the long names, my code is MUCH more readable and it's still about 2x less typing than the imperative style!

(Also, I don't think all math majors use that second style).

Re: Why math is painful to read

#69
post #27

Earlier quoted context omitted.

He is of the opinion that if you can't write the algorithm, you don't understand it; forcing students to write the algorithm aids in teaching them a real understanding. Absolutely. I had memorized the notation for derivatives. Until I was able to realize how the notation tied to finite numerical approximations, I never really understood it. If you don't know what I'm talking about, the right way to approximate (d^2/d…

That is fine for you, not everyone needs to know about Wiener path integral formulation of quantum mechanics ... which is based on functions that are almost continuous everywhere but nowhere differentiable (the set of functions that are differentiable and with which you are familiar is a set of measure zero i.e. it is comparable to using only integers instead of real numbers). The limit process, which you discard as…

I don't mean this in a deragotary way - you obviously don't need to understand at a deeper level than you do; few people do ...

Do you like to assume much?

I have a masters in mathematics. I likely understand a lot more than you give me credit for.

I do not "discard" the limit process. I'm saying that the d/dx notation, which we get from the old infinitesmal approach, has insights buried in it that most students miss. I certainly missed it for a long time.

Limits won for good reason - they were the first consistent approach to defining the derivative that mathematicians understood, and were a key step on the way to resolving the inconsistencies in previous definitions that Fourier series had revealed.

But limits are not actually "essential". I am personally aware of multiple completely rigorous formalizations of Calculus. The second most famous of which is Robinson's non-standard analysis, which has absolutely nothing looking like a limit in sight.

Re: Why math is painful to read

#70
post #6

I could not disagree more with that post. Mathematical notation is to Python what English would be to Assembly Language: it is a high-level notation, designed see the forest rather than getting lost in the trees. Take Maxwell's equations for example. After learning vector calculus and becoming familiar with its notation, you notice how much meaning you can extract at a quick glance from the four Maxwell's equations e…

1. I came into this thread expecting to find a math expert of some sort defending their "programming language". Thank you for not letting me down! 2. It depends on context. The people writing and manipulating mathematical formulae LOVE the short hand I'm sure... but for consumers of the information perhaps it's less than ideal.

This thread would be more informative if the post author had said _what_ he was trying to read. Most math is written to communicate with other mathematicians, so if he grabbed some random paper off of ArXiv then it's not at all surprising he found it hard to read. It also makes a difference if he's trying to actually learn about a subject, or just to apply some formulas without necessarily understanding him. Math is written differently for specialist and beginner audiences, with the very terse "CRC Handbook of X" off on some other axis.
Post reply on HN