Live data from Hacker News

Why math is painful to read

matusiak.eu

41–50 of 106 posts

Re: Why math is painful to read

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

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

Re: Why math is painful to read

#42
post #36

> But are mathematicians too embroiled in some misguided quest for Huffman coding? I think that yes, they are: for centuries, mathematics has been written by hand. It's much easier to write 'f' than 'force'. on a blackboard. Moreover, when writing on paper, with ink that you have to make or buy, with a pen that wears out as you write with it, it makes sense that early mathematicians would embrace a compressed notatio…

The compressed notation is not just about saving paper and ink.

It's all about the amount of mental power and work you have to exert. If I'm filling a few pages with equations, if I have to write 'force' instead of 'f' all over the place, it's going to take me about 5 times longer. I'm going to only fit 1/5 of the content on each line and page, (OK, 1/5 might be excessive, but the principle holds I feel).

Programming languages have similar properties. Why don't we always write integer instead of int, loop_variable instead of i, and have no compact way of writing unnamed lambda functions?

Re: Why math is painful to read

#43

Disagree strongly. Math is often the easiest and simplest thing that works for the class of problems it exists to solve. Imagine trying to explain singular value decomposition without the notion of a matrix. No group theory, no well-formed concept of a linear transformation or function . You wouldn't be able to do it. No one even had such ideas before generations of mathematical machinery had been built. I've come to…

I think you make a really good point about the power of mathematical notation and conventions. However, I completely agree with the article. Do mathematical formulas have to use Greek letters rather than useful variable names like "distance" or "speed"? Does C's syntax actually allow you to express something you can't in Python? Or is it more terse for historical reasons? (And never mind that it's a good idea to use…

> Do mathematical formulas have to use Greek letters rather than useful variable names like "distance" or "speed"?

I feel that using "useful variable names" like you describe would actually make it less useful because they overlap with common language and writing them out in say, formula, would make them too long (and thus less readable).

I find that for any common topics, there's a subset of "default" variable names that are used so often that when you see it, you pretty much instantly recognize what it's meant to represent anyway. Using Greek letters is no problem as you get used to it eventually, and they make things stand out more than simply using the 26-characters Latin alphabet.

Re: Why math is painful to read

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

I couldn't possibly disagree more with your post. :)

The language of math requires exact precision which makes extracting what the series of abstract symbols "mean" incredibly difficult. Trying to learn new mathematical concepts from wikipedia is damn near impossible. Here are two examples.

b-spline: http://en.wikipedia.org/wiki/B-spline spherical harmonics: http://en.wikipedia.org/wiki/Spherical_harmonics

Trying to figure out what those walls of symbols mean requires quite a lot of focus. Dig up source code for either and it's orders of magnitude easier to understand. The images for spherical harmonics conveys more meaning and understanding in a fraction of a second than spending 3 hours with a piece of paper and the equations would.

The language of math sucks.

Re: Why math is painful to read

#45
post #30

People seem to be pretty critical of this post, but can anyone give me a good reason why math notation shouldn't have some concept of scope? I can't see any downsides. It would certainly help me puzzle out my professor's notes when he has used f to mean three different things in as many lines.

There is some concept of scope in math. At a fairly early level, a student learns sums and integrals. The variable of integration/summation's scope is just within the integral/sum.

At a higher level, some things have scope equal to a subfield of mathematics. A gothic p, for example, represents a prime ideal in algebraic number theory. It represents a parabolic Lie algebra in Lie theory. (Actually this causes problems when you're doing Lie theory and number theory at the same time.)

Re: Why math is painful to read

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

The idea is - if the reader doesn't grok direct products or cyclic groups, he's fucked anyways, so why bother ? And if he does grok them, why impose cognitive overload by spelling it all out in great detail, just use 1-character symbols and move on.

This case analysis works if you only consider people who've been sitting in on the class the whole time, but someone who appears mid-way through the semester (or analogously, starts looking at some project's code without having been involved in its development) may understand group theory and still have trouble following the lecture.

// Compute the direct product of 2 cyclic groups

I would much rather give the function a name that describes its purpose (and give a full description in a comment at the function's definition) than annotate every use of the function.

Re: Why math is painful to read

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

I couldn't possibly disagree more with your post. :) The language of math requires exact precision which makes extracting what the series of abstract symbols "mean" incredibly difficult. Trying to learn new mathematical concepts from wikipedia is damn near impossible. Here are two examples. b-spline: http://en.wikipedia.org/wiki/B-spline spherical harmonics: http://en.wikipedia.org/wiki/Spherical_harmonics Trying to…

For the sake of an argument, let's assume you are right, and the language of math sucks.

Then, we have had centuries of mathematicians inventing ever changing notations and ending up with a notation that sucks.

If so, those mathematicians must be extremely stupid. Surely persons of average intelligence must be able to come up with better notations, and find proofs for stuff that is out of reach of those morons?

I do not rule out that notation can be improved. After all, it took millennia to move from Greek and Roman arithmetic systems to Arabic notation. There is no reason to assume we have reached a global optimum. However, I also find it unlikely that mathematical notations truly are stupid.

Your argument is like someone complaining about the difficulty of discriminating between "37" and "73" because it is way easier to see the difference between 37 and 73 scratches in a piece of wood.

Re: Why math is painful to read

#48
post #43

Earlier quoted context omitted.

I think you make a really good point about the power of mathematical notation and conventions. However, I completely agree with the article. Do mathematical formulas have to use Greek letters rather than useful variable names like "distance" or "speed"? Does C's syntax actually allow you to express something you can't in Python? Or is it more terse for historical reasons? (And never mind that it's a good idea to use…

> Do mathematical formulas have to use Greek letters rather than useful variable names like "distance" or "speed"? I feel that using "useful variable names" like you describe would actually make it less useful because they overlap with common language and writing them out in say, formula, would make them too long (and thus less readable). I find that for any common topics, there's a subset of "default" variable names…

Also depending on the discipline you're working in you can make very confident assumptions about what a random mathematical object is depending on which language it is typeset in. In the context of programming language type systems, for example, a Greek letter is almost always an ML style type variable (think Haskell type a -> b -> a stuff) whereas Roman type is almost always a ground object (int, bool, whatever). Vectors are boldface, groups are capitals, fields are blackboard bold, lowercase letters in a group context are almost certainly group elements... In some contexts you're actually reaching for new alphabets (e.g. the Hebrew letters that are used for infinite cardinals) to be even more distinctive.

Re: Why math is painful to read

#49
post #14

The real reason math is hard to read is that it's the distillation of a thousand winding ideas and failed attempts that took hundreds of hours of thinking and hundreds of pages of scribbling, all condensed into the most concise possible three pages of unmotivated line-by-line proof with no context or explanation. In other words, math is a language for formalizing intuition which, when finally written, unfortunately r…

That about sums it up. It's made worse by professors who have been trained to teach things in an unmotivated fashion.

I had a graduate probability teacher who said (paraphrased) "one of the beautiful things about math is that you start with a definition, and you prove some very simple things with the definition... so simple that you feel you're just using circular reasoning. Then you find that your definition is equivalent to a useful property!"

Actually, what happened when the stuff was developed is that someone wanted the useful property, and managed to rationalize a definition which fit. (example: group theory was done for hundreds of years before we had a definition of group. Noether noticed that a lot of folks were writing the same sorts of things in different contexts, so she distilled it down to three axioms.)

For a really concrete example, consider ordered pairs. A person being coy about their intent would say that "we define an ordered pair (x,y) on a set S as a set of the form {{x},{x,y}}, where x and y are in S."

It's safe to say that no one thinks of an ordered pair in that fashion. The intent was to have two ordered pairs be equal if and only if each of the two coordinates are equal. You can prove this from the above definition, but it's far more helpful to tell the audience in advance that we really want a structure with this property.

Re: Why math is painful to read

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

I would argue that the self-documenting code in your first example (albeit excessively verbose to suite your argument) is better than having to put a comment above every terse statement one writes?.

Programming with descriptive and meaningful variable / function names that have intrinsic meaning skips this step: 'wait, what was the cg2 again? let me waste time by looking back through the code and figuring that out again'. Particularly for others reading your code later.

But I try to fit somewhere in between the two examples you've shown, meaningful but not too long -> the benefits of longer variable / functions names diminishes when names get too long as variable names tend to blend together (see law of diminishing returns).

Post reply on HN