7 ms·
I'm not a computer scientist but as a programmer I enjoy dabbling in computer science papers and while I often do understand the underlying concepts (sometimes
by simias 5y ago
I'm not a computer scientist but as a programmer I enjoy dabbling in computer science papers and while I often do understand the underlying concepts (sometimes very well since I've been using these concepts daily for decades) I often find myself incapable of following a paper just because the notation is hopelessly obtuse.
The immediate example for me would be lambda calculus which makes a lot of sense to me when expressed in code (be it lisp, python or Rust) but just looks like vomit in theoretical papers, for instance:
(λy.M)[x := N] = λy.(M[x := N]), if x ≠ y and y ∉ FV(N)
This looks like a perl one liner from an obfuscation contest.
Why is it that software engineers in a few decades have come to the conclusion that proper variable naming is important and abuse of sigils a bad idea but mathematics don't feel the same way?
- abdullahkhalids 5y agoI would recommend two things: 1. Since you seem to someone who reads papers sometimes, I would encourage you define your "programming notation" and start proving theorems in that notation. Do it for sufficiently complex proofs: the ones that require a few different lemmas, span several pages, and use some non-trivial algebra. Then, attempt to present your proof to someone in your notation. Judge for understanding. 2. You might very well succeed. But if you don't, wonder why out of many many software engineers (or profs at software engineering oriented degrees) over the past few decades who read math/cs papers, no one attempted to use "programming notation" to write a book or notes to communicate mathematics to others?
- SAI_Peregrinus 5y agoWRT 2, plenty of people use more "programming" style notation. Most cryptography papers these days define algorithms as sequences of steps that look quite a bit like code, just with Greek letters for many of the variable names (but italicized words for function names). EG this paper[1] picked from the last week of IACR preprints shows the style. That's just the first one I clicked, the title looked interesting. Most of the rest use a similar style. The big reason for single-letter variable names is that historically multiplication can be denoted by concatenation. It makes formulae shorter, so they don't need line breaks. Personally I don't think that's a huge benefit, particularly when there's more than one sort of product possible so you end up needing to explicitly denote multiplication anyway. [1] https://eprint.iacr.org/2022/106.pdf https://eprint.iacr.org/2022/106.pdf (Page 7-8)
- deleted 5y ago[deleted]
- abdullahkhalids 5y agoSure, as a physicist, I have written papers with pseudocode for algorithms, and I think we would do well to express algorithms in this way. That's definitely an improvement that is slowly percolating various fields. But most mathematical theorems and their proofs are not algorithms, and not suitable for expressing this way. The reason for single-letter variable names is that mathematics is best learned by manipulating ideas by hand on paper and pen. And that many mathematical expressions are long and if we started using longer names, we would end up writing only a couple of statements per page, which would be much annoying than just using symbols.
- Jtsummers 5y agoNot everything in math is suitably expressed (or, perhaps, discussed) in an algorithmic form. Much (most?) of mathematics is operating at a level of abstraction that is far removed from an underlying machine model (in contrast to algorithms, like, well, the cryptographic algorithms you mention). Take matrix multiplication, imagine seeing this: C = zero(m,p) for k from 1 to n for i from 1 to m for j from 1 to p C_ij += A_ik * B_kj Now suppose that B is invertible and we actually want to know A in terms of B and C. Oops, we can't figure it out because we've tied ourselves to this algorithmic expression. In contrast to a more typical algebraic expression which describes not a computation but a relation: C = AB CB^-1 = ABB^-1 CB^-1 = A Perform that manipulation with the algorithmic description that helpfully obfuscates the relationship between the parts. [And this is a small example, algorithmic expressions of algebraic ideas, like plain English expressions of the same, does not scale very well.]
- User23 5y ago> 1. Since you seem to someone who reads papers sometimes, I would encourage you define your "programming notation" and start proving theorems in that notation. Dijkstra did just that[1]. That same site has hundreds of examples of him proving things in that very programmer friendly notation. Bear in mind that Dijkstra was trained as a “mathematical engineer” for his higher education. I’m not trying to be controversial, but traditional mathematicians are decades behind the best computing scientists when it comes to crafting formalisms. To be fair the typical practicing programmer is even further behind. I can only speculate about the appeal of a notation that makes it difficult or impossible to just let symbol manipulation do the heavy lifting. Perhaps mathematicians enjoy the intellectual exercise of holding all those concepts in mind? Perhaps they, like many guilds, appreciate the barriers to outsiders that they feel increase their own prestige? Or perhaps it’s just sheer inertia? I really don’t know. [1] https://www.cs.utexas.edu/users/EWD/transcriptions/EWD13xx/EWD1300.html https://www.cs.utexas.edu/users/EWD/transcriptions/EWD13xx/E...
- abdullahkhalids 5y agoI don't see anything in that link that is markedly different from math notation used by one math community or the other. Sure, there are difference that are "improvements" in some sense of the word, and I think some of those can be adopted. But nothing major, that will somehow massively reduce the complexity of understanding mathematics by non-experts.
- User23 5y ago> But nothing major, that will somehow massively reduce the complexity of understanding mathematics by non-experts. To give just one example, when done properly the use of hinting in the multi-line equational proof format will certainly ease the non-expert’s task of following a proof.
- abdullahkhalids 5y agoThe two-column proof has been a thing in math education for over a century [1]. I have been told by math educators that it is almost universally detested by school students, because of how it restricts their thinking. Nevertheless, it would be useful at the research level to include more of this hinting. But hinting is not a notational issue at all. [1] https://deepblue.lib.umich.edu/bitstream/handle/2027.42/42653/10649_2004_Article_5096042.pdf;jsessionid=010CB25D780CF8F8D1734F50743ED5AB?sequence=1 https://deepblue.lib.umich.edu/bitstream/handle/2027.42/4265...
- simias 5y agoI can completely understand using shorthand for complicated proofs (defining what they mean at the start). After all that's what I do in code as well: I often import and alias variables in the local scope, but it's limited to a very well defined context and explicit. What I disapprove of is using these very terse syntax in definitions like, say, in Wikipedia articles. In other words it's like how I have no issue using a variable named "int i;" locally in a function, but I'd consider it a very bad practice if a library exported a global "extern int I;" in their public interface.
- gjulianm 5y agoVariable naming is important because variables are used to represent almost anything, you have autocomplete and search so longer variable names are quickly typed, and most lines of codes will have one, two or three of these names. On the other hand, notation in mathematics is used to represent only a limited set of common concepts for the field, you don't have autocomplete and a single line can contain a lot of concepts. For example, compare two expressions of Stokes' theorem (given HN typesetting limitations): ∫_A dω = ∫_∂A ω versus integral(A, differential(ω)) = integral(boundary(A), ω) While the second one is easier to understand at a first glance, the problem of that equation is not the symbols but the concepts behind them. And to understand the concepts you're going to go over similar equations time and time again, and at that point the extra letters and extra space used is going to complicate both writing and reading the equations. Of course, there is always people who overuse and underuse notation, but if mathematics relies heavily on notation it's for a reason: it's useful. Edit: Also, the second one is only "easy" if you're familiarized with function calling in programming. One could argue that to go full notation-less you should only write in proper sentences, and that would make it even more complex.
- Izkata 5y agoActually you have an example of the unexplained oddness there: what does the underscore mean?
- gjulianm 5y agoI can't put subscript on HN (or at least I don't know how), see https://en.wikipedia.org/wiki/Generalized_Stokes_theorem https://en.wikipedia.org/wiki/Generalized_Stokes_theorem (first equation) for how it should be typeset.
- tokamak-teapot 5y agoI can search the words. I can ask people what the words mean. If don’t even know what the symbols are called then how do I begin? I had this problem when I started higher level maths and the Greek alphabet was used. I couldn’t ask what a symbol meant when I couldn’t say what the symbol was. I couldn’t write down a symbol whose name was read out when I didn’t know what it should look like. I tried learning the Greek alphabet but flash cards and spaced repetition didn’t work for my ADHD brain and I just had to stop doing maths, which was a shame, because up to that point I was good at it.
- zenithd 5y ago> Why is it that software engineers in a few decades have come to the conclusion that proper variable naming is important and abuse of sigils a bad idea but mathematics don't feel the same way? If yo read code in standard libraries, you'll see a lot of either single-letter variables or extremely generic variable names. Most mathematics is dealing with things at least one level of abstraction higher than a standard library. In most programs outside of things like standard libraries, a variable usually stands for something concrete and specific. A customer. An order. A specific type of element in a UI. Etc. In theory papers, a variable usually stands in for something generic and general. An arbitrary program. An arbitrary finite set. Etc. Sometimes even an arbitrary program in a programming language that is not defined in particular but only in general (e.g., "any language with parametric polymorphism", "any language with a specific sort of binding structure between things in these two syntactic categories", etc.). Again, standard libraries already start using more generic variable names, and most theory papers are dealing with an abstraction level higher than standard libraries.
- zenithd 5y agoI'll give some examples in the most strong-man way possible: by choosing the standard library of a famously verbose language (Java). Here are a few examples, with increasing levels of abstraction mapping onto increasing use of single-variable names: 1. A byte is pretty damn concrete. The Java byte implementation [1] uses almost exclusively single-letter names (b,s) or names that are so generic that they might as well be single-letter names (e.g., anotherByte instead of b). When more meaningful names are used, it's because they are public type names (String, int), which is, again, pretty damn concrete. 2. The next level of abstraction is Generics. Here, even Java -- a language whose verbosity is a long-standing joke -- starts using single-letter variable names for both types and values [2]. 3. Finally, we dive into things that abstract over generics [3] and start seeing weird sigils in addition to single-letter names. (What does Predicate<? super E> mean?!) And, again, this is a strong-manned example, since Java is famously verbose and I'm choosing some of the most-used and therefore most verbosely documented .java files in the world. Notice, btw, that natural language documentation increases as the verbosity of names decreases. This is the same in math, where those symbols are small pieces of 20+ page papers full of english prose explaining the meaning of the symbols. And, again most mathematics is dealing with things at least one level of abstraction higher than anything you find in a standard library. Sometimes several levels of abstraction. [1] Byte.java [2] Dequeue.java [3] Collection.java
- BeetleB 5y ago> (λy.M)[x := N] = λy.(M[x := N]), if x ≠ y and y ∉ FV(N) As someone who spent a lot of time in mathy subjects, this is very readable to me - even though I don't know lambda calculus. I'd posit that if you have trouble with this, it is merely due to not spending much time in math. Imagine someone who spent all his time in BASIC and he suddenly reads a Java codebase, and complains about the syntax. > Why is it that software engineers in a few decades have come to the conclusion that proper variable naming is important and abuse of sigils a bad idea but mathematics don't feel the same way? Because they've been doing it for a few hundred years longer than SW engineers have. I hear this refrain often here on HN. I would love to see someone write a textbook on electromagnetics or quantum mechanics using this verbose notation. The derivation of a harmonic oscillator (without ladder operators) takes a few pages of this concise notation. I shudder how lengthy it would be when more verbose.
- elsjaako 5y agoUsually mathematics is hard to understand if a subject matter is new. Most of the time there are some common examples that everyone learns about in a subject, and you learn to notate them along the way. When you write new mathametics you try to stick to the conventions from those examples. The common way you learn mathematics, the notation comes automatically, and new mathematics is often understood as a variation on the examples you learn. Some of these conventions you probably know, like having i for the varying number in a sum or product (or loop in programming) which goes up to an integer n. If you called an integer f or a complex number n it would make it much harder to read.