Hacker News new | ask | show | jobs
by ColinWright 1666 days ago
You seem to be complaining that math isn't programming, that it's something different, and you've discovered that you don't like how mathematicians do math.

Math notation is the way it is because it's what mathematicians have found useful for the purpose of doing and communicating math. If you are upset and disappointed that that's how it is then there's not a lot we can do about it. If there was a better way of doing it, people would be jumping on it. If a different way of doing it would let you achieve more, people would be doing it.

It's not laziness, and I think you very much have got the wrong idea of how it works, why it works, and why it is as it is. Your anger comes across very clearly, and I'm saddened that your experience has left you feeling that way.

Maths is very much about communicating what the results are and why they are true, then giving enough guidance to let someone else work through the details should they choose. Simply giving someone absolutely all the details is not really communicating why something is true.

I'm not good at this, but let me try an analogy. A computer doesn't have to understand why a program gives the result it does, it just has to have the exact algorithm to execute. On the other hand, if I want you to understand why when n is an integer greater than 1, { n divides (n-1)!+1 } if and only if { n is prime } then I can sketch the idea and let you work through it. Giving you all and every step of a proof using Peano axioms isn't going to help you understand.

Similarly, I can express in one of the computer proof assistants the proof that when p is an odd prime, { x^2=-1 has a solution mod p } if and only if { p = 4k+1 for some k }, but that doesn't give a sense of why it's true. But I can sketch a reason why it works, and you can then work out the details, and in that way I'm letting you develop a sense of why it works that way.

Math isn't computing, and complaining that the notation isn't like a computer program is expressing your disappointment (which I'm not trying to minimise, and is probably very real) but is missing the point.

Math isn't computing, and "Doing Math" is not "Writing Programs".

4 comments

I really, really appreciate your reply and its tone. Thank you for that. You've given me some things to think about.

I often wish people were more like computers. It probably wouldn't make the world better but it would make it more comprehensible.

Thanks for the pingback ... I appreciate that. And thanks for acknowledging that I'm trying to help.

It might also help to think of "scope" in the computing sense. Often you have a paragraph in a math paper using symbols one way, then somewhere else the same symbols crop up with a different meaning. But the scope has changed, and when you practise, you can recognise the change of scope.

We reuse variable names in different scopes, and when something is introduced exactly here, only here, and only persists for a short time, sometimes it's not worth giving it a long, descriptive name. That's also similar to what happens in math. If I have a loop counting from 1 to 10, sometimes it's not worth doing more than:

    for x in [1..10] {
      /* five lines of code */
    }
If you want to know what "x" means then it's right there, and giving it a long descriptive name might very well hamper reading the code rather than making it clearer. That's a judgement call, but it brings the same issues to mind.

I hope that helps. You may still not like math, or the notation, but maybe if gives you a handle on what's going on.

PS: There are plenty of mathematicians who complain about some traditional notations too, but not generally the big stuff.

> We reuse variable names in different scopes

This example works against you. Scope shadowing is nearly universally considered bad practice, to the point that essentially every linter is pre-configured to warn about it, as are many languages themselves (eg prolog, erlang, c#, etc)

To a programmer, you're saying "see, we do it just like the things you're taught to never ever do"

.

> You may still not like math, or the notation,

The notation is probably fine

What I personally don't like is mathematicians' refusal to provide easy reference material

Programmers want mathematicians to make one of these: https://matela.com.br/pub/cheat-sheets/haskell-cs-1.1.pdf

It doesn't have to be perfect. We don't need every possibility of what y-hat or vertical double bars means. An 85% job would be huge.

> Programmers want mathematicians to make one of these: https://matela.com.br/pub/cheat-sheets/haskell-cs-1.1.pdf

There are lots of maths cheat sheets like that. Maths is big, like all-programming-languages big. Just like in programming, notations are re-used in different areas with different meanings, and different authors sometimes use different notation for the same meaning. A universal cheat sheet is impossible (just like a general programming cheat sheet is), but many cheat sheets or notation reference pages exist for particular contexts, one of which is "the basics", e.g. https://www.pinterest.nz/pin/734016439237543897/. Try searching or image searching for [math cheat sheet], [linear algebra cheat sheet], etc.

> mathematicians' refusal to provide easy reference material

This is an absurd claim. There is no such general refusal. On the contrary, many mathematicians provide their students with relevant easy reference material constantly. We sometimes spend entire semester-long courses providing easy reference material, and there are many books with exactly the kind of cheat-sheet you want inside the cover, or in an appendix or front matter (as well as the ones on the internet mentioned above).

> There are lots of maths cheat sheets like that.

I have never found one that gets me through the average undergraduate CS paper.

If you know one, I would greatly appreciate a tip. Unfortunately, I saw what you offered, and that's not it.

.

> A universal cheat sheet is impossible

I explicitly stated that this was a non-goal.

.

> one of which is "the basics", e.g. https://www.pinterest.nz/pin/734016439237543897/.

That one is far too basic. It doesn't even have things like average, or absolute value. It includes things nobody needs explained, like subtract, and things that aren't math, like logical operators.

This is why I said "yes, people have tried, but nobody has succeeded."

The explicit context was the average software paper. We're talking about programmers.

.

> > mathematicians' refusal to provide easy reference material

> This is an absurd claim.

Lots of people in here seem to agree with me. YMMV.

Feel free to provide me easy reference material.

.

> On the contrary, many mathematicians provide their students with

> We sometimes spend entire semester-long courses

The explicit context is "to people who aren't mathematicians or mathematics students."

Remember, we're talking about programmers who are appealing to the mathematics community for help.

If your response to "you guys won't give programmers a short easy two page PDF at the level we need" is to remind me that you give your own students semester long courses, then you've absolutely failed to understand what's being said.

.

> there are many books with exactly the kind of cheat-sheet you want inside the cover

Every time I ask for one, I get something with symbols meant for children learning arithmetic, like the one you gave. It explains plus and percent.

Again, ๐—ง๐—ต๐—ฒ ๐—ฐ๐—ผ๐—ป๐˜๐—ฒ๐˜…๐˜ ๐—ถ๐˜€ ๐—ฝ๐—ฟ๐—ผ๐—ณ๐—ฒ๐˜€๐˜€๐—ถ๐—ผ๐—ป๐—ฎ๐—น ๐—ฝ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ฒ๐—ฟ๐˜€ ๐˜๐—ฟ๐˜†๐—ถ๐—ป๐—ด ๐˜๐—ผ ๐—ด๐—ฒ๐˜ ๐—ต๐—ฒ๐—น๐—ฝ ๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐—–๐—ฆ ๐—ฝ๐—ฎ๐—ฝ๐—ฒ๐—ฟ๐˜€ ๐˜„๐—ฟ๐—ถ๐˜๐˜๐—ฒ๐—ป ๐—ฏ๐˜† ๐—บ๐—ฎ๐˜๐—ต๐—ฒ๐—บ๐—ฎ๐˜๐—ถ๐—ฐ๐—ถ๐—ฎ๐—ป๐˜€.

If you think we need plus explained to us, and that the next step is an insular semester long lecture course that isn't offered to us, then how can you possibly be surprised that we think you failed us?

.

> as well as the ones on the internet mentioned above

You only mentioned one. The other one is something I gave, from our community, trying to explain to you the kind of thing I want.

It covers topics like monads, pattern matching, infix, operator precedence, typeclasses, infinite lists, codata, higher order functors, special folds, tuples, numerics, modules, tracing, list comprehensions, and dealing with the compiler itself.

You patted me on the head and taught me that * means times.

I continue to feel that the mathematics community refuses to understand the needs of the programming community, or provide appropriate reference material.

It's either "this is arithmetic" or "let's do linear equations in russian"

There's no practical middle ground and you seem resistant to even understanding that such a thing exists

Programmers aren't ignorant like the other mathematicians in here have repeatedly said. You can't do our things any more than we can do yours. We've seen your code.

It's just that when you ask us for appropriately costed reference, we comply, and you do not even grok.

You really put up a thing that explained `less-than`, as if that was what you were being asked for.

It turns out that most programmers know what the equals sign means.

There is nothing of practical value in the actual domain space being talked about, here.

Nothing here is beyond a highschool pre-calculus class. That is not the level that professional programmers need.

I don't mean to seem rude, but it feels a little bit like being talked down to, having it suggested that this is the level of help my occupation is asking for.

The statisticians can do it: http://web.mit.edu/~csvoss/Public/usabo/stats_handout.pdf

This isn't far off: https://en.wikipedia.org/wiki/Glossary_of_mathematical_symbo...

> I have never found one that gets me through the average undergraduate CS paper.

That cheat sheet would be written by CS folks, since every applied domain uses their own quirks in their notations. Mathematicians can't help you there. You can't blame mathematicians for the shortcomings of CS researchers.

Many textbooks have pages that explain the mathematical notation used. Here's an example from a linear algebra textbook: http://linear.ups.edu/html/notation.html

But it doesn't make sense to put lists of notation everywhere mathematical notation is used like in a journal or because the audience is already expected to know it. If the author does something weird or non-standard it's typically explained, sometimes it's even explained if it's pretty standard.

Different branches of math, physics, statistics,etc. will redefine the same symbols to mean different things but that's not much different from programming languages. & in C++ has a different meaning than & in R. Like the first step of understanding someone else's code is to know what language your looking at it's important to understand the context of what you're looking at. Look at previous cites, relevant textbooks, ask around, reread the paper again. I've read some papers a dozen times easy before it clicked.

> This example works against you. Scope shadowing is nearly universally considered bad practice

So you never used the same variable name in two different scopes ever? Like, if a function takes argument "name", no other function you ever write again in any program can have a variable named "name" unless it is the same exact usage?

Or, as is commonly complained about in math, every programmer in the world then use the variable "name" only for that usecase and otherwise comes up with a new name for it?

Having different scopes doesn't imply shadowing, it just means that you define it and then use it and then scope goes out and it no longer exists. No mathematician knows even close to every domain, so different domains of math uses notation differently. It is like how different programmers programs in different programming languages. It is such a waste to have so many programming languages, but people still do it for legacy reasons.

> So you never used the same variable name in two different scopes ever?

That's not what shadowing is.

.

> Having different scopes doesn't imply shadowing

I didn't say that it did.

.

> No mathematician knows even close to every domain

this is irrelevant to a lightweight two page cheat sheet for simple mathematial symbols

part of the problem is that if we ask you for a simple thing that isn't perfect or exhaustive, you lecture us on how no document could contain every concept

that's very clearly not what's being requested of you. the same is true of haskell. that sheet doesn't contain all of haskell. i doubt anybody knows all of haskell, which of course is far smaller than mathematics.

i'd like to stay in the practical world. it was clearly stated that an exhaustive solution was a non-goal.

let's try to do one thing that doesn't have a limit at infinity. (i'm sorry, i'm a programmer, math jokes are hard)

surely you've made food, right? did you learn the recipe from a cookbook? did it contain every ingredient and recipe that any cook ever knew? did it go over the chemistry of the protein denaturing, the physics of the water boiling, the ethics of importing the burner fuel, allergy responses, cultural backgrounds, molecular weights, how to make things in a duck press?

no?

was that because the cookbook was just good enough? it was just like "use this much chicken and this much onion, two tortillas, some cilantro and lime?"

nobody wants exhaustive anything. if you managed somehow to produce that (ie by just giving the manual page to the wolfram language) it would be rejected as the exact opposite of what was being requested.

the thing you're protesting is the i'm saying is the wrong job.

cool beans. the thing i'm actually asking for is straightforward.

someone already gave me one, but the difficulty level was aimed at children, instead of professional programmers, the space requested, while also calling me ignorant. it's a shame; that one was almost it.

but it should be things like `ลท` and `||x||` and whatever. it should include sum, integral, and product for the juniors. For `|x|` it should say "Absolute value, magnitude, length, or cardinality."

it doesn't need `||x||` because we need someone to teach us what absolute value and cardinality and so on mean. it needs `||x||` because we forgot what double-bar says, and if we have that list of four things, we can figure out which one it is just like you can.

we know what magnitude is. we just don't know what `||foo||` says.

we just need our cracker jack decoder rings. we get the ideas. we don't get your letters.

It's not explaining anything. It's just a cheat sheet. You aren't solving education. C'mon.

This isn't too far off: https://en.wikipedia.org/wiki/Glossary_of_mathematical_symbo...

.

> It is such a waste to have so many programming languages

if you say so. i rather like the several that i created.

things aren't a waste just because you don't know what they're for.

you might as well assert that it's a waste that there are so many tools in the shop.

The statisticians can do it: http://web.mit.edu/~csvoss/Public/usabo/stats_handout.pdf

.

> every programmer in the world then use the variable "name" only for that usecase and otherwise comes up with a new name for it?

this isn't terribly uncommon, primarily because our culture is to use long descriptive names, which have a far lower natural collision rate

i do get that symbols can overlap. that's okay! nobody's complaining about that. it's fine for `||x||` to mean four things. we're just as bad as you are about that. there's half a dozen meanings for stack, another five for heap, seven for map, five for vector, i don't even want to get into what a mess "array" is, et cetera.

but if i was writing a cheat sheet for you, I could write `< > generally means a generic type, a tuple, greater than less than, an HTML/XML/SGML tag, an email inclusion, or an IRC handle`

Is that exhaustive? Naw. I can name another dozen off the top of my head.

But that's generally going to be good enough.

All I want is generally good enough. just please write down what they are?

> That's not what shadowing is.

But that is what mathematicians do. Why did you bring up shadowing if it isn't relevant?

> Math notation is the way it is because it's what mathematicians have found useful for the purpose of doing and communicating math.

That's only really a good description for the most well trod areas, where people habe bothered to iterate. I think a more realistic statement would be:

"Math notation is the way it is because some mathematician found it sufficient to do and communicate math, and others found it tolerable enough to not bother to change."

Personally, though, my problem has always been where publications use letters and symbols to mean things that are just "known" in some subfield that isn't directly referenced. It's not a problem for direct back and forth communication during development, true, but it dramatically increases the burden on someone who wants to jump in.

I mostly agree with you.

That all said, it would still be quite nice if it was somehow more accessable. A lot of papers containing material that's probably actually quite standardizable remain opaque to me, and the notation invariably falls by the wayside if there's a code or language description available.

Many times, math notatons have been thought to be minimal, or most clear possibly, only to fall by the wayside

Whereas this notation serves domain specialists well, it still leaves people like me somewhat confused

A cheat sheet - even to the practical norms - would go a long way

This is a pretty good defense. Well done.