Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"in math, there’s a lot of tacit agreement and assumptions that go on. Lots of shortcuts and conventions. So if you’re not steeped in that culture, it all looks like black magic to you." "The text will talk vaguely about an idea and then there will be a formula with all kinds of Greek letters, and no explanation of what those symbols mean. If you aren’t already familiar with them, you don’t stand a chance."

This issue has been bothering me for years. In a typical math forumla you find on wikipedia, there are many unnecessary symbols included + really critical things are left vague. I feel like mathematicians are at fault here. They should clean up their shit, maybe write these equations as code. When I translate one of these equations into code its always much much shorter, and it has the benefit of being 100% deterministic. Eg. one example f(X) (often drawn big and elaborate) means Y!!



Author of the original article here. I feel your pain, but again, it's just a different set of conventions. Mathematicians are used to f(x) = ... kind of notation. Once you get used to it, it makes total sense. That particular one I got used to ages ago. f(x) is the same as a function in your code. It takes and argument, x, and returns some value.

Often specific symbols have implicit meanings, like theta θ is pretty commonly used for some angle, r is often used to mean a radius. So you'll often see something like "r sin θ" with no explanation. At first it's meaningless, but once you know the conventions, it's crystal clear. It's considered so basic, that nobody would waste the space explaining it. Same is if you're reading something about code and something says "const float x = 0.1" or something. The author is probably not going to go into an explanation of what a const or a float is or what x means. You're expected to know.

So what I like about the book is that helps someone without knowledge of all these conventions to begin to understand them.


Thanks for taking the time to write about the book. As someone who had a hard time applying their school-taught knowledge about vectors and matrices when trying to understand OpenGL and Direct3D back in the early days ("why isn’t there a proper 'camera' object I can use") I really appreciate when people make an effort to offer alternative POVs to get deeper into topics they might not be familiar with.

Sometimes the right kind of intuition is all it needs to make it click. Sometimes it's that tiny bit of knowledge one is missing to get the whole picture and suddenly everything makes sense.

(Btw I think we might have met ages ago at a conference or two in Cologne)


Ah yes, Beyond Tellerand. That was a good time!


I really clicked with this part of your article, for the first part of my undergrad maths modules I had been automatically trying to connect these symbols with some global definition and getting in a muddle. I still remember the combination feeling of outrage + sudden realisation when the penny dropped that they were just "making it up as they went along"! (sort of)


Perhaps the difference is that for programming you could internet search for "C# const" or "C# float" for example, and find the documentation or even easy to understand tutorials explaining what they mean.

Whereas for math it does not seem to be the same. There is no documentation, and no-one ever seems to explain those basics online. Eg. this book is a pretty obscure pdf.


Basically, math need a major refactoring and code rewrite. I've been saying this for years. It's getting to a ridiculous point in some areas. Also imagine naming functions in code after people ... That's what mathematicians do with some major often used concepts, making them hard to grasp and remember (i.e. Why is it called "Laplace distribution" and not "mirrored-exponential"?)


For me the worst part is the nomenclature. Under the guise of paying homage to the inventor the nomenclature has become borderline dysfunctional. Just have simple words instead of enigmatic mathematician names for defining core concepts in the field


> Eg. one example f(X) (often drawn big and elaborate) means Y!!

Can you elaborate on what you mean here?


Lets say I wanna draw some weird kind of curve. Theres an equation for it in wikipedia. The equation will be f(x) = 5x + 3x^2 blah blah blah..

In order to draw the curve I iterate through values of X for each pixel, plug those values into the right hand side, and what the right hand side of equation is equal to is my Y value for that point on the curve. So if they had just written that big fancy f(X) as Y it would have been much clearer and easier to understand for me initially.


That use-case seems not strictly useful, but things become trickier with more elaborate expressions; like when we want to abstract over what f looks like.

Eg One might have f(x,y,z) = (...). If f is in some class of functions with some properties (homogeneous, linear, smooth, etc) we can operate on it abstractly. We could even derive properties of surfaces f(x,y,z) = C.


> The equation will be f(x) = 5x + 3x^2

You mean the function? It could just as well be something like:

    f(x, y) = 5xy + 3x^2 + 4y^2


Also I should point out that the variable names they use in these formulas are the worst possible, single letters, X, Y, some random greek numeral. If a programmer wrote variable names like that they would be fired.


Sometimes things have no particular meaning, or the meaning is related to the convention. In the other example you used, of drawing the curve, then x and y are perfectly fine names thanks to the convention (now long established) of using x and y to represent two orthogonal axes (generally the "horizontal" and "vertical", whatever that may mean in context). Using a more elaborate name would add no value.

With respect to the use of Greek letters and such, I do lament that many writers of mathematics fail to define their terms. Instead assuming that the reader is fully conversant in the domain, when often a single paragraph at the start would add a great deal to the clarity of their work. However, that doesn't mean that the use of such variables is bad, they just need to be defined.

The benefit of the mathematical notation is that it permits conciseness and lends itself well to symbolic manipulation (that is, a large portion of what we do when we do algebra and calculus). The former is a tricky subject, conciseness at the cost of clarity can be a net negative. But the latter is crucial to a lot of work, the way that we write programs does not lend itself well to symbolic manipulation and would be counterproductive for mathematics.

In fact, I've often had to translate programs into a symbolic notation in order to try and decipher them because the long descriptive names, as useful as they are in isolation, ended up rendering the total procedure nearly impenetrable. Or at least unanalyzable. And the conversion to a symbolic notation permitted me to simplify the program substantially because I was able to apply ideas from algebra to the program (often boolean algebra, in particular, this is a very useful practice for condition heavy code with lots of predicates).


What would you replace for x and y? Mathematicians study equations in the abstract. x is just a real number. It's not distance, or time, or velocity. Would you rather they say "real_number" everywhere? And then what would you do when the formula has more than 1? "real_number1" vs "real_number2"?

As to your original criticism, I'll wager that more people in this world will understand f(x) = 5x + 3x^2 than will understand rudimentary code, as it is taught a lot more than programming is. I don't mean anything negative when I say this, but the only people I know who complain about math syntax are programmers. By changing these conventions, you are asking all mathematicians, physicists, chemists, most engineers, economists, etc to change. I will wager that over 95% of them will not prefer your style.

Finally, the trouble with replacing f(x) with Y is that the former tells me I'm dealing with a function. The latter does not. In fact, for many mathematicians, y = 5x + 3x^2 is a constraint, not a function.


I don't see how Function(Value) = Value + Value ^ 2 is any easier to read than f(x) = x + x^2. How would you write this function?


Things are subscripted and superscripted universally, without real use for either in most places. It’s just over loaded notation.


I wonder how much of the differences between mathematical and programming notation stem from mathematics traditionally being done by hand on paper vs. programming being typed on a computer.


These are very childish and silly arguments. The letters have strong conventions in mathematics and definitely make sense when the functions are generic. It's like impulsively criticising Haskell or any other formal language for looking stupid and "worst possible" when you haven't put any effort whatsoever into learning it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: