4 ms·
This becomes even more true in higher level maths where programming language style functions would make everything vastly more clear, and easily typeable, than
by somenameforme 2y ago
This becomes even more true in higher level maths where programming language style functions would make everything vastly more clear, and easily typeable, than the traditional Greek symbols. sum(x+3, 1, 4) is just so much more clear (and consistent when generalized across other operations) and practically as concise as the mathematical way of expressing that which I cannot even type. Multiple variables would be a bit dirtier, but still much cleaner than the formal expression.
Interestingly mathematical symbols in the past also regularly evolved. Then at some point we just stopped doing that and get stuck in a time which is arguably no longer especially appropriate. So we're left with rather inconsistent symbols, oft reused in different contexts, and optimized for written communication.
- serbuvlad 2y agoMy first thought when I read sum(x+3, 1, 4) was x+3+1+4. Also it should be sum(x+3, x, 1, 4) since you need to encode what the iterator variable is as well.
- Izkata 2y agoI thought that was it too, but you're saying it's not..? I've been thinking about it for a few minutes now and I still can't figure out what other meaning it could have. Edit: Oh wait, someone else mentions map/filter, did they mean this as a combination of range->map->sum and the latter two numbers are the range portion, like sum(map(x+3, 1..4)) ? Edit2: And now I'm remembering sigma. I think it would have been more obvious to me if the order was flipped and your issue handled the way it is in that notation: sum(x=1, 4, x+3), though I'd still prefer the range notation: sum(x=1..4, x+3)
- serbuvlad 2y agoYep. I agree and now we've basically reinvented sigma. Take the x=1 and put it below, take the 4 and put it above take the x+3 and put it to the right. Granted I always found sigma a bit quirky for separating the range ends like that. Either x below and 1..4 above, or x=1..4 below/above would have been more intuitive. But it's just a notation you learn once and then you know it.
- QuadmasterXLII 2y agoThe formal language of math is intensely optimized for rapidly communicating with yourself 90 seconds in the future, when doing a proof or calculation, turning paper into working memory. It does seem silly to use the same language for communicating with others across unkniwn but deep chasms of context. Its remarkable that it works at all
- lazystar 2y agoits silly. itd be like introducing first year programming students to advanced maps/filters/anonymous function syntax, instead of the easier to understand for loops and if/else statements. math's "no true scottsman" approach to teaching only hurts itself in the long run.
- jpc0 2y agoI'm not sure if it would be easier to explain a map / filter to a first year student vs implementing the patten manually using a for loop and if statement... Seems like a pretty easy example to make practically, for map have a collection of things, say balls or black. Pick up each one and do a thing to them, paint them blue for example. For filter do the same except have two different colour balls, if they are yellow they get thrown away, of they are blue they get put in a bucket. A for loop doing exactly the same you would need to explain the topic at hand, as well as explain iterating an index etc...
- renerick 2y agoExplaining loops is independent of the concepts of collections though. It's also more general, since map/filter/reduce use some kind of loops under the hood anyway, the fact that probably shouldn't be ignored in education process. Unless of course you go with pure functional recursive iterator, but good luck explaining that one. Maps and filters also require understanding of higher order functions and the very idea of passing function around as a value. I would argue that implementing map/filter with a loop and then demonstrating how this pattern is generalized as .map()/.filter() functions is better and more accessible
- 2y ago
- pipes 2y agoThanks for this comment. My secret shame as a programmer is that I haven't really learnt much maths, stopped at 16 in school. Writing out the sum function like you did makes perfect sense to me immediately. What I should really do is create myself a cheat sheet of symbols to code...
- imtringued 2y agoJust read this: https://en.m.wikipedia.org/wiki/Glossary_of_mathematical_symbols https://en.m.wikipedia.org/wiki/Glossary_of_mathematical_sym...
- pipes 2y agoThanks for this :)
- renerick 2y agoIt's hard to debate that mathematical notation has a lot of room for improvement. High level algebra is very cryptic and often looks like an arcane incantation rather than something comprehensible for an unknowing person. That said, as a person who moderately enjoyed math in high school and university, this functional notation would make me hate math infinitely more. It's would look like Lisp, which, at high level, looks just as cryptic as algebra. The sheer amount of braces and mistakes that would be made when reading and writing them is nauseating. Infix notation, for all its flaws, provides important visual aid for understanding the structure of the expression (the sum of two fractions looks very different from fraction of two sums for example). Whereas with functional notation it's like working on linear textual representation of abstract syntax tree. Trust me, nobody wants to read, write or transform one by hand
- milesrout 2y agoThe notation as it is works very well. It looks unfamiliar to you because you aren't familiar with it.
- cardanome 2y agoMight I introduce you to our lord and saviour APL? Infix notation and was originally created to be exactly that, a better math notation. https://aplwiki.com/wiki/Comparison_with_traditional_mathematics https://aplwiki.com/wiki/Comparison_with_traditional_mathema...
- hilbert42 2y agoAPL »» Linear A (Well almost!) ;-)