Basis Lab

Reading the Notation

A Letter Is Standing In For Something

Every letter in a formula is doing one of three jobs. Working out which job each one has is the first move in reading any line of mathematics.

Here is a line from a paper that a great many people stop reading at.

y^=1n∑i=1nwixi\hat{y} = \frac{1}{n} \sum_{i=1}^{n} w_i x_i

There is nothing hard in it. It says: multiply each number in your data by its

own weight, add the results up, and divide by how many there were. The

difficulty is not in the idea, it is that the line contains seven marks and

nobody ever explained what marks are for.

This course is about the marks. Not about doing mathematics, about reading it.

And the first thing to know is the most basic thing, which is that every letter

on the page is standing in for something, and your first job as a reader is to

work out what.

Three jobs

A letter in a formula is doing one of three jobs.

It might be a quantity you were given. In the line above, nn is the number of

examples in your data. You do not know what it is while reading, but somebody

knows, and when the formula is actually used it will be a specific number like

nine hundred. The formula is written with a letter so that it works for any

number of examples.

It might be an unknown that the formula is about to produce. In the line above

that is y^\hat{y}, the prediction. The whole point of the line is to say what

it equals.

Or it might be a name for a whole collection of numbers rather than a single

one. In the line above both ww and xx are of this kind: xx is all your

input numbers together, and xix_i is the ii-th one of them.

That third job is the one that causes trouble, because a letter naming nine

hundred numbers looks exactly like a letter naming one. The symbol does not

tell you. Only the surrounding words tell you, which is why the surrounding

words are not optional.

FIG 1The same line, with every letter given a job
the unknown: the single number this line exists to produce. The hat is a convention meaning an estimate rather than a true value, which is the subject of a later lesson
a given quantity: how many examples there are. A specific number in any actual use, written as a letter so the line covers every case
a collection: all the input numbers. Never used on its own here, only ever with a subscript attached
a collection of the same size: one weight for each input, which is what makes the subscripts line up
a local placeholder, not a quantity at all. It takes the values one to n in turn while the sum is carried out and then ceases to exist
Five letters and four different jobs between them. Nothing in the shapes of the letters says which is which, and that is the point of this lesson: the jobs come from the conventions in the next section and from the declarations in the one after.

The conventions nobody states

Nothing forces an author to use a particular letter for a particular job, and

yet almost all of them do. The habit is old and widely shared, and knowing it

is worth more than any other single thing when reading an unfamiliar line.

FIG 2
Where the letter comes fromWhat it usually isExamples
Start of the alphabeta fixed given quantity, ,
The run from to a counter, an index, or a count of things, , , ,
End of the alphabetthe data, and the unknowns, ,
A capitala whole collection: a matrix, a set, a table, ,
A Greek lettera quantity somebody chose or is trying to learn, ,
A letter with a hatan estimate of the thing without the hat,

Read the convention as a strong hint rather than a rule. Seeing nn in a

formula you have never met before, your first guess should be that it counts

something, and you should hold that guess until the text contradicts it. That

is how a practised reader gets through a page quickly: not by knowing what

every letter means, but by expecting the usual and noticing the unusual.

The most useful entry in that table is the capital. A capital letter is nearly

always a collection of numbers rather than one number, and the single most

common reading error is treating one as the other. If a line divides by XX and

XX is a table of nine hundred rows, you have misread the line, because

dividing by a table is not a thing that happens.

Letters that exist only inside one expression

Look again at ii in the formula. It is genuinely different in kind from the

other four letters, and the difference is worth being precise about.

nn means the same thing on every line of the page. If the author decided to

call it NN instead, every line mentioning it would have to change.

ii means nothing on any line of the page. It exists only between the sum sign

and the end of what is being summed. Inside there it takes the value one, then

two, then three, up to nn, and then the sum is finished and ii is gone. If

the author called it jj instead, the formula would mean exactly the same

thing, and nothing else on the page would need to change at all.

A letter of that kind is called bound, and there are three places they turn up:

under a sum or product sign, under an integral sign, and after a for-all or

there-exists claim. Everywhere else, letters are free, which means they mean

the same thing throughout.

Two practical consequences follow, and both are immediately useful. First, the

same ii can appear in four unrelated sums on one page and there is no

conflict, in exactly the way that two different recipes can both use the word

each. Second, if a bound letter appears in the result of the expression that

bound it, something has gone wrong: a sum over ii cannot produce an answer

that still mentions ii, any more than a loop can produce an answer that still

mentions its own counter.

FIG 3Reading one line, mark by mark, in the order a reader should take them
stepwhat you are looking atthe question to askthe answer in this case
1the whole linewhat single thing is this line claiming?that the left side equals the right side, so the line is a definition of the left side
2\hat{y}is this given, unknown, or a collection?unknown, and the one this line produces. Everything on the right is therefore known or assumed known
3the sum signwhich letter is it binding, and over what range?it binds i, and the range is written above and below: from one to n
4w_i x_iwhat is one term of the sum?one weight times one input, for whichever i the sum has reached. So the sum needs w and x to have the same number of entries
51/nis this inside the sum or outside it?outside, because it is written to the left of the sum sign. So the division happens once at the end, not n times
6n, appearing twiceis it the same n both times?yes: n is free, so it means the same thing in the limit of the sum and in the fraction. That is what makes this an average rather than something else
6 steps
The order matters. Reading outward in, rather than left to right, is how a formula becomes a sentence: first what is being claimed, then what the unknown is, then what each piece on the other side contributes. The last row is the one that turns this particular line from a weighted sum into an average.

Where a letter was introduced

Every letter in careful mathematical writing was introduced somewhere, and the

introduction carries more information than the name does.

The introductions look like this. A sentence beginning let, as in let nn be

the number of training examples. A clause beginning where, which is why the

figures in this library have a where list under them. A phrase attached to the

formula, like for all ii in one to nn. Or a declaration of kind, written with

a symbol this course covers later, saying that xx is a real number or that WW

is a table of a particular shape.

The practical advice is to go and find it. When a letter stops you, the answer

is almost never going to come from staring at the formula; it is three

paragraphs above, in a sentence that looked like prose and was actually a

definition. Reading mathematics well involves a lot of scrolling backwards, and

practised readers do it constantly rather than as a sign of difficulty.

The other half of the advice is what to conclude when the declaration is not

there at all. Sometimes it is genuinely absent, and then the formula is

incomplete and the fault is the author's. This is worth saying plainly because

the instinct of most readers is the opposite: to assume that an unexplained

symbol is something they should already know. Quite often it is something

nobody could know.

FIG 4The same formula as something that runs
python
def predict(w, x):
    n = len(x)                # w and x are the collections, n the count
    total = 0.0
    for i in range(n):        # i is bound: it exists only in here
        total += w[i] * x[i]  # one term of the sum
    return total / n          # the 1/n, applied once, outside the loop
Three of the marks have become ordinary programming. The sum sign is the loop, the subscript is the index into the list, and the bound letter i is the loop variable, which exists inside the loop and nowhere else. The given quantity n is not even written: it is the length of the data, which the code can ask for. Anybody who has written a loop has already used all three ideas and only needs the spelling.

What to take from this

Reading a formula starts with an inventory. Which letters are here, and what

is each one standing in for.

There are three answers available: a quantity somebody will supply, an unknown

the line is about to pin down, and a name for a whole collection. The

conventions tell you which is most likely, the declarations in the surrounding

text tell you for certain, and the one genuinely different kind of letter is

the bound one, which lives inside a single expression and means nothing

outside it.

Do that inventory on the next formula you meet before trying to understand

what it says. The understanding tends to arrive on its own once the inventory

is done, because most of what feels like mathematical difficulty is the strain

of trying to follow a sentence while four of the nouns are still unidentified.

Recap

  • A letter in a formula is always standing in for something, and it is doing one of three jobs: it is a fixed quantity you were given, an unknown the formula is about to pin down, or a name for a whole collection of numbers rather than a single one.
  • Which job a letter has is never stated, because there are conventions instead. Letters from the middle of the alphabet count things, letters from the end hold data, capitals usually name a collection, and a letter introduced under a sum sign exists only inside that sum.
  • A formula in which some letter was never introduced anywhere is not a hard formula, it is an incomplete one. Finding where each letter was declared is part of reading, and if a letter has no declaration the problem is with the page and not with the reader.

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

NextSomething In, Something Out →

The rest of this course

  1. 01A Letter Is Standing In For Somethingyou are here
  2. 02Something In, Something Outopening only
  3. 03The Sum Sign Is a Loopopening only
  4. 04Numbering Thingsopening only
  5. 05Products, Powers and Rootsopening only
  6. 06Four Different Equals Signsopening only
  7. 07The Alphabet Everyone Assumesopening only
  8. 08Reading One Real Formula All the Way Throughopening only

Read alongside