A cheat-sheet for mathematical notation in code form
github.com
github.com
I thought I was just too dumb for maths. I came to realise that my problem was not in mathematical concepts which it turns out are fairly easy, but in the language of maths itself and how it is taught (some exceptions such as Strang who is just a wonderful educator). Programming in particular really helped me to learn. That's not to say that certain areas aren't still difficult but reformulating away from the traditional notation and teaching style has helped me.
Besides, I don't really care about "the code" i.e. the mechanics of computation but rather the properties of that expression that exist regardless of how it is communicated i.e. it's shape or how it behaves asymptotically etc.
But that isn't really a problem with math, but a problem with sloppy people. Or you just didn't read the notation sections explaining everything.
The first is that it is terse--often excessively so. The clearest way this manifests is the sheer predilection for single-variable names. Every variable in every equation invariably gets reduced down to a single letter, and sometimes you need to go so far as distinguishing based on font face or boldness or what random diacritic you can throw on that variable name to keep it a single-letter variable name. Even when it doesn't reach that extreme of an issue, it makes skimming difficult, because you now have to go back through the prose to figure out what 'H' means, and spotting the definition of a single-letter variable in prose is really easy, right? (No, no it is not).
Another factor that can make it infuriating to read mathematical notation is the sheer overloading. Subscript notation is a good one for this--if you see a single letter subscripted by something else, it could mean either getting a particular entry in a sequence of entries, it could be an index into a vector or a matrix or a tensor (and are you getting a row or a column or whatnot? all of the above!), maybe it might be a derivative. Or maybe it's an elaboration of which of the possible terms that get summarized to that letter is actually being referred to (e.g., E_a for activation energy).
Of course, the flip side of the notation problem is the fact that some concepts have multiple different notations. Multiplication is a common example: to multiply a and b, you can use a × b, a · b, or screw any symbol altogether and just say ab (thus a(b) is also a way to indicate multiplication, which totally has no potential confusion with applying a function [1]). Differentiation is the worst; virtually every introduction to derivatives starts with "oh there's multiple notations for this"--is it really necessary that so many need to exist?
[1] There was one paper I once read where I literally had to spend several minutes staring at a key formula trying to figure it if I was looking at function application or multiplication.
Yes it is necessary - often different contexts require different notation, sometimes as an abbreviation, sometimes not.
I do not believe that mathematical notation can be improved (a poor analogy would be trying to improve, say, English language itself); what does evolve, though, is the understanding of mathematical objects and mathematical frameworks - which can often lead to simplifying things and, sometimes, notation, too.
I strongly hope you mean that heavy-handed top-down approaches aren't likely to work. Because this reads as though you're saying we've somehow reached the optimal point on every axis for both mathematics and general-purpose communication.
For example, the issues you list here, how would you solve them if you could rewrite the notation from scratch?
No, there are different compilers, languages or even language versions or compilers settings. Programming notation is way harder and more confusing to learn than the math equivalent just because they are so many more styles languages or versions etc. And we all know that learning all of those symbols and keywords isn't the main difficulty with learning programming or new programming languages.
I did well in school with geometry, algebra, and pre-calculus but I did so by memorizing not by understanding.
A decade later I ended up going through a lot of Khan Academy videos to refresh myself and then diving into discrete math and linear algebra textbooks. It really helped me to finally understand the core mathematical concepts that we use in programming algorithms.
This would be helpful as well:
foldr (*) 1 [1..6]
while this is the shown pattern: var value = 1
for (var i = 1; i <= 6; i++) {
value *= i
}https://mobile.twitter.com/FreyaHolmer/status/14366964085062...
Given how often I've used summations in physics/maths, I shudder at how verbose it would be in code. Something I could write in one line may take up a whole page.
speaking of that, would be nice if github provided rendering of music notation :)
https://opensheetmusicdisplay.org should fit the bill, though you may need a tool to generate the MusicXML.
I'm using it on my website a little bit, e.g. https://nixpulvis.com/musings/my-sound
I am currently paying a math teacher to teach me derivatives all over again. I know how to solve those since I am from a science background but don't know what they really mean.
even simple things dy/dx, is that dx multiplication or is d a function. It took me 2 frustrating classes to even let the teacher know what I am trying to ask.
Math as algorithms would make self learning so much easier and fun. I would love the field of mathematics if it was not so ambiguous.
IME the ambiguity is usually intentional. Take dy/dx for instance. In some sense, d/dx is acting as an operator (or "function" to use programming terminology) acting on the function y to produce y'. However, the intuition here is that we're calculating a slope (ie. a ratio), and the particular ratio we want is the limit of [a sequence of] Δy/Δx. Both of these viewpoints are important to keep in mind to understand calculus, and the point of the notation is to aid that intuition. There are, as I'm sure you're aware, alternative notations for derivatives, and the d/dx notation survives because it suggests things beyond its formal definition.
I think this becomes the most clear when we consider the chain rule, dx/dy * dy/dz = dx/dz. We can't just "cancel out" the dys (outside of exotic approaches such as nonstandard analysis), but allowing that sort of visual pun in our notation makes the formula easier to remember and gives a sense as to why it might be true. And, if we didn't know the chain rule ahead of time, it would likely prompt us to try and prove it in the first place.
The bigger story here is that a lot of mathematics runs on human intuition, and finding a notation which communicates and facilitates that intuition is quite important.
Although it could also be a mistyped sub or superscript star on f, which has various different meanings.
a + b
-----
c + d
Math, in this sense, is already a language, and what you see is already code. (So, basically, all you are talking about is translation, like, from Ruby to Python.)What I want is that I can select "sum symbol" for example, and I can get small description in a popup window. (for more complicated things that is)
I really wish that entire science would just move on from usage of symbols to algorithms, it would considerably reduce the total information one needs to know before starting to study some fields with more esoteric symbolic notations.
I am not sure how you would replace the structural formulas used in organic chemistry, for example. Going beyond science, most engineering disciplines use schematic notation that you would find esoteric, yet with no chance to be translated into algorithms in any meaningful way.