I have much more experience programming than I do with advanced mathematics, so perhaps this is just a comfort thing with me, but I often get frustrated trying to follow mathematical notation. Specifically, I get frustrated trying to keep track of what each variable signifies.

As a programmer, this would be completely unacceptable no matter how many comments you added explaining it:

Would you imagine writing, say, a long exact cohomology sequence not using a super-concise notation?!
– Andrea MoriFeb 28 '11 at 15:45

163

Because it's long, it makes it hard to see patterns, and it makes you think about interpretation when you should be thinking about form.
– Alexei AverchenkoFeb 28 '11 at 15:47

48

When I first took economics, it took me a bit of time to psychologically get over the fact that GDP, for example, stood for one quantity, not a product a three quantities.
– JavaManFeb 28 '11 at 16:01

4

Also, it also depends on what kind of programmer you are. APL programmers would beg to differ. (I personally think APL code is grotesque and unreadable, but for some reason, APL is still very popular among some financial types).
– GileadFeb 28 '11 at 16:09

7

Multi-char vars can be very useful in some situations: e.g. in physical/chemical process modeling, the number of distinct variables can run into the hundreds/thousands easily. Single char variables just don't cut it in such situations -- people just end up using all kinds of multi-char subscripts/superscripts on single-char variables for disambiguation, and it ends up being messier than if they had just used multi-char variables to begin with. When the function of variable names is purely descriptive (rather than for revealing patterns), I believe a case can be made for multi-char vars).
– GileadFeb 28 '11 at 16:24

25 Answers
25

I think one reason is that often one does not want to remember what the variable names really represent.

As an example, when we choose to talk about the matrix $(a_{ij})$ instead of the matrix $(\mathrm{TransitionProbability}_{ij})$, this expresses the important fact that once we have formulated our problem in terms of matrices, it is perfectly safe to forget where the problem came from originally -- in fact, remembering what the matrix "really" describes might only be unnecessary psychological baggage that prevents us from applying all linear-algebraic tools at our disposal.

(As an aside, have you ever seen code written by a mathematician? It very often looks exactly like your first example.)

+1 for the first line. Sometimes variables are just variables. They might not "mean" anything.
– Jesse MadnickMar 1 '11 at 12:07

4

@JesseMadnick that's not what Dan means at all. If variables are just variables, then whatever you do with them would be useless because the result means nothing. I think what Dan is trying to get at is that it's okay, and often preferred, to forget about the meaning of the variables while you're doing the math, but not at the end. After you have your result, you would want to remember what units or significance it has to make it useful.
– person27Apr 5 '14 at 17:01

2

@Stopforgettingmyaccounts...: Well, it's hard to remember exactly what I meant 3 years ago, but let me see. I think what I meant was: "+1 for the first line. And also, to add (but not to reiterate) what you're saying, I'd like to point out that sometimes variables don't have real-world meanings. What do $x$ and $y$ "stand for" in the equation $xy = 2$, say? Nothing." In fact, sometimes in the context of algebra (e.g. ring theory) we adjoin so-called "formal" variables that don't even live in the ring. What do these formal variables "mean"? Truly nothing.
– Jesse MadnickApr 5 '14 at 19:11

1

In fact, looking back on it, I probably meant an even stronger position. At the time, I very much held a formalist view of mathematics, that math is a game played with meaningless marks on paper. So long as we adhere to the axioms, nothing we write "means" anything. Mathematical entities themselves have no real-world meaning, or units, or significance. We can imbue objects with these things if we really want to, but the objects themselves do not inherently possess these things (in the formalist viewpoint).
– Jesse MadnickApr 5 '14 at 19:20

@JesseMadnick Yikes! Didn't mean to revive that topic; I guess I didn't pay attention to the age. I see what you mean, very much like Hooke's Law $F = -kx$ uses the meaningless constant $k$.
– person27Apr 5 '14 at 21:58

NB1: The history is told in Florian Cajori's book on the history of notation. In very old times, there were no variables (and no formulas, really) and everything was incredibly verbose. Cajori's book beautifully shows the very long and tortuous way from that to modern day notation for variables; there are several sections regarding the notation of unknowns and of their powers.

NB2: Additionally, we usually deal with very complicated expressions, so using verbose names for variables you render things almost impossible. Writing down the formula for Gaussian curvature in terms of $E$, $F$, $G$ and the Christoffel symbols if we wrote $\mathsf{Christoffel}^i_{jk}$ instead of $\Gamma^{i}_{jk}$ would turn differential geometry into a dead subject very soon :P

+1 for the first line, programmers are lazy too, but we're very used to cut/paste or abbreviation expansion/completion systems, and we tend to think that a long variable name carries no overhead. We also use abstraction a lot and ignore the fact that many functions we use conceal complex expressions.
– ocodoJun 16 '11 at 15:21

6

I think you've under-stated the case for the Christoffel symbols. Not only would $\Gamma$ become "Christoffel" but $i,j,k$ would become things like "time", "radius", and "azimuth".
– Andreas BlassJun 4 '13 at 1:43

Perhaps the most compelling reason for using single character variables is that it enables the usual convention of omitting the multiplication sign in products. This enables great conciseness in notating polynomials - which is important since polynomials are ubiquitous in mathematics, so any convention that simplifies their notation, comprehension, etc is surely worthwhile. Thus we can write $\rm\ xyz\ $ to mean $\rm\ x\cdot y\cdot z\ $ without any worry that it will be mistaken for a variable name.

While having to insert the multiplication signs doesn't reduce conciseness much for a monomial, it can greatly increase complexity for a polynomial of many terms. For it may cause equations to overflow the line/page length, etc, greatly hindering comprehension. Moreover, as many cognitive studies show, humans read read words by their shape (e.g. cover up the top/bottom half of a line of text and note how you can still easily read it), so any convention that alters shapes (or increases their visual complexity) may inhibit visual parsing, pattern-matching, and global inference of key structural characteristics.

I agree, although using the cdot notation (as you have done) for multi-char variable names does not appreciable reduce conciseness. I've had to write programs to generate LaTeX code for multi-char equations written by process modeling folks, and cdot was a very good compromise.
– GileadFeb 28 '11 at 16:17

Indeed. And on top of this, most polynomials use the same variable multiple times, and repeating a name of more than a few characters would be seen as clutter.
– StewartMar 1 '11 at 11:07

Note that this means that multi-letter variables are often OK in contexts where this isn't likely to come up, and you do occasionally see two or three-letter function names when the function is not going to be referred to without an argument.
– Harry AltmanNov 18 '11 at 23:20

1

@Marc I presumed that would be obvious, since it holds true for any language (vs. only mathematics). But perhaps it does deserve explicit mention.
– Bill DubuqueNov 30 '11 at 15:02

My linear algebra professor (J. Komlos) said something that has always stuck with me: we should always use the same letters to denote certain variables, and different letters for different (math) subjects. In this way, our brains are able to build mental pathways so that when we see certain letters we can remember lots of other things we know about that subject because we associate those letters with certain facts, theorems, etc.

I actually think it's mostly a cultural phenomenon, comp-sci people like to use acronyms in part because it's more clear to program with an acronym than a single letter. But similarly, chemists like to use Latin words, physicists make up descriptive names for things, and mathematicians make up new words no one has ever heard of before.

It is not true that one does not see formulae as you wrote in the very last line, something like $$ \mathrm{velocity} = \frac{\mathrm{displacement}}{\mathrm{time}} $$ In fact, I was taught algebra that way: start with word problems and write down mathematical expressions with words and labels, instead of numbers. I believe this kind of notation is also often used in textbooks.

Like Mariano and Templar said in their answers, one of the main advantage of the short single letter notation is ease of copying. For computations it is much easier to write (by hand) single letters than whole strings.

Another issue similar to the above is that it is easier to visually recognize identical terms when you use single letters. Take the expression for the "final amount" you wrote down. I happen to think that using the string "periods_per_yr" makes it harder to notice that the same term appear both in the denominator inside the brackets and in the exponent outside. Algebraically it is perhaps easier to keep track of structures using single letters.

Also, what about when performing abstract arguments where the variables do not refer to anything specific and concrete? Is the phrase "take three points in the plane, point_one, point_two, and point_three..." more easily to understand than "take three points $P,Q,R$ in the plane..."?

Lastly, in my PhD dissertation I have several computations involving expressions that span close to half a page when printed. I shudder to think what would happen if I use verbose names for all the terms: is it worth it to make individual variables more "legible" at the expense of making each equation span 3 pages? Does that actually improve overall legibility?

A number of excellent explanations have been given, ranging from laziness of mathematicians to convention. I'd like to add one more that may be slightly more debatable than others.

I dare to say I experience some sort of freedom when assigning variable names. This freedom is very typical to math: ideas are not bound by physical reality, the only constraints are your own imagination and the consistency of your thoughts. This freedom suffers if you're thinking about your math too concretely.

Here are a few remarks to explain my point of view:

Somewhere in the 15th century ($\pm$ a few centuries) people realised they didn't have to discribe their equations in words, they could just assign letters to their quantities and let the formulae speak for themselves. Suddenly people realised it was not necessary for algebraic equations to have a direct geometric meaning. If people had kept writing $\rm area = length\cdot width$ until the end of days, this might never have happened.

Let's say we were thinking about distance. We might write
$$ \rm distance = \sqrt{horizontal\ displacement^2 + vertical\ displacement^2}.$$ However, would you ever dare to write $\rm distance = |horizontal\ displacement| + |vertical\ displacement|$? Maybe you would, but write this on the blackboard of an average high-school physics teacher (no offence meant) and they might try to hit you with something. This is because they're thinking about the physical reality, not about the abstract properties of such a formula or it's consequences in a more abstract setting. Therefore if you ever want to define the concept of a metric space and study it's properties in full generality, it's probably safer to denote distance simply by "d". (Choosing 'd' as a small mnemonic to where it all started.)

Let's say we're thinking about a curve this time. At some point you may come to realise there's actually an interesting group structure on your curve. If you're refering to your curve simply as "curve" everywhere, it's probably a giant leap to suddenly rebaptize your curve into "curve that is actually a group as well". You'll probably still call your curve "curve" all the time and you may unconsciously make it harder for yourself to realise the importance and usefullness of it's group structure.

In conclusion: math is an abstract science, assigning the name all to concrete names to objects will constrain your imagination, which is always a bad thing in math.

I can't imagine writing full words when solving equation and rewriting it 10 times, when programming you usually don't write it so much, you can use functions, classes, copy/paste, programs which automatically insert variables etc.

Mathematical papers are written in verbose, descriptive language (e.g. English); equations and such are introduced to introduce precision and brevity when needed.

A computer program, however, is written in a very precise language. The role of some coding style guidelines (e.g. long identifier names) are to introduce the verbose, descriptive language where needed.

Also, mathematics is "executed" -- humans have to manipulate them.

Computer programs, however are almost never executed. Even in an interpreted language, your program will get tokenized and parsed, and the interpreter will operate on the result.

What do you mean by mathematics is executed but programs are not? When you run a program, isn't the computer executing it?
– timurNov 30 '11 at 16:14

2

I'm digging one step into the abstraction layer. In most cases, the first thing that happens is the text document that contains your source code is analyzed and converted into some other sorts of objects. This process includes things like the spiritual equivalent of converting all of your long identifiers into single-letter names.
– HurkylDec 1 '11 at 1:59

I think a better way to describe would be: Computer programs are almost never directly executed in text form. Rather, it is almost always converted into some more efficient intermediate format for execution, even in interpreted languages. (Bash is a bit of an exception though…)
– RufflewindNov 10 '16 at 4:37

Actually, I think the reason why single letter identifiers are popular in math, and not so popular in programming is Intelisense. Today, every profesional developer would flinch if shown something like return P * pow(1 + r / n, n * t), but we have been spoiled by the ease of use of automatic filling of long names.

As I remember, 10-15 years ago it was more common to use single or double letter names for any local variable, because the developer would have to write each character himself, by hand. Right now, I just press a few keys, and the IDE does the rest.

BTW, the name of the function used in the example (pow for Power) fits nicely with the explanation.

The reason cannot be Intellisense: Mathematicians have been using single letters variables since the begining of time, and (good) programmers have been using descriptive names since before the guys that wrote Intellisense heard about computers...
– Mariano Suárez-ÁlvarezMar 1 '11 at 15:21

3

pow, len, strcpy, sqrt. If those libraries were designed today, they would be Power, Length, StringCopy, SquareRoot. It's natural to shorten the notation when you are doing it by hand, but since I no longed do it by hand, I don't mind if a method is called ThrowStackOverflowException instead of thrSOExc, in fact I prefer the longer name.
– SWekoMar 2 '11 at 7:55

@muntoo, Ok, TheOutputCharactes is na overkill, but other than that, the first expressuion is clearer, and it would take the same time to write both of this. What odes flatten do? Is it clear from its name?
– SWekoApr 14 '11 at 6:59

1

@SWeko: Computers back then were actually rather limited on memory as well as bandwidth. Every byte counts back then. In particular, C89 said that identifiers with external linkage were limited to 6 significant characters, so that's why we have things like strcpy.
– RufflewindNov 10 '16 at 4:40

There is an important overlap between what you say and what has been said in earlier answers. :)
– Mariano Suárez-ÁlvarezFeb 28 '12 at 7:19

6

however, this fantastic formulation of the chain rule is hilarious.
– Sam LisiJun 26 '12 at 9:48

@SamLisi they wouldn't write it like this. It'd rather be deriv(compose(smoothFunc1, smoothFunc2), x) = deriv(smoothFunc1, smoothFunc2(x)) * deriv(smoothFunc2, x). Much shorter. Besides, it's clattered with parentheses, and I imagine they'd use a terser notation. E.g. in Haskell parentheses are unambiguously used for order, function application is just a whitespace. So you're down to deriv (smoothFunc1 . smoothFunc2) x = deriv smoothFunc1 (smoothFunc2 x) * deriv smoothFunc2 x(might confuse a bit if you don't know Haskell, but it is easier to read).
– Hi-AngelJun 28 '17 at 15:52

It's a convention like any other; never underestimate the power of historical inertia! Different disciplines have different conventions.

I would also guess (and I have no evidence to support this) that a big reason it is currently still around is that typesetting equations was expensive and time-consuming before the rise of modern typesetting (e.g. TeX) and writers of textbooks were probably encouraged to keep their notation as concise as possible. This would explain the disparity between mathematicians and programmers since the latter, after all, have the benefit of a history of using computers.

Even withTeX the software still "expects" single-letter variables. One can write $pressure$ but only with \mathrm{ ... } tags does it look like you would want a whole word to: $\mathrm{pressure}$.
– isomorphismesJun 23 '11 at 15:57

I think mathematicians continue to use such terse notation because they don't have to maintain their creations under time pressure. Mathematics is essentially a write-once language and it only runs inside another mathematician's very forgiving brain. You can spend an hour rereading the same paragraph in a math paper until you understand it, taking time to absorb and reabsorb the sundry meanings of the Greek and Roman characters arrayed before you, and nothing bad will happen in the meantime. In an IT operating environment, we don't have that luxury. If I were ever rolled out of bed at 0300 to deal with a computer system problem and I had to deal with scripts/logs written anything like a typical math theorem, the person/idiot responsible for those scripts/logs would be strangled/fired before sunup.

This isn't unique to mathematics, though. The same was true for pretty much all disciplines before there were computers. Papers meant to be read by humans don't have to be "maintained" in the same way that software does. (Because, as you said, the papers are only "run" in another human's brain.) Instead of maintaining "legacy papers", each generation can simply rewrite in its own language, letting the (human) readers' brains take care of any "backward compatibility" issues.
– TedJan 13 '12 at 6:18

2

As support for this view (that variable names in mathematics can be short because they are "throwaway" and the expressions don't have to be looked at again) — note that even in programming, certain variables that are very temporary and local in scope often take single-letter names. Loops are often written with "i" for the index, and this is not (usually) considered bad style if the body of the loop is short and its structure is nothing unconventional.
– ShreevatsaRMar 17 '13 at 11:19

I don't think that substituting single-letter variables with more letters would do much positive in most mathematics, because most theorems (and such) are short enough so that remembering a few variables isn't a problem. And if you forget, it is just to look at the start of the theorem. Also, there is conventions for what variable-letters to use in different circumstances. And last, it is a way to make it easier to separate words from variables.

In programming, the ability to have more letters for one variable, is a huge advantage because a program often consists of thousands of lines, and hundreds of variables.

Indeed, the usage that routinely confounds me is when I'm reading a paper and there's an intro paragraph that describes how 10 or more separate Roman/Greek/Hebrew symbols will be used, symbols that often have wildly differing value domains (sets, clauses, integers, formulas, edges, etc.), followed by a long series of increasingly complex lemmas that use those symbols. I can keep referring back to the intro paragraph, but jumping back and forth between contexts hinders understanding.
– Kyle JonesDec 21 '11 at 0:16

Because a variable is just a number and they all behave equally, different variables dont have any different meaning or interpretation in math, you dont gain any additional information by writing "final_amount" instead of x. Its only confusing and unproffesional. Even if you try to follow this path, there can be intermediate steps in solving an equation in which these words can not be interpreted in any sensible physical or informal way. For instance it can be convenient to introduce imaginary numbers even when solving equations with real solutions.

I'm a programmer as well. Note that your initial phrasing would be better as "As an imperative programmer, ..."

If you look at functional programming languages like F# or Lisp, the single letter variable paradigm is quite common for many of the reasons mentioned in the other answers. Take the functions:

let square x = x * x;;
let power x y = x ^ y;;

These are common and accepted ways to write your functional functions. This is mostly due to stateless/immutability differences in variables, but if we can skip the why explanations I'll just assert that the functional programming style parallels mathematical thinking far better than imperative.

Now imperative programming (by far the majority of programming) is more like a list of instructions, what I would compare in mathematics to a proof. If you remember back to 'doing proofs,' you state your reason for making each step along the way; in some cases rather verbosely.

…and every time I see a function with variables >4 in Haskell, I wondering about the original programmer's sanity. Don't get me wrong, sometimes I'm using such variables myself. We're all using "i" for index. And I don't have problems with sum a b = a + b. But there's some — very small! — amount when those single-letters bast*ds starts climbing into your eyes, hanging on your back, and squeezing your breath. It's especially annoying when you need to understand how to work with a project. Github has quite a few throw-away projects with many likes just because nobody tried to work with them.
– Hi-AngelJun 28 '17 at 16:56

I am a retired software engineer and a math person. I am going to answer your question based on my own personal experience and observation.

The coding style in your first example is unacceptable today but was common in old days. The FORTRAN programs written in 60's and 70's are like that.

The programmers deal with real life problems. The reasons programmers use long variable names are mostly for readability and easy to debug. Programmers are asked to use long names because they were having difficulty understanding code written by others and debugging code written in short names. I was once shown a piece of code written by myself and could not figure out what I was doing.

On the other hand, mathematicians mostly deal with abstractions. The formula in your example generally will be present with the explanation you provided. Later on in the literature,
the author can use t, which is the number of years, wherever it is needed without repeated explanations. Most mathematicians follow certain conventions, say they usually use x for an unknown, c for a constant without explanation. This sometimes will give the readers some trouble understanding the text if unusual conventions were used. Also, the reader will have to get used to the notation the author adopts. Sometimes it's a pain.

In either case, there is a compiler there. In the programming case, you have a compiler to help generating machine code for the computer to understand. In the math case, your brain is the compiler to generate the knowledge.

I write: Solutions of quadratic equation $ax^2 + bx + c=0$ are $(-b\pm\sqrt{b^2-4ac})/(2a)$. I would not want to write this with time in place of $x$ and acceleration_of_gravity in place of $a$ and so on!

The point is that we usually want to be as concise as possible, in other words, we want to be capable of being understood and on the same time do not need to write lots of things. In truth, you'll never see in the middle of a serious text of math some equations with letters appearing from nowhere without explanations: we always have the definitions first. The point is that there are some conventions that we follow: things that always have the same name, and that our audience is supposed to know about. But if we do not assume even those basic things from our audience, we define them as well.

Now, I'll give you an example that you'll agree that writting everything like you say will make us even unable to proceed with the theory (only a masochist would proceed with something like that). This is an equation from differential geometry:

Now, that $[ij,l]$ expands also into another kind of big expression. Now imagine if for each of the letters we write the word it means. An equation like this one, that after making the definitions is at same time compact and understandable, would become a real mess and people would get lazzy to write down equations like that writing every word. So, we do use letters because we gain compactness, we gain simplicity and we do not waste too much time writing, but the benefits of that are only achievable if we combine with clear definitions and organized line of thought. If so, when someone reaches an equation like that will look at it and say: "well, that's easy to read, the author defined all those terms properly!" and although in the paper will appear only letters, for one who knows the definitions the entire words will "be there" but without making a real mess with the text.

If we saw something like the above, then the alphabet implicitly used in mathematics would consist of words. So, then the individual letters of that alphabet basically require another language to get understood in the first place. In other words if you have something like "velocity=distance/time" then you have "velocity", "distance", and "time" at least as implied as existing in some language as part of its alphabet. But, of course, you're wanting those symbols also to represent English words which have meaning also. Thus, you need two alphabets working together at once, as well as two languages working together at once, and it's not at all clear that you'll avoid ambiguity in principle when you do this. You will have character strings which consist of a word in one language and a letter of the alphabet in the other language at the same time.

On the other hand the more common way just requires one alphabet and one language. In principle, one doesn't need any understanding of any natural languages to have v=(d/t) mathematically speaking. You just need "v", "d" and "t" as variables in your alphabet... and to perhaps make this clearer you could write the same formula mathematically as 6=(7/8) given 6, 7, and 8 as variables in your alphabet for some language. But, then we wouldn't seek to use "6", "7", and "8" to denote numbers, because then we would have two languages working simultaneously.

Basically, it comes as simpler to have v=(d/t) than to have velocity=(distance/time).

First of all, if mathematicians used more-than-one-letter variables, they might confuse them for multiplication. Second, mathematicians like to be as accurate in as little words as possible. And finally, there are 26 letters in the alphabet. It's not like one equation will use them all, anyways.

On the one hand, there are certain conventions about how which letters are used (integers versus reals versus complex numbers, parameters versus functions versus operators, indices, constants, etc.) and on the other hand, we can choose between lowercase / capitals, or go into other fonts or alphabets (calligraphy, fraktur, Greek, Hebrew, etc.) plus a few miscellaneous symbols here and there.
– anonJun 3 '13 at 23:47

1

@anon Well, even if you exclude those, Unicode still has 95156 (as of Unicode 3.2, there must be lots more by now) characters. Use those and you never run out
– Anonymous PiJun 3 '13 at 23:54

Much of formal math was developed before there were computers. Thus computation was done by hand, a very repetitive process. Much literature was written with this in mind. Since pure math is not an applied field, it generally does not throw away models used in the past, the body of relevant work extends back quite far. If the field were to decide that they want to change notation, there would be countless books and journal articles to update to the new notation. While it may be simple enough to update digital documents, a large number of document stored in analog or raster formats, would likely never get updated. This body of knowledge would likely become inaccessible to future generations and thus lost to history. It is unlikely that the field will change notation unless there is a really really good reason to do so. For example the adoption of Arabic numerals was a vas improvement over Roman numerals and happened at a time when there was a much smaller body of pre-existing literature.

Computer science on the other hand is a new, applied field, a good deal of the advancement of the field has been after the creation of the electronic computer. The field focuses on elimination of redundant work and aims to build working systems.

Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).