Friday, November 21, 2008

Mathematical Grammar

I'm strongly of the opinion that math is nothing more or less than a language. All languages are different, and it's harder to say certain things in some languages than in others. Math is particularly well suited toward making quantitative statements, and it's unusually difficult to contradict yourself in the language of Math... Or rather, it's more obvious when you've contradicted yourself, when you express something in the language of Math, than it is in English.

It takes some work to express qualitative statements like "That leaf is yellow" in Math, but if we resort to less than or greater than signs, or even "approximately equal" signs, we can usually do it:

That may need a little context, but the basic meaning is clear if you speak Math. (I could also have given RGB color values or even hex color codes, but I don't know those off the top of my head. In any case, there are usually lots of ways to quantify a quality like "color.")

Of course, it's usually much easier to understand Math if you provide the necessary context in English or another natural language... Rather like programming languages, which are just a dialect of Math really -- commenting your code makes it a lot easier to read.

But you know, some of the need for context is reduced by certain conventions which are a part of the grammar of Math, but which are rarely if ever formally stated. When students screw these up, it makes their work a lot harder to read or grade. I find it interesting that everyone eventually picks up on these conventions, all over the world, but no one ever really talks about them. For instance, above I used the greek letter "lamda" without saying what it meant. But to anyone who has had any contact with the physics community, "lamda" means wavelength. The fact that I talked about color and gave a number on the scale of the wavelength of light makes the interpretation certain. If you're a physics person, I don't need to tell you that I'm talking about wavelength there, and not some kind of computer color code. I should probably specify that the wavelength I'm talking about is that of the light reflected from the leaf, but the subscript "Leaf" and the context are again probably enough for you to guess that too.

Here are some of the unwritten rules that come immediately to mind:

Letters from the beginning of the Roman alphabet -- these are usually constants, especially if they are upper case.

Upper Case Roman Letters - these also frequently indicate a constant quantity, especially if the letter is from the beginning of the alphabet. Capital "C" and capital "K" are very popular choices to represent a constant because "constant" starts with a "C" in English and a "K" in German. Upper case Roman letters may also stand for matrices or tensors -- Usually you can tell which is which, because if it's a matrix or a tensor, all of the other terms in the equation will also be a matrices or tensors, so that knowing one symbol gives you hints about the others. (Also, I like to put little upside-down caret hats on my matrices. Most people use right-side-up carets, but I like to reserve those for unit vectors.) If you see a capital X, Y, or Z, however, you know it's likely to be a matrix, because those are almost never used for constants. Which brings me to my next rule.

The symbols x, y, z, and t are reserved for position and time - These are pretty much always variables, and nearly always stand for quantities with units of length, or in the case of t, of time. Sometimes students use "x" to stand for other quantities, because it's a popular choice to stand for any unknown quantity in high school algebra classes, but in the world of math-using professionals, this is a bad idea. Using "x" for a quantity that does not have units of length will confuse people unless you make it very clear what it does stand for. And even then, there are usually better, more conventional choices. If, for instance, the quantity is a pressure, use a "p"(preferably lower-case). If it's a temperature, go for the upper case "T," because the upper-case-letter-means-constant rule is not as firm as the lower-case-t-means-time rule. If it's a frequency, use "f" or "nu"... Most things have their own conventional symbols, in other words, specifically to avoid the problem of using "x" for everything. Save that for position. If there really is no conventional symbol for your quantity, use the lower case Greek letter xi. That's one of few letters that doesn't, by convention, already stand for something else (at least not in physics)

If it's a constant with units of length or time, use subscripts -- the unadorned x, y, z, and t are read as variables, but if you stick a subscripted number (not a letter) on them, they will be read as constants. A good choice is x-subscript-0 or t-subscript-1. In fact, almost anything with a suscripted number will be read as a constant, regardless of the other rules in this list.

Letters from the middle of the alphabet are integers -- In particular, do not use upper or lower case "N" to mean something that is not an integer, because it will confuse people. The letter "m", especially in lower case, is almost always an integer too. In computer science, so are "i", "j", and "k". In physics, however, it is not wise to use these symbols for integers unless they are appearing as an index or subscript. That's because these symbols have other meanings already. ("o" is never used because it looks just like zero.)

Lower case i means square root of negative one -- you can't use lower case "i" for any variable, because its meaning is already assigned. (Likewise that of "e" and lower case "pi" which stand for the natural base of logarithms, and the ratio of a circle's circumference to its diameter, respectively.) The exception to the "i" rule is if you are an electrical engineer, in which case you may use lower case "i" for current if you must. (I have no idea why "I" is the conventional symbol for current -- physicists use it too, but in upper case). Electrical engineers use "j" for the square root of negative one. As for "k" -- that is a seriously overused letter. It has seemingly dozens of conventional uses. It is often used for Boltzmann's constant, though I prefer to give it a subscript for that. In my world it is the wavenumber of light. But it may also be the so-called "lattice constant" for a crystal, a related but different concept. People use it for constants because the German "konstant" is spelled with a "k" even though it does not conform to the other rules about constant names. Plus, as I said, it's a popular index name, and used as a subscript usually represents an integer. In short, don't call anything else "k" unless you have to.

Lower case Greek letters are variables -- frequently, but not always. If you're going to use one to stand for a constant, though, I think you should stick a subscript on it, same as with x, y, z, and t. If you're in need of a good name for your variable, pick a lower case Greek letter. Of course, many of them already have conventional interpretations within a given field. As I said, "lamda" is wavlength, "nu" is frequency, "omega" is angular frequency, to me. "Iota" isn't used because it looks too much like "i". Lower case "mu" is a magnetic or electric dipole moment (as well as being the symbol for the prefix "micro"). Both lower and upper case "gamma" stand for decay rates, in my field. Lower and upper case "Psi" stand for quantum wavefunctions. Lowercase "alpha" is an absorption or loss coefficient... Those conventions are specific to my subfield. But there are also some broader rules: "theta" and "phi" are angles or phases to almost everyone. Lower case "delta" stuck in front of another variable means "a small change" in that variable, and upper case delta stuck in front a variable means the same thing, or by itself means "the difference between two quantities" (lower case "d" used in calculus to indicate a derivative.) Epsilon means "a small quantity" usually, as can lower case delta when used by itself. That still leaves a lot of letters, though, and I think most math people in all fields do read lower case Greek letters as variables. Again, I especially like "xi" and "zeta" for new variables I'm introducing because they don't already have conventional interpretations.

Use tildes primes, and subscripts to indicate related quantities -- If you start out with some variable "p" and then you introduce a new variable which is p*e^i*omega*t, a good name for the new variable is "p-tilde" or p with a tilde on top. You can also use "p-prime," which is p with an aprostrophe thing after it, though I prefer to reserve this notation for the derivative of p. A third alternative is to stick a subscript on it. For this example I might use "p-subscript-rot" because I think of this as p-rotating-with-the-field. For some letters you can also get away with switching between a Roman letter and a related Greek letter -- go from "r" to "rho" for instance, or from "b" to "beta."

Capital Greek Letters aren't good variable names -- Okay, you can get away with capital Psi, Theta, Gamma, and a few others, but capital "Sigma" is the summation symbol, and does not stand for a quantity at all. Likewise capital "Pi" (which must be written carefully to distinguish it from lower case "pi") means "multiply all of the terms in this sequence." Capital Delta, as mentioned before can be a variable indicating the different between two quantities, but it is usually a label used before a quantity to indicate a change in that quantity. Many of the other capital Greek letters look too much like their Roman counterparts to be useful.

Then there are all the different "hats" -- vector hats, unit vector carets, dots and double dots to indicate derivatives, bars to indicate averages... And specialized notations like Einstein summation indices, the use of parentheses, square brackets, and curly brackets... I would say these all serve a more or less "grammatical" function. (Then there are things like "bra-ket" notation and quantum field theory's "contraction" notation. Those aren't exactly grammatical, they're just a sort of shorthand.)

I'm sure if I surveyed some friends we could come up with a lot more rules like this, but I don't think anyone ever taught them too us formally. We just learned them, the same way you learn the grammar for any language that every one around you is speaking and writing. The rules are as weird and full of exceptions as the rules of English grammar, which is why mathematicians may not like to talk about them -- they like to pretend math is completely logical. But they serve a real purpose, just like English grammar. You try grading the work of a student who doesn't follow them. It's unreadable.

1 comment:

Bill Higgins-- Beam Jockey said...

To wander on a tangent from you remark:

In any case, there are usually lots of ways to quantify a quality like "color."

A scholar I know, Sarah Lowengard, has written a history of this: The Creation of Color in Eighteenth-Century Europe. Which I have been meaning to read...

It grew out of her thesis into an online book:

Lots of people tried to quantify color in some way. Naturalists wanted to reproducibly describe the colors of flowers, birds, rocks, and other natural objects. Dyemakers wanted to match colors and understand the quality of batches of dye. And so forth.

There's a whole world of color systems, and they have stretched across many disciplines over the centuries.