19 ms·
Terry Tao on some desirable properties of mathematical notation
- jjhawk 6y agodiscussion on reddit: https://www.reddit.com/r/math/comments/hv6m2n/terry_tao_on_some_desirable_properties_of/ https://www.reddit.com/r/math/comments/hv6m2n/terry_tao_on_s...
- JadeNB 6y agoI found this post a shame. (The post itself, not putting it here; I love seeing math posts on HN, and automatically upvote. Bringing hackers and mathematicians together is highly worthwhile for both.) Usually Tao's posts are so insightful, and crystallise some idea so perfectly that it feels like I was just on the cusp of discovering it myself—a rare talent, and hard to cultivate since it goes against the ego. In this case, though: I'm a professional mathematician, and as prone as anyone in my discipline to use mathematical language to describe not strictly mathematical things, but the pseudo-mathematisation here ("Notation^{-1}(C)", for example) seems more like wit than clarity. Not that there's anything wrong with wit, but in this case it seems to me that it's at the expense of, rather than a pleasant addition to, the central point. I'd like to hear especially from anyone who isn't a professional mathematician: did you feel that this post improved your understanding of the purpose and function of good notation? (EDIT: I was scared about making this post, since there's rightfully a lot of respect and appreciation for Tao—and I hope it's clear that I concur on both counts—and I wasn't sure how my reticence on his post would go over; but I'm super glad I asked. Thanks so much to everyone downthread; these are wonderful responses and I feel that it benefited me a lot to read them.)
- deleted 6y ago[deleted]
- zitterbewegung 6y agoI think the notation is intentionally pseudo notation on purpose. A large part of math is knowing notation and definition. When I started studying higher levels of Mathematics a big part of me that was keeping my understanding was figuring out the notation and the definitions. Graph theory is so notorious for this that I can remember a joke that everyones notation for graph theory is slightly different.
- breck 6y ago> I'd like to hear especially from anyone who isn't a professional mathematician: did you feel that this post improved your understanding of the purpose and function of good notation? No, but I did learn about new dialects and conceptualize mathematical notations better. I think for someone new to languages/notations the first set of detailed bullet points are useful. For more experienced practitioners I think it sums up to "use the right tool for the job". What I found very interesting was the latter set of bullet points where he presents a sort of Rosetta Code (http://rosettacode.org/wiki/Rosetta_Code http://rosettacode.org/wiki/Rosetta_Code) of math. I am familiar with thousands of computer languages but not a mathematician and not familiar with what I'm sure are hundreds (thousands/more?) of Mathematical notations, so the few examples he lists here have me intrigued.
- abdullahkhalids 6y agoI am a physicist. Abusing mathematical notation is sort of what pays the bills for us, so... :D Seriously, though, why should meta-mathematics, not use math like notation. The post can be rewritten without that semi-formal notation and not change much, but I don't mind it all. If it is wit, I appreciate the enjoyment. I am bookmarking the post as I found it valuable for next time I invent notation.
- jjhawk 6y agoI'm a programmer by trade, so my knowledge of mathematics as a whole is limited by what I happened to learn doing my undergrad in CS, so a lot of the mathematic-specific examples in this post were lost on me. What I found particularly insightful here is applying this mathematical notation to programming languages and their syntaxes. His notation described as ``` Notation:{well-formed expressions}→{abstract objects in 𝑋} ``` isn't too far off from what most programming languages implement at some level. As a result of this, what properties do programming languages share with mathematical notations, and why are some languages deemed more "expressive" than others? How much does the "expressiveness" of a certain language in a domain lead to better understanding of the abstractions beneath them? To answer your question; I don't think this post explicitly increased my understanding of notations (especially not in the context of mathematics), but rather led me to ponder the importance of them in communicating & extending abstract concepts effectively across domains.
- chrispeel 6y ago> I'd like to hear especially from anyone who isn't a professional mathematician: did you feel that this post improved your understanding of the purpose and function of good notation? Yes I skipped past the long list of properties and went straight for his long list of ways to write the inner product of two vectors and his illustrations of why you want to use different notation in different cases. Here's a question for you, do you think Tao's primary mission is to be a "professional mathematician" or is he just enjoying the math, enjoying teaching, enjoying notation...?
- JadeNB 6y ago> Here's a question for you, do you think Tao's primary mission is to be a "professional mathematician" or is he just enjoying the math, enjoying teaching, enjoying notation...? I definitely think that he's earned the right to contribute to the mathematical community in whatever way he sees fit, and, especially if it benefits other people, which it clearly does, then my opinion of it shouldn't and doesn't matter a hill of beans. I just usually feel that he combines those missions—not that he has to, but that he does—and felt that he didn't here; but, again, that is, if at all, very much my problem and not at all his.
- somethingsome 6y agoI find it useful as he needed it for the following sentence to make sense : A good notation should make this map Notation (and its inverse) as close to a (natural) isomorphism as possible. Having said he want an isomorphism for Notation sums up all the following points he made explicitly (and more), so we could argue that we can keep the Notation and the isomorphism part but remove all the following point 1..9+ I think that in this way the post reach more people :) some needs only to read the first sentences, some the properties and finally some the example. Isn't it a nice way to understand what he is trying to say in as much different ways as possible?
- deleted 6y ago[deleted]
- mmhsieh 6y agoI thought it worked. It was his way of demonstrating one of his own requirements: (Preservation of quality, I) Every "natural" concept in 𝑋 X should be easily expressible using the notation. So, if he is going to commit to his idea of the notation-to concept-isomorphism, it would have been weirder if he did NOT introduce the notion of the inverse map.
- ianhorn 6y agoI found the idea of (ab)using mathematical notation to talk about mathematical notation to be entertaining and got the sense that he was kinda just having fun for himself. I also got the impression that he was potentially nerd sniped. The rest of the post beside the `Notation` function was definitely a good informative read.
- ufo 6y agoI think the post would be more interesting if it came with examples of existing notations that do particularly well and particularly bad on the listed criteria.
- Kednicma 6y agoHonestly, it doesn't bother me at all. I'm used to slogans like "syntax and semantics are adjoint functors" or "meaning is a functor from syntax to semantics" from category theory. In the opening definition, for example, I'm reading the LHS as a source category whose objects are abstract syntax trees and whose arrows are substitutions between said trees, and the RHS as any target category of interest. We're giving meanings to notation by sending the notation along a functor, and syntactic/formal manipulations of the notation correspond to manipulations of the objects which they "mean"/represent. Framed this way, the properties listed are (1) (part of) functorality, (2) surjectiveness, (3/4) smallness, (5) renormalizability (!!), (6) smoothness/continuity of some sort, and (8) the ability to have natural transformations applied. Only (7) is culturally dependent. (1) and (8) are free for all functors! To address your question on the head (I am not a mathematician), this post gave me some properties of good notation which I hadn't considered before. On one hand, yeah, it's kind of obvious that notation should somehow be able to surjectively reach all possible objects of interest, while still being small enough to definitely not reach everything. On the other hand, renormalization is kind of a dense topic, so it's surprising to see it arise here.
- xdavidliu 6y agoex-theoretical physicist here. I read Terry's post and I totally saw your point about "Notation^{-1}(C)" being more wit than clarity. Of course, I also share your respect and appreciation for Tao.
- ramblenode 6y agoI wouldn't be able to precisely break down his notation (and I'm guessing it's not intended that way?) but just following his thought process has improved my intuition by seeing some of these ideas I had toyed with before reframed in a more mature way. At the very least, a lot of interesting analogies to consider.
- carlob 6y agoI'm not sure I agree about the fact that notation is a pseudo-mathematisation. For example in Mathematica there is a (mostly deprecated) package called Notation`[0] that does just this kind of stuff. I have to admit that it's not really used in production code anymore as MakeBoxes and MakeExpression are more fine-grained and robust. Thus said I have to admit that the transformation between 2-D boxes and M-expression is not as foundational as what Tao is talking about, however the whole field of designing programming languages is deep down an exercise in defining notation, the transformation mentioned above just make this a bit more explicit. [0] http://reference.wolfram.com/language/Notation/guide/NotationPackage.html http://reference.wolfram.com/language/Notation/guide/Notatio...
- JadeNB 6y ago> I'm not sure I agree about the fact that notation is a pseudo-mathematisation. I definitely don't think that notation is pseudo-mathematisation; good notation is inordinately powerful in enabling good mathematics (and bad notation can make even simple mathematics hard). What I meant to describe as pseudo-mathematisation was the discussion of notation in what seemed to me in a (to me) unnecessarily formally mathematical way.
- rm445 6y agoAs an engineer, not a mathematician, I'm glad that good mathematicians care about good notation. The relatively-elementary maths that I learnt didn't always have good notation, the tradition seems suited to chalk and pen i.e. complex glyphs are easy, but perhaps because with hand writing the size and position of elements can be ambiguous, too much notation is overloaded and re-used. Even simple stuff like an exponent of -1 meaning inverse function, it's hardly unusual for it to be mixed up with numerical exponents. One bugbear is that mathematical writing leaks into engineering science. I wouldn't ask professional mathematicians to start caring about units or change their style while communicating amongst themselves, but in my view textbooks ought to define notation before they use it, and clearly define the units used in all expressions.
- zitterbewegung 6y agoThis looks like a similar approach to TLA+ but, it looks more similar to a markup language that is domain specific. I think that he has a good idea for the most part and if you did formalize this notation there is a good chance that someone in the computer science domain would eventually program something that could interpret it. Lisp comes to mind.
- pubby 6y agoImagine I give you a list of words and ask you to remember them. 5 minutes later, I ask you to give me those words in reverse order. Not too hard, right? Now imagine if those words I gave you were in Vietnamese, or some language you don't speak. Suddenly the task becomes much more confusing. You aren't remembering a small handful of objects and ideas, but instead trying to juggle the individual syllables in your head. Math notation sucks because none of it maps to things non-mathematicians know. Every time a new symbol is introduced, whether it be a greek letter or a operator, it's one more mapping your brain has to create to remember it. And on top of this, you also have to remember the English names too. Yes I said names - most math concepts have so many different names it's crazy. Even basic arithmetic can't escape this. There are two names for multiplication (multiply, product) and four common notations for representing it (*, x, ·, and whatever you call it when two variables are next to each other).
- jstanley 6y ago> Math notation sucks because none of it maps to things non-mathematicians know. This doesn't mean maths notation sucks any more than vim's user interface sucks because it doesn't make sense to non-vim-users. Mathematical notation presumably mostly makes perfect sense to the kind of people who deal with mathematical notation all day long.
- zamfi 6y ago> Mathematical notation presumably mostly makes perfect sense to the kind of people who deal with mathematical notation all day long. Maybe the overuse of opaque names leads to self-selection of who becomes a mathematician? Single-letter non-descriptive variable and functions names would “make sense” to programmers who use it all day long too — but that alone doesn’t make it a good idea.
- Koshkin 6y agoMathematicians will never agree to write dblEulerConstant instead of e.
- emmanueloga_ 6y agoThe discussion of mathematical notation reminds me of the talk by Guy Steele "It's Time for a New Old Language", discussed previously in HN [1]. That talk was focused on the Math notation that is used in computer science papers, but I feel a similar analysis could be expanded to other areas of Math. 1: https://news.ycombinator.com/item?id=15473199 https://news.ycombinator.com/item?id=15473199
- Koshkin 6y agoDifficulties, if any, perceived or real, arising in connection with notation, are usually incomparably smaller than those presented with the subject itself. (Personally, I only wish mathematical notation were better integrated with software in general and programming languages in particular.)
- h-jones 6y agoI think differential geometry may present the closest exception to this, not only is the notation often incredibly dense and subtle (i.e. spacing between indices when raising and lowering) but often everyone seems to have their personal favorite take on any given notation.
- kdmccormick 6y agoThat's a strong assertion. You're implying that difficulties with the subject itself rarely have anything to do with difficulty communicating through some notation. I'm not disagreeing, but I'm curious how you would back up that assertion.
- Koshkin 6y agoIt’s an experimental fact. (I guess you have to trust me on this one.)
- dilap 6y ago> with the subject itself that's the thing though, you can never grapple with the subject itself, only representations thereof. this is a mix of feelings/images/movements inside your head & mechanical manipulations of the notation; furthermore, the notation itself influences our internal model/feeling of the subject.
- Koshkin 6y agoI am not saying that with enough dedication one couldn’t screw up the notation completely.
- rytill 6y ago
- riazrizvi 6y agoUnambiguity as an adjective is slippery. Mathematical notation must be concise, because a key purpose is to provide understanding, which it achieves by focused abstraction. So when you search for notation to model some real world system, you leave things out, as such it leaves room for interpretation when remapping back to the real world, ie there is ambiguity. I think this #1 item should really be termed Consistency, because above all, notation must not contradict itself.
- JadeNB 6y ago> I think this #1 item should really be termed Consistency, because above all, notation must not contradict itself. This is a good goal, but I'm not sure it's the primary goal; the phrase 'abuse of notation' exists precisely to describe its breakage, with even the best mathematicians and expositors engaging in it, and I think insisting on no abuse of notation leads us rapidly to the style of impenetrable Principia-style logic, or of modern formal proofs—both of which have their place (at least the latter …), but neither of which should govern all mathematical discourse. As with all writing, I think that part of being a good mathematical writer is knowing the rules so that you can figure out when to break them unintentionally, rather than stumbling into it accidentally.
- riazrizvi 6y agoGreat point. It is bad to nitpick consistency when you are in the initial stages of developing a model outline, and looking to capture the most important points. What's the right term for this notational quality? Precedence?
- deleted 6y ago[deleted]
- moonchild 6y agoAnother interesting notation is iverson notation. See Notation as a Tool of Thought[1]. Here's the inner product (note that this is actually general inner product): c ≡ u +.× v 1. https://www.jsoftware.com/papers/tot.htm https://www.jsoftware.com/papers/tot.htm
- deleted 6y ago[deleted]
- dhash 6y agoIverson notation originated from APL, which was itself born out of the horror that Iverson saw when presented with "standard mathematical notation". Its use of strange, otherwise cryptic notation was influenced by two main themes: it was originally designed on a blackboard, so strange glyphs were normal, and a desire to become unmoored from "standard mathematical notation" in order to strengthen principle 1. of OP - Unambiguity. Casting off historic baggage and canonicalizing mathematical notation under the principles of OP was APL's prime goal, and it does a damn good job of it. I wish they taught it to math majors. APL's a wonderful rabbit hole to fall down, and J was my eso-lang of choice last year.
- moonchild 6y agoNote: depending on context, you might want to replace ≡ with ← or ←→.
- Koshkin 6y agoMathematical notation is great at facilitating formal manipulations. This is its critical feature, and without it we would get stuck at the level of ancient mathematics. This is the reason it was invented a few hundred years ago in the first place. That said, I find that notation is often abused in texts as a mere substitute for the normal human language which, while allowing to compress the text, does in fact nothing to help the reader better understand what is being said but rather looks like a crazy mess of characters and other marks in a multitude of fonts, styles and sizes the only purpose of which seems to be to cause an eye strain.
- cheez 6y agoLooks like we read the same books.
- dhosek 6y agoI remember, as a callow college freshman waiting in the hallway of the math department to be able to go into a classroom reading an article which talked about mathematical writing and the first thing it said was to prefer English text over mathematical symbols in numerous cases (e.g., writing "For all $x$ in the Reals" over $\forall x\in\mathbb{R}$). As someone who was highly skilled in TeX at a time when such skills were still fairly rare (many colleges, if they even had TeX available on their time share systems, were still using the am fonts instead of the cm fonts as the latter had only been introduced two years earlier), I remember being upset that my backslash skills were thus denigrated.
- jimhefferon 6y agoWhen I teach the intro to proofs class I require that they learn LaTeX. Some students like the availability of symbols so much that they go a bit nuts. Something like this sentence: $\forall x\in\mathbb{R}$ $\exists y$ that is $>$ the number $x+1$. Sigh.
- madcaptenor 6y agoThis isn't exclusive to LaTeX; I think students in general just think that the symbols make things "more mathematical". I remember feeling this way briefly when I was first exposed to things like $\forall$ and $\exists$, and it wore off. This was in the late nineties; in theory I could have had access to a typesetting system but I was writing things by hand.
- foobar_ 6y agoNo one uses mathematical notation for practical purposes. This is just like the medival music notation which is neither practical nor what modern composers use, which is more visual in nature. Infact modernism is a rejection of medievalism. I think in the future programming will force all mathematicians to code or give out simulations. Most mathematical notation was intended to be throwaway by the original authors, thats why there are so many notations. Trying to find relevance in them is a pointless exercise. Much like 80x20, tabs vs spaces ... most of the original intent is lost and what survives is guff meant for ceremonious purposes.
- wheresmycraisin 6y agoProgramming != proofs, or in general communicating abstract mathematical ideas. Writing mathematics is nothing like writing software.
- foobar_ 6y agoWhat I am trying to convey is writing software is better than writing maths, just like medieval music notation vs modern notation. Programming is better than proving because most proofs are mere tautologies or artificial constraints. This is why theorem provers in code rely on term rewriting. A triangle has a sum of 180 ? Well how about if you push the triangle inside out. In code you can easily run a more complex simulation which gives you all possible values of the sum ... which is why ascertaining useful facts like 180 ad-nausea is boring at best. In fact most mathematics if it can't be simulated can't exist.
- wheresmycraisin 6y agoOk, then convince me. Write 'software' of, say, the proof of the the dominated convergence theorem or something else reasonably advanced and let's compare it to the proof in conventional math notation.
- foobar_ 6y agoI'm guessing there was a physical intuition behind the theorem, if you can simulate it you will probably do something better than the proof. Now it's your turn to tell me why 1 + 1 = 2.
- btrettel 6y agoTerry Tao mentions that notation can help with error detection. Anyone here aware of some good examples? One that I like is that in Einstein notation you can't have 3 of the same index, e.g., u_i u_i u_i is invalid.
- lmkg 6y agoFrom the example notations that he gives, all three Einstein notations as well as the Penrose notation make the indices explicit in a way where a mismatch or misalignment will stand out. Another good example is the Liebnitz notation for derivatives. Proper application of the chain rule visually resembles how fractions cancel: dy/dz dz/dx = dy/dx. It's very easy for the eye to follow and make sure that the cancellation is valid. Newton's notation doesn't make that as easy.
- Smaug123 6y agoLonghand matrix notation itself is quite good at this. It all but guarantees that you've specified the right number of components in the matrix, and it plays to human strengths in making it easy to check that a matrix is e.g. diagonal or upper-triangular. I'm going to claim that string diagrams have reasonably good error-detection properties, too, again because they lay facts out in space in a way that humans are quite well optimised for.
- vii 6y agoEnumerating what we want from notation helps us understand how far we are from the ideal. The whimsical introduction of Notation to talk about notation makes it practical. Given a domain in mathematics, adding notation (e.g. modulo arithmetic) can make complex notions pretty to express and quick to prove. I used to really enjoy this and tried to redefine notation for each exposition. It's shorter and prettier, but just pushes complexity into the notation :) and teaching people new notations is expensive, actually unless repeatedly used, more expensive than laying out details in a less concise notation. Programming languages are notations within this framework - and domain specific languages, while much more efficient are unpopular as the costs of changing notation, in terms of training people, are too high. The cost of communicating the notation is captured in a few of the desiderata (e.g. 1,7) but practically it is most important. If we want to be easily understood we should speak a common language!
- dragonwriter 6y ago> domain specific languages, while much more efficient are unpopular JSX seems pretty popular, and when XML was popular similar XML embeddings were, as well. Templating languages are popular. Heck, the relative popularity of “general purpose” programming languages is not consistent across domains, with domain fit being a factor even for general purpose languages.
- lmm 6y ago> JSX seems pretty popular, and when XML was popular similar XML embeddings were, as well. Templating languages are popular. I don't think any of these things are popular; in my experience people using them mostly hate them, or at best grudgingly accept that they're the least-bad option.
- Transfinity 6y agoI would say that JSX is popular precisely because the cost of teaching it is low, which in turn is because of its similarity to other commonly used notation (HTML / XML). Of course it's got its fair share of dumb gotchas, but I found it far easier to learn than, say, any of the myriad Rails DSLs.
- peter303 6y agoTao a rare person with 200 IQ
- fuzzfactor 6y agoAlmost ten years ago I was working on an interesting Linux multiboot system, googling to find far-from-default grub operation hints. I think it can be agreed the present grub documentation is very broad, with only a few undocumented features, but still not very deep even on the default operation. Grub was also undergoing more rapid change at the time. Came across a message where Tao had explained a concept like no other, and after what I had seen it was clear to me he understood it like no other, so it was purely logical. He knew more than the documentation. I didn't know he was a widely recognized mathematician or anything, I just thought he was a very bright computer scientist on a message board. There were only a couple sentences that nearly applied to my system, within a couple paragraphs on his solution to a different problem. There was no useful answer for me yet so I moved on. Googled to exhaustion that session with no code changes to make, but I looked at it again and it was the only tab I kept open, even though Tao did not show the direct way forward for me at all, everything else was actually useless. Next day I read it again, scrutinizing it over & over for an action I could follow through with, wishing someone had posted equally straightforward advice for my particular situation. No such luck, but it inspired me to go forward in a similar fashion. Mostly use both grub and syslinux as separate alternatives to boot my distributions ever since. For years I've felt like I couldn't have done it otherwise. And with Windows, grub or not, I ended up bringing more reliability to my employer. Fairly recently I found out Tao had started out as a mathematical child. That was incredibly helpful. He actually communicated the unique abstract concept I needed without even knowing the problem and without intentionally trying. I imagine he made up his own notations quite a bit before he carefully adopted the various professional terminologies.
- dopu 6y agoIs it just me, or does probability theory in general have fairly terrible notation? Ambiguity between random variables and their distributions because of them simply being distinguished by being upper-case or lower-case, writing likelihood functions alternatively with an L() or p(), and using p() (with different arguments) to refer to different probability distributions. Perhaps I'm just having such a difficult time grokking probability theory because it's just difficult stuff, but I often find myself immensely frustrated with the notation.
- lostmyoldone 6y agoI don't really know, I'm not an expert in the field. What I do know, is that I can usually get almost anything written in English in a statistics text, but when it goes mathematical notation I really struggle even with the simplest of concepts. Type theory is a little like that, at least from some authors that - although the are is well suited for symbols - kind of goes a little off the rails using seven different kind of arrows and all the symbols in at least three different alphabets, instead of maybe just write covariant, or even an abbreviated form adjecent to the arrow?
- amitport 6y agoIt is the difficulty of the theory in my experience. I've had / have trouble and misconceptions many times, but when discussing with someone fluent in the notation and the field, 100% of the times things cleared up, and I couldn't think of a better notation to use.
- steventhedev 6y agoI think this is partially because it's applicable to so many different domains (cryptography, statistics, etc) that each have their own notational quirks. Avoiding collisions between notation in the application domain is more important than preserving some "consistent" probability notation (similar to the examples given with dot products). But the issue isn't even limited to notation: Chebyshev has at least 9 valid ways to spell his name (more if you include non-latin alphabets). The biggest issue I've encountered is borrowing lecture slides from different universities/lecturers and the notation changes between slides on the same topic (even small things like using square brackets instead of parentheses).
- deleted 6y ago[deleted]
- Darkstryder 6y agoSteal this idea: a Shazam of mathematical notation. In an app you would draw (or take a picture) of a mathematical symbol you don’t recognize and get a link to the appropriate Wikipedia page. My biggest pet peeve with mathematical symbols is the difficulty of looking them up when you don’t know them already. If I’m reading a text on a topic I'm unfamiliar with, I can at least google the keywords I don't know. This is difficult with symbols.
- jpm48 6y agoyou could try something like https://mathpix.com/ https://mathpix.com/ and then look up what the LaTeX symbol is.
- cdu1 6y agoGreat idea. I'm a fan of this app/site for finding the Latex command for a particular symbol: https://detexify.kirelabs.org/classify.html https://detexify.kirelabs.org/classify.html. Then just need to look up the Latex on Wikipedia: https://en.wikipedia.org/wiki/List_of_mathematical_symbols https://en.wikipedia.org/wiki/List_of_mathematical_symbols
- scribu 6y agoShapecatcher is a free webapp that allows you to draw any Unicode symbol: https://shapecatcher.com/ https://shapecatcher.com/
- enriquto 6y agoIt would be nice to have an equivalent post, but with programming languages. The fact that different programs perform an identical computation is important. For example, in Python/numpy you can write c = 0 for i in range(u.size): c = c + u[i] * v[i] or c = u.T @ v and even if the result is identical, the computation is not, the first one being orders of magnitude slower. There is no good reason for it to be so, unfortunately.
- jimhefferon 6y agoWhen Python first came out, one of its most appealing characteristics was that, in very strong contrast to Perl's There's-More-Than-One-Way, in Python there was a canonical way. That's no longer true, and it makes the language less valuable.
- lordgrenville 6y agoI was with you until your last line, which I categorically disagree with. These two alternatives perfectly map to two different ways of thinking about the vector c: - As a regular array (for someone with Python experience but no knowledge of linear algebra). In this case you can just loop over it as with any iterable. - As a vector, with the associated mathematical properties. In this case you can operate on the entire vector, which is much faster; this happens to be because of implementation details (using C structures instead of Python lists, parallelisation, whatever), but is also just highly intuitive. I'd argue that this is exactly what Tao is saying, about how different notations suit different contexts, and that allowing both methods in no way violates the Zen of Python (in reference to jimhefferon's comment).
- enriquto 6y agoMy problem is a practical one, not philosophical. I would expect that the computer operations in both cases are identical and thus the performance exactly the same. It is 2020 and optimizing compilers exist, and even JITs. The first code is just a notation for the second one. The fact that the first code is extremely slow (thing about iterating over all the pixels of a video sequence) is utterly disheartening. Of course, in that particular case you can say "just use the vectorized version", but in practice not all the computations that you need to do can be expressed in that form. If you try to iterate, in python, over all the pexels of a realtime video using integer indices you are in for a world of pain; it is just not possible and this is a major limitation of the expressivity of the language.
- wavegeek 6y agoI like his point about lack of ambiguity. Nothing makes me want to punch an author in the head (without, to be clear, any possibility I would actually do it) like lazily creating an ambiguous notation, which is supposed to be "clear from context", but rarely is. As for example the Einstein summation convention which is to be ignored "when clear from context". I would add 1. Clearly telegraphing notations. Not hiding them in the middle of long paragraphs or even, and yes I have seen this a few times, defining essential notation in an optional exercise. 2. Having a glossary of notations, so people don't have to remember every single notation and to read every word of the book sequentially. 3. Not creating low value notations that may be used only once and then, possibly forgotten. I have read books with > 1 new notation or definition per page, mostly forgotten thereafter but some random subset needed later, and you are not to know which.
- eternalban 6y ago"Preservation of quality, II" and "Suggestiveness, I" are likely co-manifests. I suggest that should one strive to 'fine tune' notation N to possess the above two qualities for a family of objects in X, other categories of objects in X will become opaque and difficult to express, i.e. a domain specific notation.
- peignoir 6y agoAnyone would be interested to help on building a google translate for math?