Friday, March 5, 2010

Pounds, shillings, pence as a system of logarithms

To the memory of Orson Pratt, 1811-1881. [Professor of Mathematics in the University of Nauvoo, and LDS (Mormon) apostle. Pratt presided over the LDS church's British Mission at a time when there were twice as many LDS in Britain as in the United States, so he would certainly have been familiar with the pounds, shillings, pence system of currency, in which 1 pound is worth 240 pence. A couple of decades later, Pratt, apparently at his own request, was assigned by Brigham Young to redivide the Book of Mormon into chapters and verses, a division which stands today: a canonical and somewhat lengthy colophon known as the Title Page, and 239 chapters, so 240 chapter-length divisions in all. At this remove, it is not possible to determine whether this coincidence of numbers was intentional, unconscious, or happenstance. Nevertheless, this system would not have been devised by this author without Pratt's subdivision, because it arose originally in connection with an effort to devise a mnemotechnical scheme for the chapter-by-chapter content of the Book of Mormon.]

The purpose of this posting is to describe a mixed system of logarithmic units.

By the end of the posting, with just the use of a table of 19 (easily memorized) values, you will be able to find arbitrary powers and roots of arbitrary numbers, generally to within one percent accuracy.

This system could, in principle, have been invented a couple of hundred years ago.  It is contructed mostly by stitching together a large variety of preexisting pieces: decades, decibels, R-series prefered numbers, pounds-shillings-pence money, order-of-magnitude arguments, percentage tweaking calculations.

My particular contribution here is putting together a mixed system of logarithmic units.  I have never seen that done anywhere else.  The system particularly exploits the numerical coincidence that

`qquadqquadqquad10^{1//240} \approx 1.01`,

where
  • `10` is the base of the decimal number system we use, 
  • `1.01` is the factor corresponding to a tweak of one percent, (percent being the usual unit of tweaking arguments,) and 
  • `240` is the number of pence in a pound, a highly composite number.

An earlier posting defined the (well-known) logarithmic units decade, neper, and octave as `"lg"(10)`, `"lg"("e")`, and `"lg"(2)`, respectively.  All logarithmic units in common use are at most simple rational multiples of one of these three units.  So, there are decadic units, neperic units, and octavic (or binary) units.

First, let's define three decadic units, and then show why they are particularly useful as a system.

These logarithmic units are the decade (dec), the decibel (dB), and the point (pt). Let's defer discussion of the merits of these particular names.

The old British Imperial currency, its lineage dating back past Charlemagne, had a pound equal to twenty shillings, and a shilling equal to twelve pence.

These logarithmic units share the same arithmetic.  The decade is twenty decibels, and the decibel is twelve points.  Thus
  • `1" decade" = "lg"(10)`,
  • `1" decibel" = 1/20 "lg"(10) = "lg"(10^{1//20}) \approx "lg"(1.12)`, and
  • `1" point" = 1/240 "lg"(10) = "lg"(10^{1//240}) \approx "lg"(1.01)`.
The decade is the multiplying strength of (a factor of) ten.

Arguments that use round powers of ten are a commonplace in technical disciplines.  They are known as order-of-magnitude arguments, and people use expressions like "three orders of magnitude" to mean "very roughly a factor of a thousand".  The decade is a precise order of magnitude.  Order of magnitude arguments are, at root, logarithmic arguments.

The common logarithm, the one found by the 'log' key on a calculator, is the number of decades in the multiplying strength of a number.

The decibel is the multiplying strength of the twentieth root of ten, which is about `1.12`.  Integer powers of this, i.e. numbers of the form `10^{n//20}` for `n` an integer, constitute the R20 series of prefered numbers, as now maintained in an international standard by the ISO.  The 'R' in R20 honours the French engineer Charles Renard, the inventor of this system.  The `20` tells us that we go from one power of ten to the next in twenty steps.  These steps---this is Renard's invention---go up in constant proportion.

All of the values in stripy multiplication table

`\qquad\qquad\qquad[(1,1.78,3.16,5.62,10),(1.78,3.16,5.62,10,17.8),(3.16,5.62,10,17.8,31.6),(5.62,10,17.8,31.6,56.2),(10,17.8,31.6,56.2,100)]`.

come from what could reasonably be called the R4 series of prefered numbers.  Interposing rows and columns, we can build a similar table for the R20 series.  The R20 values between `1` and `10`, rounded to three significant figures, are the values in the second column.  Their logarithms, expressed in decibels, appear in the first column ":

 `\qquad\qquad\qquad{:(0" dB", \qquad1),(1" dB", \qquad1.12),(2" dB", \qquad1.26),(3" dB", \qquad1.41),(4" dB", \qquad1.58),(5" dB", \qquad1.78),(6" dB", \qquad2.00),(7" dB", \qquad2.24),(8" dB", \qquad2.51),(9" dB", \qquad2.82),(10" dB", \qquad3.16),(11" dB", \qquad3.55),(12" dB", \qquad3.98),(13" dB", \qquad4.47),(14" dB", \qquad5.01),(15" dB", \qquad5.62),(16" dB", \qquad6.31),(17" dB", \qquad7.08),(18" dB", \qquad7.94),(19" dB", \qquad8.91),(20" dB", \qquad10):}`

Put another way, if `n` is the numerical part of the logarithm in the first column, then the number in the second column is `10^{n//20}`.

In the seventh edition of the SI Handbook, published by the BIPM, the bel was defined as half of what we have been calling a decade.  The decibel is a tenth of this, and so it is a twentieth of a decade.  The eighth edition of the SI Handbook removed this definition of the bel, but did not supersede it.

The R20 values form a bridge between the two other kinds of units.  Also, since, to three significant digits, the number 2 is an R20 value, the octave, `"lg"(2)`, is approximately a round number of decibels.  This gives us a tie between octavic units and decadic units.

The point is the multiplying strength of the 240th root of ten, which is about 1.01.  A change of one point is roughly equivalent to a change of one percent.  It is also roughly equivalent to a change of one centineper, which gives a tie to neperic units.

Percentage tweaking arguments are widely used in technical disciplines.  If a quantity goes up by three percent, say, then its square goes up by about six percent.  If the length of a rectangle goes up five percent, while its width goes up by two percent, than its area increases by about seven percent.  Addition of small percentage tweaks is used to do the work of multiplication---this is the hallmark of logarithms.  Small percentage tweaks used in this way are being used as approximate logarithms.

This mixed system of logarithmic units is particularly well suited to calculation of approximate logarithms.

As an example, let's calculate the logarithm of `72900`.  First, we rewrite this in reverse scientific notation, i.e. we factor it as a whole power of ten multiplied by a number between `1` and `10`:

`\qquad\qquad\qquad 72900 = 10^4 xx 7.29`.

Next, we break the second factor into two factors.  The first factor is selected from the R20 values in the table.  Since `7.29` is between `7.08` and `7.94`, we will pick one of these values.  We usually pick the lower table value, unless our value is within about two percent of the higher value.  Then

`\qquad\qquad\qquad 72900 = 10^4 xx 7.08 xx 7.29/7.08`.

We now calculate the ratio `7.29//7.08`.  This could be done by long division, but we prefer instead the folowing :

`\qquad\qquad 7.29/7.08 = 729/708 = {708 + 21}/708 = 1 + 21/708.`

To get three or four digits of accuracy in the sum `1 + 21//708`, we need only one or two digits of accuracy in `21//708`.  We can therefore afford to round the denominator, so that

`\qquad\qquad\qquad 21/708 \approx 21/700 = 3/100`.

Then `1 + 21//708 \approx 1.03`.

The same conclusion can be reached by making the proportion table :

 `\qquad\qquad\qquad{:(708, 100%),(71, 10%),(7, 1%),(21, ?):}.`

The first row always consists of the target divisor or denominator, here 708, and 100%.  One creates the second row by dividing through by ten or another simple divisor, until the value in the first column is comparable to or smaller than the target dividend or numerator, here 21.  Numbers in the first column are usually rounded to the same number of decimal places (here zero) as in the first row.  If the target numerator is a small multiple of the target numerator---here `21 = 3 xx 7,` this gives us what we are looking for, i.e. the desired percentage is `3 xx 1% = 3%.`

(We don't want a high multiple, especially if rounding has been severe.  If, for instance, the numerator had been 51 instead of 21, then we would created yet another row by taking three times the `[7,1%]` row from the `[71,10%]` row and we would have had `[50,7%],` so that `51//71 ~~ 0.07.`)

Either way, here, we get 

`\qquad\qquad\qquad 72900 = 10^4 xx 7.08 xx 1.03`.

From the table, we can rewrite `7.08 = 1.12^17`.  The binomial theorem gives us that `(1 + x)^n \approx 1 + n x`, and so `1.03 \approx 1.01^3`.  So

`\qquad\qquad\qquad 72900 \approx 10^4 xx 1.12^17 xx 1.01^3`.

Then

`\qquad\qquad\qquad "lg"(72900) \approx "lg"(10^4 xx 1.12^17 xx 1.01^3`)`,
`\qquad\qquad\qquad\qquad = "lg"(10^4) + "lg"(1.12^17) + "lg"(1.01^3`)`,
`\qquad\qquad\qquad\qquad = 4\cdot"lg"(10) + 17\cdot"lg"(1.12) + 3\cdot"lg"(1.01)`,
`\qquad\qquad\qquad\qquad = 4" dec" + 17" dB" + 3" pt"`.

Compound arithmetic with mixed units can be used for adding or subtracting the logarithms of different numbers, and even for multiplying or dividing by simple integers.  These are the processes one needs when one is using logarithms to multiply, divide, or take simple roots or powers.

For more complicated powers, and often in other calculations, it more convenient to work in a consistent units.  We can rewrite this mixed form using wiggle notation, and use that to calculate values in one or other of the given units, so that

`\qquad\qquad\qquad "lg"(72900) \approx 4;_{20}17_{12}3" dec"`,
`\qquad\qquad\qquad\qquad = 4_{20}17;_{12}3" dB"`,
`\qquad\qquad\qquad \qquad = 4_{20}17_{12}3;" pt"`.

For instance,

`\qquad\qquad\qquad 4;_{20}17_{12}3 = 4 +\frac{17 xx 12 + 3}{20 xx 12}`,

`\qquad\qquad\qquad\qquad = 4 +207/240`,
`\qquad\qquad\qquad\qquad = 4 +\frac{207 xx 1.04}{240 xx 1.04}`,
`\qquad\qquad\qquad\qquad \approx 4 + \frac{215}{250}`,
`\qquad\qquad\qquad\qquad = 4 +\frac{860}{1000}`,
`\qquad\qquad\qquad\qquad = 4.86`.

i.e. `"lg"(72900) \approx 4.86" dec"`, or `\log_{10}(72900) \approx 4.86`.  This compares well with the more accurate value of `4.8627275`.

It is usually more convenient to work in points.  The conversion doesn't require further division, at least here, and each point corresponds to a one percent difference in the answer, so it is easier to make decisions about acceptable error.

`\qquad\qquad\qquad "lg"(72900) \approx 4_{20}17_{12}3;" pt"`,
`\qquad\qquad\qquad = (80 + 17)_{12}3;" pt"`,
`\qquad\qquad\qquad = 97 xx 12 + 3" pt"`,
`\qquad\qquad\qquad = 1164 + 3" pt"`,
`\qquad\qquad\qquad = 1167" pt"`.

Suppose we wanted to find `72900^{3//7}`.

The logarithm of `72900^{3//7}` is `3//7` of the logarithm of `72900`, i.e. about `3//7` of `1167` points.  `1167 xx 3 = 3501`.  `3501 -: 7 \approx 500.1`.  So the logarithm of our answer is aboout `500.1" pt"`.

Reverting this into mixed units, we use divmod division, first by 12, and then by 20.

`\qquad\qquad\qquad 500.1 -: 12 = 41;_{12}8.1`, and


`\qquad\qquad\qquad 41 -: 20 = 2;_{20}1`,

so that

 `\qquad\qquad\qquad 500.1 = 2_{20}1_{12}8.1`,

and

`\qquad\qquad\qquad "lg"(72900^{3/7}) \approx 2" dec" + 1" dB" + 8.1" pt"`.

Then

`\qquad\qquad\qquad 72900^{3/7} \approx 10^2 xx 1.12 xx 1.081`,
`\qquad\qquad\qquad\qquad = 121.`,

which compares well with the more exact value `121.346`, especially considering that table values such as `1.12` have already been rounded to three significant figures.

Thursday, March 4, 2010

Power law characterisation of the generic logarithm

As in the last posting, we begin by asserting the existence of a function from the positive reals onto a set `L`,

`\qquad\qquad\qquad "lg":RR^+ \rightarrow L`.

Also, as stated in the last posting, "the log of a product is the sum of the logs of the factors" is not the only way to characterise the generic logarithm.

We can instead simply assert the end result of the last posting, and let that be our entire starting condition.

That is, for all positive real `x` and all real `p`, we assert that

`\qquad\qquad\qquad "lg"(x^p) = p\cdot"lg"(x).`

This defines multiplication of quantities in `L` by arbitrary real numbers.  Let us call this, with some degree of anticipation, the "scalar multiplication" condition.  As before, the existence of models ensures the consistency of the definition.

Consider now arbitrary positive real numbers `u` and `v`.  Then for arbitrary positive real `x \ne 1`, we can find `p` and `q` such that `u = x^p` and `v = x^q`.  Then

`\qquad\qquad\qquad "lg"(u v) = "lg"(x^p x^q)`,
`\qquad\qquad\qquad\qquad = "lg"(x^{p+q})`,
`\qquad\qquad\qquad\qquad = (p+q)\cdot"lg"(x)`,
`\qquad\qquad\qquad\qquad = p\cdot"lg"(x) + q\cdot"lg"(x)`,
`\qquad\qquad\qquad\qquad = "lg"(x^p) + "lg"(x^q)`,
`\qquad\qquad\qquad\qquad = "lg"(u) + "lg"(v)`.

and we have established the "the log of a product is the sum of the logs of the factors" condition with which we began the last posting. 

From this we could derive all subsequent results just as we did there---but that would be wasteful, as most of those results are simply instances of the scalar multiplication condition.

We can also use the scalar multiplication condition to define division in `L`, at least for `x \ne 1` (with the consequence that `"lg"(x) \ne 0)`.  In that case, we have

`\qquad\qquad\qquad \frac{"lg"(x^p)}{"lg"(x)} = p.`

Since, given any positive real `x` and `y`, we can find a unique real number `p` such that `y = x^p`, we can divide any quantity in `L` by any nonzero quantity in `L`.

Additive characterisation of the generic logarithm

At this point, let's define the generic logarithm a little more carefully.  The generic logarithm is a function from the positive real numbers onto a set `L`,

`\qquad\qquad\qquad "lg": RR^+ \rightarrow L,`

satisfying certain conditions.  We have some choice as to the conditions we use.

One possibility is to require that, for all positive real numbers `x` and `y`,

`\qquad\qquad\qquad "lg"(x y) = "lg"(x) + "lg"(y)`,

where this defines the addition on the right hand side.  This is the "the log of a product is the sum of the logs of the factors" condition.  (We shall need another condition eventually, but let's not introduce it until the need is clear.)

Then it is equally true that

`\qquad\qquad\qquad "lg"(w z) = "lg"(w) + "lg"(z)`.

Letting `w = x y` and substituting,

`\qquad\qquad\qquad "lg"(x y z) = "lg"(x y) + "lg"(z)`,
`\qquad\qquad\qquad\qquad = "lg"(x) + "lg"(y) + "lg"(z)`,

and we have the rather obvious-looking result that 

`\qquad\qquad\qquad "lg"(x y z) = "lg"(x) + "lg"(y) + "lg"(z)`,

By repeating this argument, we can extend it to finite products of any length.

For `n` a counting number, we can break the logarithm of `n` factors of positive real `x` into `n` copies of the logarithm of `x` :

`\qquad\qquad\qquad "lg"(x^n) = "lg"(x\cdotx\cdotxcdot\cdots\cdotx)`,
`\qquad\qquad\qquad\qquad = "lg"(x) + "lg"(x) + \cdots + "lg"(x)`,
`\qquad\qquad\qquad\qquad = n\cdot"lg"(x)`.

The last two lines define multiplication of quantities in `L` by counting numbers.

Substituting `y = 1` in `"lg"(x y) = "lg"(x) + "lg"(y)`,  we get

`\qquad\qquad\qquad"lg"(x 1) = "lg"(x) + "lg"(1)`,

i.e.

`\qquad\qquad\qquad"lg"(x) = "lg"(x) + "lg"(1)`.

Subtracting the quantity `"lg"(x)` from each side and rearranging, we have that

`\qquad\qquad\qquad "lg"(1) = 0`.

This is useful in its own right.

Now `0` is the number (or quantity) that does nothing when you add it.  `1` is the number that does nothing when you multiply it.  For any positive real number `x`, multiplying by no factors of `x` is the same as multiplying by `1`, i.e.

`\qquad\qquad\qquad x^0 = 1`.

So if `"lg"(1) = 0`, then

`\qquad\qquad\qquad "lg"(x^0) = 0 = 0\cdot"lg"(x)`,

since `0` times any quantity is still `0`.

We have therefore established that

`\qquad\qquad\qquad "lg"(x^n) = n\cdot"lg"(x)`

is true not only for `n` a counting number, but also when `n = 0`.

Now let `y = 1//x` in `"lg"(x y) = "lg"(x) + "lg"(y)`. We can do this, because if `x` is positive real, so is `1//x`.  Then

`\qquad\qquad\qquad"lg"(x\cdot1/x) = "lg"(x) + "lg"(1/x)`.

Since `x\cdot1//x = 1` and `"lg"(1) = 0`

`\qquad\qquad\qquad 0 = "lg"(x) + "lg"(1/x)`.

The astute reader will notice that this defines a suitably behaved `0` in `L`.

Subtracting`"lg"(x)` from each side and rearranging, we get that

`\qquad\qquad\qquad "lg"(1/x)= -"lg"(x)`,

 which can also be written

`\qquad\qquad\qquad "lg"(x^{-1})= -1\cdot"lg"(x)`.

This, too, is a definition---it tells us what negation means in `L`.

So now we have established that

`\qquad\qquad\qquad "lg"(x^n) = n\cdot"lg"(x)`

also holds when `n = -1`.

We can find the logarithm of a product of a counting number `m` copies of `x^{-1}` as we did for multiple copies of `x` :

`\qquad\qquad\qquad "lg"((x^{-1})^m) = "lg"((x^{-1})\cdot(x^{-1})\cdot(x^{-1})cdot\cdots\cdot(x^{-1}))`,
`\qquad\qquad\qquad\qquad = "lg"((x^{-1})) + "lg"((x^{-1})) + \cdots + "lg"((x^{-1}))`,
`\qquad\qquad\qquad\qquad = m\cdot"lg"((x^{-1}))`.

Then, since "lg"(x^{-1})= -1\cdot"lg"(x)`, we have that

`\qquad\qquad\qquad "lg"((x^{-1})^m) = m\cdot(-1\cdot"lg"(x))`,
`\qquad\qquad\qquad "lg"((x^{-1})^m) = -m\cdot"lg"(x)`.

So now, setting `n = -m`, we have established that 

`\qquad\qquad\qquad "lg"(x^n) = n\cdot"lg"(x)`

for any integer `n`.  i.e., we can always move an integer power outside the logarithm as a multiplier.

Now let `p` be any rational number, which we write as `p = r/s`, where `s` is a counting number (and therefore not zero), and `r` is an integer.   Let `y = x^p = x^{r/s}`.  Then, raising this to the power of `s`, we find that

`\qquad\qquad\qquad y^s = x^r`,

and so

`\qquad\qquad\qquad "lg"(y^s) = "lg"(x^r)`,

Since `r` and `s` are both integers, we know we can move the powers outside the logarithms to get

`\qquad\qquad\qquad s\cdot"lg"(y) = r\cdot"lg"(x)`.

We now divide both sides by `s`---we know `s` is nonzero---and write

`\qquad\qquad\qquad "lg"(y) =  {r/s}\cdot"lg"(x)`,

or

`\qquad\qquad\qquad "lg"(x^p) = p\cdot"lg"(x)`.

This, again, is a definition.  It tells us what it means to multiply a quantity in `L` by a rational number.  But it also allows us to assert that

`\qquad\qquad\qquad "lg"(x^n) = n\cdot"lg"(x)`

is true for any rational number `n`, not just integers.

It is reasonable to hope that this would be true for any real `n`, not just rationals.  Practical uses of mathematics should be insensitive to whether a number is rational or not.

The various ways to ensure reasonable behaviour amount to various assertions of that `lg` is a continuous function, i.e. that numbers that are close in `RR+` have logarithms that are close in `L`. 

The simplest way is to ensure that we get what we want is simply to assert that

`\qquad\qquad\qquad "lg"(x^n) = n\cdot"lg"(x)`

is true for all real numbers `n`, not just rational `n`.  One needs to establish that no contradictions arise, but the existence of models (such as ordinary logarithms to a particular base) guarantees contradictionlessness in this less specific setting.

The real question here is how to justify the equation


`\qquad\qquad\qquad "lg"(x^n) = n\cdot"lg"(x)`

as a definition for multiplication of quantities in `L` by irrational numbers `n`.

One way to do this is to import into `L` the notion of order already found in `RR^+`.  One can then transfer the definition of an irrational in `RR` using, say, Dedekind cuts over the rationals, into a definition of irrational powers.

To import that order, simply assert that whenever positive real numbers `x` and `y` are such that `x \le y`, then `"lg"(x) \le "lg"(y)`.  This defines the meaning of `\le` in `L`.  Since  "`le`" is, in fact, a total order in `RR^+`, the version of  "`\le`" defined for `L` is also a total order, and the function `lg` is monotonic, and therefore continuous.

Consider, now, the quantities `x^u` and `x^w`, with `u` and `w` rational, `u < w`, and `x` a positive real number.  There are three cases :
  • if `x > 1`, then `x^u < x^w`,
  • if `x = 1`, then `x^u = x^w`, and
  • if `x < 1`, then `x^u > x^w`.
Now consider `x^v`, where `u \le v \le w`, where `v` is real, possibly irrational.

In all three cases, `x^v` lies between `x^u` and `x^w`, i.e.

`\qquad\qquad\qquad \min(x^u, x^w) \le x^v \le \max(x^u, x^w).

Then, by the monotonicity of `lg`, the quantity `"lg"(x^v)` lies between "lg"(x^u)` and "lg"(x^w)`, and so `"lg"(x^v)` lies between "u\cdotlg"(x)` and w\cdot"lg"(x)`.

Let `v` now be irrational, and for definiteness, assume the first case, `x > 1`.  Consider the Dedekind cut for `v`, i.e. the partition of the rational numbers into two subsets, those that are below `v` and those that are above `v`.  Then here `u` belongs to the lowside set, and `w` to the highside set.

Since we know how find rational multiples of `lg(x)`, the logarithms of the lowside and highside sets are also well defined in `L`.  Since `lg` is monotonic, the order also transfers, so just as every member of the lowside set is lower than every member of the highside set in `RR`, so also is every member of the image of the lowside set lower---in the sense that is used in `L`---than every member of the image of the highside set.  So, for the given `x`, we can define a Dedekind cut in `L`, and can use this to define multiplication of quantities `lg(x)` in `L`, when `x > 1`.

The argument for the case `x < 1` switches the ends, but is otherwise the same.

For the case `x = 1`,

`\qquad\qquad"lg"(x^u) = "lg"(x^v) = "lg"(x^w) = "lg"(1) = 0.`

Here, the Dedekind cut argument fails, but it still seems reasonable to define the product of `v` and `0` by

`"lg"(1^v) = "lg"(1) = 0 = v\cdot0`,

i.e. that `n\cdot0 = 0`, whether `n` is rational or irrational.

Wednesday, March 3, 2010

One logarithm to rule them all

In technical material, one often comes upon logarithmic units of various sorts : decibels, astronomical magnitudes, nepers, bits, octaves, semitones, and so forth.

All of the logarithmic units of which I am aware are defined by an equation of the form

`\qquad\qquad\qquad x = R\cdot\log_a(Q_1/Q_0)\cdot"lgunit"`,

where
  • `R` is a simple nonzero rational number (positive or negative, often `1` or `-1`),
  • `a` is a base of logarithms, (in practice, this is always one of just three possibilities: `10`, `"e"`, or `2`,)
  • `Q_1` and `Q_0` are quantities, (`Q_0` is sometimes a fixed reference quantity,) and
  • `"lgunit"` is the particular logarithmic unit being defined by the equation.
While this is how logarithmic units are universally defined---even in standards documents---it is far from satisfactory.

In particular, it does not show the sense in which a logarithmic unit is, in fact, a unit.  In this posting, we look at a better way of doing this.

First, let us define the generic logarithm function, `"lg"(.)`.  A function is a object that, whenever you put something into it, you get something out.  For any given function, the thing you get out depends completely on what you put in.

A function is defined by the possible things you can put into it, i.e. the possible inputs, and then, for each such input, the output that the function gives, and also---this seems perverse at first---a given set of outputs that includes but which can be larger than the set of actual outputs.

The set of possible inputs is called the domain of the function.  The outputs that actually occur are called the image of the function.  The given output set---often a larger set that contains the image---is called the codomain of the function. 

Two functions are the same they share the same domain, the same codomain, and if for every possible input from the domain, they give the same output in the codomain.

It was once customary to talk about the range of a function, but this term is now little used---it was sometimes used to mean the image, and sometimes the codomain.

The domain of the generic logarithm, at least as we shall define it here, is the positive real numbers.

The codomain---and image---of the generic logarithm, is an otherwise unspecified set `L`.

The generic logarithm function is almost completely specified by the following, true for all real numbers `x>0` and `y>0`.  (The `almost` amounts to a continuity assumption that allows us to extend from rational powers to real powers.) :

`\qquad\qquad\qquad "lg"(x y) = "lg"(x) + "lg"(y).`

We already appear to be in difficulty.  Since we have not specified `L` to consist of numbers, or even of quantities, the equation just given defines how to add things in `L`.

The generic logarithm rather looks like a swindle.  What it says is, take a multiplication table, e.g. including stubs :

`\qquad\qquad\qquad[(xx,1,2,3),(1,1,2,3),(2,2,4,6),(3,3,6,9)]`.

Now replace number by the value of its generic logarithm, which is best thought of a kind of alter ego, or doeppelganger for the number :

`\qquad\qquad\quad[(\square,"lg"(1),"lg"(2),"lg"(3)),("lg"(1),"lg"(1),"lg"(2),"lg"(3)),("lg"(2),"lg"(2),"lg"(4),"lg"(6)),("lg"(3),"lg"(3),"lg"(6),"lg"(9))]`.

And now call the new table an addition table for the values of the logarithms :

`\qquad\qquad\qquad[(+,"lg"(1),"lg"(2),"lg"(3)),("lg"(1),"lg"(1),"lg"(2),"lg"(3)),("lg"(2),"lg"(2),"lg"(4),"lg"(6)),("lg"(3),"lg"(3),"lg"(6),"lg"(9))]`.

---all we have done is renamed everything in the table and called it an addition table.  Since we haven't required the various values to be distinct, this procedure cannot fail---at worst, we get an entire table full of zeroes, but no contradictions.

It isn't really a swindle, however, and it turns out that each positive number gets its own distinct logarithm :  what looks like mere rebranding turns out to have some content because multiplication of positive numbers behaves a great deal like addition of real numbers.

I find that it helps to have a mental picture of what generic logarithms do.  Pick any fixed positive real number `f \ne 1` as a base.  (I like to think of a small positive fractional tolerance `\epsilon`, and let `f = 1 + \epsilon`, so that `f` is slightly greater than `1`.)  Then any positive real number `x` can be written

`\qquad\qquad\qquad x = f^{p_x}`

for some real number `p_x`.  The subscript is to remind us that the value of `p_x` depends on the value of `x`.  `p_x` is the number of factors of `f` required to make `x` :

(We can even require `p_x` to be an integer, if we are content to tolerate a fractional error of about `\epsilon/2`,

`\qquad\qquad\qquad x \approx (1+\epsilon)^{p_x}`,

but there is no need to do this just yet.)

`p_x` is a measure of how powerful `x` is as a multiplier.  The specific size of `p_x` is not important---it depends not only on `x` but on the particular choice of `f`.  What is important is that, for any two positive real numbers `x` and `y`, if

`\qquad\qquad\qquad x = f^{p_x}` and `y = f^{p_y},`

then the ratio of `p_y` to `p_x` does not depend on the particular choice of `f`.

This is like the situation for physical quantities---the ratio of a pair of lengths, or a pair of weights, or a pair of electric currents does not depend on our particular choice of length unit, weight unit, or current unit.

Each positive real number, then, has its own particular multiplying strength, and that multiplying strength is a quantity.  The generic logarithm function takes in a positive real number as input, gives as output the multiplying strength of the number.

(In technical terms, `L`, the codomain of lg, is a one dimensional real vector space.  For comparison, the values of physical quantity 'electric current' also belong to a one dimensional real vector space. )

Indeed

`\qquad\qquad\qquad y = f^{p_y} = f^{p_x \cdot p_y/p_x} = (f^{p_x})^{p_y//p_x} = x^{p_y//p_x}`

In other words, the ratio of the multiplying strengths of `y` and `x` is the power one has to raise `x` to get `y`.  Since, e.g. `2^3 = 8`, the multiplying strength of `8` is three times the multiplying strength of `2`,

`\qquad\qquad\qquad "lg"(8) = 3 xx "lg"(2).`

Yet another way to write this is

`\qquad\qquad\qquad \log_2(8) = 3.`

Comparing these, we see that

`\qquad\qquad\qquad \log_2(8) = 3 = {"lg"(8)}/"lg"(2).`

This illustrates a general truth.  The following are equivalent, for all positive real numbers `x` and `b` and all real numbers `p` :
  • `x = b^p`,
  • `"lg"(x) = p "lg"(b)`,
  • `x` has `p` times the multiplying strength of `b`,
  • `\log_b(x) = p`,
  • `\frac{"lg"(x)}{"lg"(b)} = p`. 
From the last two of these, we have that

`\qquad\quad\qquad \log_b(x) = \frac{"lg"(x)}{"lg"(b)}.`

This connects the usual theory of logarithms to the generic logarithm.  The logarithm of a given number to a given base number is the ratio of their generic logarithms.  While generic logarithms are quantities rather than numbers, ratios of generic logarithms are numbers.

From this, we also get 

`\qquad\quad\qquad "lg"(x) = \frac{"lg"(x)}{"lg"(b)} xx "lg"(b) = \log_b(x) xx "lg"(b).`

It proves convenient to name some particular values of the generic logarithm :
  • `1" decade" = "lg"(10)`,
  • `1" neper" = "lg"("e")`,
  • `1" octave" = "lg"(2)`.
In that case,
`\qquad\qquad\qquad "lg"(x) = \frac{"lg"(x)}{"lg"(10)} xx "lg"(10) = \log_{10}(x)" decades",`

`\qquad\qquad\qquad\qquad\qquad = \frac{"lg"(x)}{"lg"("e")} xx "lg"("e") = \log_{"e"}(x)" nepers",`

`\qquad\qquad\qquad\qquad\qquad = \frac{"lg"(x)}{"lg"(2)} xx "lg"(2) = \log_{2}(x)" octaves".`

The decade (dec), neper (Np), and octave (oct) serve as different units of the single quantity `"lg"(x)` :

`\qquad\qquad "lg"(x)  = \log_{10}(x)" dec" = \log_{"e"}(x)" Np" = \log_{2}(x)" oct".`

This is somewhat similar to saying, for a line segment `U`,

`\qquad\qquad "length of "U = 1.5" yards" = 4.5" feet" = 54" inches".`

It would be possible, of course, to define three different quantities called, say, the yardiness, feetiness, and inchiness of a line segment `U`, and say that the yardiness of `U` is `1.5`, its feetiness is `4.5`, and its inchiness is `54`.

Of course that seems a little strange---but aren't we doing something rather similar when we say that the common logarithm of `1012` is slightly over `3`, its base `2` logarithm is just under `10`, and its natural logarithm is about `6.92`?

It seems preferable to have just one logarithm, the generic one, and to write, and also think :

`\qquad\qquad "lg"(1012)  \approx 3.005" dec" \approx 6.920 " Np" \approx 9.983 " oct".`

Another way to avoid having using multiple quantities is to strongly favor one unit, to the exclusion of other possibilities.  One could agree to avoid the use of yardiness and inchiness, favoring feetiness by default.  Or one could favor by default the base `"e"` (or 'natural') logarithm.

This latter trick works, as long as one is consistent.

Nothing in the definition of a length of, say, a foot, says that we cannot subsequently equate a foot to the number `1`.  If we do, than footiness and length become the same thing.

Similarly, there is nothing in the definition of the generic logarithm that prevents us from subsequently identifying, say, the neper with the number `1`.  In that case, the generic logarithm would be equivalent to the natural logarithm.

Both manoeuvres, equating length with footiness, or multiplying strength with the value of the natural logarithm, are a kind of cheat, however.

Such ideas as length and multiplying strength are best left without such encumbering identifications.  They are best kept generic.

    A continuous stripy multiplication table

    Sometimes, numbers and other quantities are used to count segments : "chapter one, chapter two, chapter three"; "first mile, second mile, third mile"; "first year, second year, third year".

    Sometimes, they are used to mark waypoints: "start (milestone 0), milestone 1, milestone 2, milestone 3"; "0 years old, first birthday, second birthday, third birthday".

    Sometimes, board games are played with pieces placed in the spaces: chess, draughts (checkers), snakes and ladders, noughts and crosses (tic-tac-toe).

    Sometimes, board games are played with pieces placed at the intersections: nine men's morris, go.

    In all of our multiplication tables so far, numbers have occupied cells in an array.

    Let us now fashion a multiplication table where the numbers are now thought of as labels for points.

    agraph
    width=400; height=400;
    xmin=(9.9); xmax=11.1;
    ymin=(-11.1); ymax=-9.9;
    marker = "none";
    marker = "dot";
    stroke = "none";
    markerfill = "blue";
    a=[];
    a[0]=[10,-10]; text([10,-10],"1",above);
    a[1]=[11,-10]; text([11,-10],"10",above);
    a[2]=[10,-11]; text([10,-11],"10",above);
    a[3]=[11,-11]; text([11,-11],"100",above);
    path(a);
    endagraph

    These four points are the corners of a square.  The idea now is to think of every point in the square as having a number, so that all the numbers form a continuous stripy multiplication table.  The line joining through the two `10` points consists of points that all have the value ten.  This is a stripe of the continuous table.

    We can mark some other points, to help see how things are working :

    agraph
    width=400; height=400;
    xmin=(9.9); xmax=11.1;
    ymin=(-11.1); ymax=-9.9;
    marker = "none";
    marker = "dot";
    stroke = "none";
    markerfill = "blue";
    a=[];
    a[0]=[10,-10]; text([10,-10],"1",above);
    a[1]=[11,-10]; text([11,-10],"10",above);
    a[2]=[10,-11]; text([10,-11],"10",above);
    a[3]=[11,-11]; text([11,-11],"100",above);
    a[4]=[10.5,-10.5]; text([10.5,-10.5],"10",above);
    a[5]=[10.25,-10.75]; text([10.25,-10.75],"10",above);
    a[6]=[10.75,-10.25]; text([10.75,-10.25],"10",above);
    path(a);
    markerfill = "yellow";
    b=[];
    b[0]=[10,-10.5];  text([10,-10.5],"3.16",above);
    b[1]=[10.25,-10.25];  text([10.25,-10.25],"3.16",above);
    b[2]=[10.5,-10];  text([10.5,-10],"3.16",above);
    b[3]=[10.5,-11];  text([10.5,-11],"31.6",above);
    b[4]=[10.75,-10.75];  text([10.75,-10.75],"31.6",above);
    b[5]=[11,-10.5];  text([11,-10.5],"31.6",above);
    path(b);
    markerfill = "red";
    c=[];
    c[0]=[10,-10.25]; text([10,-10.25],"1.78",above);
    c[1]=[10.25,-10]; text([10.25,-10],"1.78",above);
    c[2]=[10.25,-11]; text([10.25,-11],"17.8",above);
    c[3]=[10.5,-10.75]; text([10.5,-10.75],"17.8",above);
    c[4]=[10.75,-10.5]; text([10.75,-10.5],"17.8",above);
    c[5]=[11,-10.25]; text([11,-10.25],"17.8",above);
    path(c);
    markerfill = "green";
    d=[];
    d[0]=[10,-10.75]; text([10,-10.75],"5.62",above);
    d[1]=[10.25,-10.5]; text([10.25,-10.5],"5.62",above);
    d[2]=[10.5,-10.25]; text([10.5,-10.25],"5.62",above);
    d[3]=[10.75,-10]; text([10.75,-10],"5.62",above);
    d[4]=[11,-10.75]; text([11,-10.75],"56.2",above);
    d[5]=[10.75,-11]; text([10.75,-11],"56.2",above);
    path(d);
    endagraph

    This is clearly still a multiplication table of sorts.  To better emphasize continuity, we can drop all of our marker points except those on the perimeter of the square, and draw marker lines :

    agraph
    width=400; height=400;
    xmin=(9.9); xmax=11.1;
    ymin=(-11.1); ymax=-9.9;
    marker = "none";
    marker = "dot";
    stroke = "none";
    markerfill = "blue";
    a=[];
    a[0]=[10,-10]; text([10,-10],"1",above);
    a[1]=[11,-11]; text([11,-11],"100",above);
    path(a);
    stroke = "blue";
    aa=[];
    aa[0]=[11,-10]; text([11,-10],"10",above);
    aa[1]=[10,-11]; text([10,-11],"10",above);
    path(aa);
    markerfill = "yellow";
    stroke = "yellow";
    b=[];
    b[0]=[10,-10.5];  text([10,-10.5],"3.16",above);
    b[1]=[10.5,-10];  text([10.5,-10],"3.16",above);
    path(b);
    bb=[];
    bb[0]=[10.5,-11];  text([10.5,-11],"31.6",above);
    bb[1]=[11,-10.5];  text([11,-10.5],"31.6",above);
    path(bb);
    markerfill = "red";
    stroke = "red";
    c=[];
    c[0]=[10,-10.25]; text([10,-10.25],"1.78",above);
    c[1]=[10.25,-10]; text([10.25,-10],"1.78",above);
    path(c);
    cc=[];
    cc[0]=[10.25,-11]; text([10.25,-11],"17.8",above);
    cc[1]=[11,-10.25]; text([11,-10.25],"17.8",above);
    path(cc);
    markerfill = "green";
    stroke = "green";
    d=[];
    d[0]=[10,-10.75]; text([10,-10.75],"5.62",above);
    d[1]=[10.75,-10]; text([10.75,-10],"5.62",above);
    path(d);
    dd=[];
    dd[0]=[11,-10.75]; text([11,-10.75],"56.2",above);
    dd[1]=[10.75,-11]; text([10.75,-11],"56.2",above);
    path(dd);
    endagraph

    These marker lines are just a few of the continuous infinity of parallel lines that form the stripes of this table.

    Let the foregoing table be a single quilt square.  We can make copies of this square, some exact, and some multiplied by various whole powers of ten, and put them together like a quilt, to form a continuous, infinite, stripy multiplication table.

    To see how this is done, change the scale a bit, and consider the following powers-of-ten stripy multiplication table :

    agraph
    width=400; height=400;
    xmin=(9.8); xmax=13.2;
    ymin=(-13.2); ymax=-9.8;
    marker = "none";
    marker = "dot";
    stroke = "none";
    markerfill = "blue";
    a=[];
    a[0]=[10,-10]; text([10,-10],"0.01",above);
    a[1]=[11,-10]; text([11,-10],"0.1",above);
    a[2]=[10,-11]; text([10,-11],"0.1",above);
    a[3]=[12,-10]; text([12,-10],"1",above);
    a[4]=[11,-11]; text([11,-11],"1",above);
    a[5]=[10,-12]; text([10,-12],"1",above);
    a[6]=[13,-10]; text([13,-10],"10",above);
    a[7]=[12,-11]; text([12,-11],"10",above);
    a[8]=[11,-12]; text([11,-12],"10",above);
    a[9]=[10,-13]; text([10,-13],"10",above);
    a[10]=[13,-11]; text([13,-11],"100",above);
    a[11]=[12,-12]; text([12,-12],"100",above);
    a[12]=[11,-13]; text([11,-13],"100",above);
    a[13]=[13,-12]; text([13,-12],"1000",above);
    a[14]=[12,-13]; text([12,-13],"1000",above);
    a[15]=[13,-13]; text([13,-13],"10000",above);
    path(a);
    endagraph
    Put a copy of the preceding "single quilt square" table in the middle, and fit appropriate other quilt squares around it in all directions, selecting the appropriate power of ten multiplier for the quilt square so that edges match.

    The result is an infinite, continuous, stripy multiplication table.

    Take a horizontal or vertical line through this infinite table.  Each point on such a line has a number associated with it.  The numbers run from arbitrarily small positive numbers at one end of the line, to arbitrarily large positive numbers at the other.  A line so marked is called a logarithmic scale.  On a logarithmic scale, the integer powers of any given positive number are evenly spaced.

    The single quilt square multiplication table devised above, if given a quarter turn anticlockwise, is apparently the original log-log plot.  For details, see the article on Lalanne's Universal Calculator in Ron Doerfler's beautiful 2010 "Graphical Computing" calendar.

    I ran into Doerfler's calendar, and was introduced to Lalanne, three or four days after coming up with and using stripy continuous multiplication tables in lectures to give my liberal arts major classes a feel for logarithmic units.  I am familiar with log-log plots, but hadn't approached this in that light.

    As my father used to say, great minds think alike, but greater minds think first.

    Nor is this the first time Doerfler and I have crossed paths mentally.  A piece of Doerfler's writing, on calculating inverse hyperbolic tangents, proved useful in a physics paper I got published in the American Journal of Physics a few years ago.  That, too, was related to logarithms.

    Tuesday, March 2, 2010

    Stripy multiplication tables

    Consider the following (somewhat contrived) stripy multiplication table:

    `\qquad\qquad\qquad[(1,100, 10000),(100,10000,1000000),(10000,1000000,100000000)]`

    It is easy to interleave new rows and new columns, to get another stripy multiplication table :

    `\qquad[(1,10,100,1000,10000),(10,100,1000,10000,100000),(100,1000,10000,100000,1000000),(1000,10000,100000,1000000,10000000),(10000,100000,1000000,10000000,100000000)]`

    Now look at this very simple table, which is a subtable of the last one :

    `\qquad\qquad\qquad[(1,10),(10,100)]`.

    Can we interleave a new row and a new column into this table, preserving the existing values, and producing a new stripy multiplication table? In other words, can we fill in the missing values in this,

    `\qquad\qquad\qquad[(1,"*",10),("*","*","*"),(10,"*",100)]`,

    to make the result a stripy proportion table? Stripiness is constancy along the diagonals :

    `\qquad\qquad\qquad[(1,u,10),(u,10,v),(10,v,100)]`.

    The proportionality condition requires e.g. that

    `\qquad\qquad\qquad1/u = u/10,`

    i.e. that `u^2 = 10,` i.e. that `u = \pm\sqrt10`. Let us choose `u = \sqrt{10}.` Then we have

    `\qquad\qquad\qquad[(1,\sqrt10,10),(\sqrt10,10,v),(10,v,100)]`.

    Looking at the subtable in the top right hand corner,

    `\qquad\qquad\qquad[(\sqrt10,10),(10,v)]`,

    we can solve for `v` :

    `\qquad\qquad\qquad v = \frac{10 xx 10}{\sqrt10},`
    `\qquad\qquad\qquad\qquad = \frac{100}{\sqrt10},`
    `\qquad\qquad\qquad\qquad = \frac{100 xx \sqrt10}{\sqrt10 xx \sqrt10},`
    `\qquad\qquad\qquad\qquad = \frac{100 xx \sqrt10}{10},`
    `\qquad\qquad\qquad\qquad = 10\sqrt10.`

    So now we have a complete stripy multiplication table :

    `\qquad\qquad\qquad[(1,\sqrt10,10),(\sqrt10,10,10\sqrt10),(10,10\sqrt10,100)]`.

    This can be more revealingly presented by writing all the entries as powers of `10`:

    `\qquad\qquad\qquad[(10^0,10^{1/2},10^1),(10^{1/2},10^1,10^{1 1/2}),(10^1,10^{1 1/2},10^2)]`,

    or if we write the exponents fully in decimal,

    `\qquad\qquad\qquad[(10^0,10^{0.5},10^1),(10^{0.5},10^1,10^{1.5}),(10^1,10^{1.5},10^2)]`.

    This illustrates a general truth. A stripy proportion table is made by raising a single number (i.e. a base) to powers (exponents) coming from a stripy glide table. Here, for instance, we can pick `10` as the base, and

    `\qquad\qquad\qquad[(0,0.5,1),(0.5,1,1.5),(1,1.5,2)]`

    as the table of exponents.

    The choice is not unique, however.  For instance, we could get the same result by using `\sqrt10` or `10^{0.5}` for the base, and

    `\qquad\qquad\qquad[(0,1,2),(1,2,3),(2,3,4)]`

    for the table of exponents.  Either way, we the result is the multiplication table

    `\qquad\qquad\qquad[(10^0,10^{0.5},10^1),(10^{0.5},10^1,10^{1.5}),(10^1,10^{1.5},10^2)]`.

    Let us rewrite this in decimals, rounding to three significant figures :

    `\qquad\qquad\qquad[(1,3.16,10),(3.16,10,31.6),(10,31.6,100)]`.

    When working with stripy multiplication tables, lets us adopt the understanding that rounded values are shorthand for the exact values.

    We can fill in new rows between these.  Stripiness constrains what is possible :

    `\qquad\qquad\qquad[(1,a,3.16,b,10),(a,3.16,b,10,c),(3.16,b,10,c,31.6),(b,10,c,31.6,d),(10,c,31.6,d,100)]`.

    Consider, now, just the first two columns :

    `\qquad\qquad\qquad[(1,a),(a,3.16),(3.16,b),(b,10),(10,c)]`.

    By stripiness, the second column is essentially the first column, displaced upward one place.  Applying the proportionality condition to the first two rows, we have :

    `\qquad\qquad\qquad1/a = a/3.16`.

    Then `a^2 = 3.16` and `a = \pm1.78`, where we are using `3.16` as shorthand for `\sqrt{10}` and `1.78` as shorthand for `\sqrt\sqrt10`.  Selecting the positive sign, `a = 1.78`.

    Now, considering the second and third rows, we have

    `\qquad\qquad\qquad1.78/3.16 = 3.16/b`.

    This determines `b` fully, including its sign.  Alternatively, we can look at the third and fourth rows, taking

    `\qquad\qquad\qquad3.16/b = b/10`,

    and this determines that the magnitude of `b` is `\sqrt{3.16 xx 10} = 5.62`, i.e. that it is the geometric mean of `3.16` and `10`.

    Looking back, we see that with the choice of positive sign, `a` is also the geometric mean of the `1` and `3.16`, the quantities above and below it.

    `\qquad\qquad\qquad[(1,1.78),(1.78,3.16),(3.16,5.62),(5.62,10),(10,c)]`.

    The last value can be conveniently found from applying the proportionality condition to the first and last rows, i.e. to the four corners of the preceding table,

    `\qquad\qquad\qquad1/10 = 1.78/c`,

    so that `c = 10 xx 1.78 = 17.8`, and the table is

    `\qquad\qquad\qquad[(1,1.78),(1.78,3.16),(3.16,5.62),(5.62,10),(10,17.8)]`.

    By stripiness, we can generate most of the third column,

    `\qquad\qquad\qquad[(1,1.78,3.16),(1.78,3.16,5.62),(3.16,5.62,10),(5.62,10,17.8),(10,17.8,"d")]`.

    The proportionality condition on the four corners of this table is

    `\qquad\qquad\qquad1/10 = 3.16/d`,

    whence `d = 10 xx 3.16 = 31.6,` and the table becomes

    `\qquad\qquad\qquad[(1,1.78,3.16),(1.78,3.16,5.62),(3.16,5.62,10),(5.62,10,17.8),(10,17.8,31.6)]`.

    We can find the remaining columns in the same way, getting, to three significant digits,

    `\qquad\qquad\qquad[(1,1.78,3.16,5.62,10),(1.78,3.16,5.62,10,17.8),(3.16,5.62,10,17.8,31.6),(5.62,10,17.8,31.6,56.2),(10,17.8,31.6,56.2,100)]`.

    As before, we can express this as

    `\qquad\qquad\qquad[(10^0,10^0.25,10^0.5,10^0.75,10^1),(10^0.25,10^0.5,10^0.75,10^1,10^1.25),(10^0.5,10^0.75,10^1,10^1.25,10^1.5),(10^0.75,10^1,10^1.25,10^1.5,10^1.75),(10^1,10^1.25,10^1.5,10^1.75,10^2)]`.

    i.e, as `10` to the power of exponents from the stripy glide table

    `\qquad\qquad\qquad[(0,0.25,0.5,0.75,1),(0.25,0.5,0.75,1,1.25),(0.5,0.75,1,1.25,1.5),(0.75,1,1.25,1.5,1.75),(1,1.25,1.5,1.75,2)]`.

    Using stripiness and proportionality, the proportion table

    `\qquad\qquad\qquad[(1,1.78,3.16,5.62,10),(1.78,3.16,5.62,10,17.8),(3.16,5.62,10,17.8,31.6),(5.62,10,17.8,31.6,56.2),(10,17.8,31.6,56.2,100)]`

    can be extended infinitely in all directions. Here's a start :

    `\qquad[(0.1,0.178,0.316,0.562,1,1.78,3.16,5.62,10),(0.178,0.316,0.562,1,1.78,3.16,5.62,10,17.8),(0.316,0.562,1,1.78,3.16,5.62,10,17.8,31.6),(0.562,1,1.78,3.16,5.62,10,17.8,31.6,56.2),(1,1.78,3.16,5.62,10,17.8,31.6,56.2,100),(1.78,3.16,5.62,10,17.8,31.6,56.2,100,178.),(3.16,5.62,10,17.8,31.6,56.2,100,178.,316.),(5.62,10,17.8,31.6,56.2,100,178.,316.,562.),(10,17.8,31.6,56.2,100,178.,316.,562.,1000)]`.

    This infinite multiplication table can be built from very little.

    First, we note that every row and every column consists of the same infinite-in-both-directions sequence of values,

    `\qquad\ldots,0.316,0.562,1,1.78,3.16,5.62,10,17.8,31.6,\ldots`

    Second, we note that this is what is classically called a geometric progression, a sequence of numbers with a common ratio.  Each number is `10^0.25 \approx 1.78` times the one that precedes it.  Since `1` is in this sequence, the sequence consists of all numbers `10^{n/4}`, with `n` an integer.

    Third, we note that, up to round factors of ten, there are only four distinct numbers here, even in the infinite version of the table.  To three significant digits, they are : `1, 1.78, 3.16, 5.62`.  Every number in the table consists of one of these digit strings, differing only where the decimal point is placed.

    To have this infinite table, to three digit accuracy, at one's mental service, all one need do is remember this sequence of numbers and what they mean :

    `\qquad\qquad\qquad[(\ulx,\ul{10^x}),(0,1),(1//4,1.78),(1//2,3.16),(3//4,5.62),(1,10)]`.

    To find, for instance, `56.2 xx 3.16`, one reasons

    `\qquad\qquad\qquad 56.2 xx 3.16 = 10 xx 5.62 xx 3.16,`
    `\qquad\qquad\qquad\qquad = 10^1 xx 10^\frac{3}{4} xx 10^\frac{1}{2},`
    `\qquad\qquad\qquad\qquad = 10^(1 + 3/4 + 1/2),`
    `\qquad\qquad\qquad\qquad = 10^(2 + 1/4),`
    `\qquad\qquad\qquad\qquad = 10^2 xx 10^{1/4},`
    `\qquad\qquad\qquad\qquad = 100 xx 1.78,`
    `\qquad\qquad\qquad\qquad = 178.`

    Why is the standard multiplication table harder to learn than the usual addition tables?

    A standard times table, in proportion table form, looks like this :

    `\qquad\qquad\qquad[(1,2,3,4,5,6,7,8,9,10),(2,4,6,8,10,12,14,16,18,20),(3,6,9,12,15,18,21,24,27,30),(4,8,12,16,20,24,28,32,36,40),(5,10,15,20,25,30,35,40,45,50),(6,12,18,24,30,36,42,48,54,60),(7,14,21,28,35,42,49,56,63,70),(8,16,24,32,40,48,56,64,72,80),(9,18,27,36,45,54,63,72,81,90),(10,20,30,40,50,60,70,80,90,100)]`
     
    A standard addition table (not a proportion table of course, but rather a glide table,) looks like this :

    `\qquad\qquad\qquad[(0,1,2,3,4,5,6,7,8,9),(1,2,3,4,5,6,7,8,9,10),(2,3,4,5,6,7,8,9,10,11),(3,4,5,6,7,8,9,10,11,12),(4,5,6,7,8,9,10,11,12,13),(5,6,7,8,9,10,11,12,13,14),(6,7,8,9,10,11,12,13,14,15),(7,8,9,10,11,12,13,14,15,16),(8,9,10,11,12,13,14,15,16,17),(9,10,11,12,13,14,15,16,17,18)]`

    A glide table is to addition and subtraction what a proportion table is to multiplication and division.

    In a glide table, all the rows, and equivalently all the columns, differ by fixed amounts.

    The way to reconstruct a value at one corner of a box (`2 xx 2` subtable) also differs, but in an obvious way :  to find the value at one corner, one adds the values at the neighboring corners and subtracts the value at the opposite corner.

    So now we have presented two tables, one for multiplication, and the other for addition.  It is reasonably common for people to not remember all multiplications in the times table, but rather rarer for them not to know all that is in the addition table.

    There are a number of reasons for this, of course.  The numbers in the multiplication table are mostly larger, for instance.

    Two of the reasons, however, for the relative ease of learning the addition table can help us construct multiplication tables that are easy, for what they do:
    • the standard addition table, even though it is the same size, has fewer distinct values than the standard, multiplication table, and
    • the standard addition table has a simpler structure---it is stripy.
    Looking at the standard addition table, we see stripes of common values.  It is possible to make multiplication tables that are stripy.  Consider, for instance, this one :

    `\qquad\qquad\qquad[(1,2,4,8,16,32),(2,4,8,16,32,64),(4,8,16,32,64,128),(8,16,32,64,128,256),(16,32,64,128,256,512),(32,64,128,256,512,1024)]`

    In the next posting, we shall begin constructing some useful stripy multiplication tables.

    Thursday, February 25, 2010

    Long division taken apart, continued

    Now that we have taken long division apart, in the last posting, and made a multiplication table for the divisor `21`, in the posting before that, we are ready to look at the standard long division algorithm, with Jakow Trachtenberg's trick.

    We are dividing `1543` by `21`, using the multiplication table

    `\qquad\qquad\qquad[(0, 0),(1, 21),(2,42),(3,63),(4,84),(5,105),(6,126),(7,147),(8,168),(9,189)]`.

    Start by writing

    `\qquad\qquad\qquad\qquad\quad"****."`
    `\qquad\qquad\qquad 21 )\bar1543.`

    From the table, see that no whole `21`s go into `1` or into `15`, but that `7` whole `21`s, but not `8`, go into `154` :

    `\qquad\qquad\qquad\qquad\qquad\quad7"*."`
    `\qquad\qquad\qquad 21 )\bar1543.`
    `\qquad\qquad\qquad\qquad\quad147 .`

    Subtract `1470` from `1543` leaving `73`.

    `\qquad\qquad\qquad\qquad\qquad\quad7"*."`
    `\qquad\qquad\qquad 21 )\bar1543.`
    `\qquad\qquad\qquad\qquad\quad\ul1470.`
    `\qquad\qquad\qquad\qquad\qquad\quad73.`

    From the table, again, `3` whole `21`s, i.e. `63`, go into `73`, leaving `10`.

    `\qquad\qquad\qquad\qquad\qquad\quad73.`
    `\qquad\qquad\qquad 21 )\bar1543.`
    `\qquad\qquad\qquad\qquad\quad\ul1470`
    `\qquad\qquad\qquad\qquad\qquad\quad73.`
    `\qquad\qquad\qquad\qquad\qquad\quad\ul63.`
    `\qquad\qquad\qquad\qquad\qquad\quad10.`

    This is the stopping point for divmod division, so that `1543 :- 21 = 73 " remainder " 10.`

    For decimal division, one continues `21`s into `100` go `4` times, i.e. `84` leaving `16`.

    `\qquad\qquad\qquad\qquad\qquad\quad73.`
    `\qquad\qquad\qquad 21 )\bar1543.`
    `\qquad\qquad\qquad\qquad\quad\ul1470`
    `\qquad\qquad\qquad\qquad\qquad\quad73.`
    `\qquad\qquad\qquad\qquad\qquad\quad\ul63.`
    `\qquad\qquad\qquad\qquad\qquad\quad10.0`
    `\qquad\qquad\qquad\qquad\qquad\qquad\ul8.4`
    `\qquad\qquad\qquad\qquad\qquad\qquad1.6`

    This continues until one has reached the desired degree of accuracy.

    Long division taken apart

    When we divide, we are trying to find out how many times the divisor (e.g. 21) goes into the dividend (e.g. 1543).

    We could just repeatedly subtract, keeping a tally of the number of times we have subtracted, stopping when further subtraction would give a negative result.  At least, that is how we could do divmod division.

    Keeping such a tally would be tedious, however.  It is better to subtract large but convenient multiples of the divisor, than smaller multiples, keeping tally of these separately as we go.

    In our usual decimal system of numeration, powers of ten are particularly convenient multipliers.

    In 1543, the highest nonzero column is the thousands column.  We can therefore try subtracting thousands of `21`s.  We could not subtract `21` thousand even once from `1` thousand and anything without the result being negative.  So we need `0` thousands of `21`s, and we still have `1` thousand and something.

    Next, we try hundreds of `21`s.  Again, we cannot subtract even `21` hundreds even once from `15` hundred and something, without the result being negative.  So we need `0` hundreds of `21`s, and we still have `15` hundred and something.

    Next, we try tens of `21`s.  We can subtract `21` tens from `154` tens and something.  Indeed, we can subtract `7` times, a total of `147` tens, without getting negative result.  So now we have that `154` tens and `3` is the same as `7` lots of `21` tens, and then `7` tens and `3`.

    Next we try whole `21`s.  We can subtract `21` from `73` just `3` times without going negative.  This subtracts a total of `63` from `73`, leaving `10`.

    So now we have that `1543` is the same as `7` lots of `21` tens, and `3` lots of `21` ones, and a further `10`.

    This can instead be understood as `70` lots of `21`, and `3` lots of `21`, and `10` more.  This in turn is `73 xx 21` and `10`.  i.e.

    `\qquad\qquad\qquad 1543 = (73 xx 21) + 10.`

    If we are doing divmod division, we can stop :

    `\qquad\qquad\qquad 1543 -: 21 = 73" remainder "10.`

    But if, instead of a remainder, we want the quotient to have a fractional part expressed as a decimal, then we keep going.

    We have `10` that still needs to be divided by `21`.  So now we try subtracting tenths of `21`.  `10` is `100` tenths.  We can subtract `4` lots of tenths of `21`, i.e. `84` tenths, from `100` tenths, leaving `16` tenths.

    Next, we try subtracting hundredths of `21` from `160` hundredths.  `7` hundredths of `21` is `147` hundredths, which when subtracted from `160` hundredths leaves `13` hundredths.

    Stopping at this point, we find that

    `\qquad\qquad\qquad 1543 = (73.47 xx 21) + 0.13`,

    which we can write

    `\qquad\qquad\qquad 1543 -: 21 = 73.47" remainder "0.13`.

    The preceding discussion has been rather lengthy--such work is usually set out in a much more compressed format.  Unfortunately, long division seems to have been taught procedurally without adequate preparation, so that the elided computational form entrains elided thinking.  Even among the few in these calculator-infested days who can still actually do long division, a substantial fraction can give no convincing account of why the standard long division algorithm works.

    Building ad hoc multiplication tables

    Proportion tables are sometimes useful for doing long division. 

    For many people, the most difficult part of that standard long division algorithm is estimating which multiple of the divisor to subtract.  Jakow Trachtenberg taught a simple trick for avoiding this difficulty.

    In the next posting, we are going to divide 1543 by 21, using the standard long division algorithm and Trachtenberg's trick.

    The first step is to invest some time making a table of multiples of `21`, up to the `9 xx 21`.  The `0` and `1` rows are obvious :

    `\qquad\qquad\qquad[(0, 0),(1, 21)]`.

    The `2` row can be found by doubling the second row :

    `\qquad\qquad\qquad[(0, 0),(1, 21),(2,42)]`.

    The `3` row can be found by adding the `1` row and the `2` row :

    `\qquad\qquad\qquad[(0, 0),(1, 21),(2,42),(3,63)]`.

    The `4` row can be found either by adding the `1` row to the `3` row, or else by doubling the `2` row.  One picks whichever is more convenient :

    `\qquad\qquad\qquad[(0, 0),(1, 21),(2,42),(3,63),(4,84)]`.

    The `5` row can be found either by adding the `2` row and the `3` row, or else by adding the `1` row and the `5` row.  Again, one picks whichever is more convenient :

    `\qquad\qquad\qquad[(0, 0),(1, 21),(2,42),(3,63),(4,84),(5,105)]`.

    One continues in this way, constructing the next row opportunistically, until at last one has :

    `\qquad\qquad\qquad[(0, 0),(1, 21),(2,42),(3,63),(4,84),(5,105),(6,126),(7,147),(8,168),(9,189)]`.

    This can be checked by casting out nines, if one knows how to do that.  (If not, it needs to be the subject of yet another post.)

    Now we are ready divide anything by `21`.

    `\qquad\qquad\qquad[(0, 0,(0)),(1, 21,(3)),(2,42,(6)),(3,63,(0)),(4,84,(3)),(5,105,(6)),(6,126,(0)),(7,147,(3)),(8,168,(6)),(9,189,(0))]`.

    This checks out, so we can rely on the table we have made.

    Wednesday, February 24, 2010

    Egyptian division prolonged---fractions

    Last time, we used Egyptian division to find a whole number quotient and a remainder for the division `1543 -: 21`, in the process formed the table

    `\qquad\qquad\qquad[(1543, x),(21, 1),(168,8),(1344,64), (1533,73)]`.

    To calculate the fractional part in decimal form, we begin by subtracting the last row from the first, and append the result at the bottom:

    `\qquad\qquad\qquad[(1543, x),(21, 1),(168,8),(1344,64), (1533,73), (10, 10/21)]`.

    In practice, of course, don't actually subtract, but just write the remainder we have already found, and that same remainder divided by the divisor in fractional form in the next column.

    Now we take the divisor row, `[21, 1]`, halve it to get `[10.5, 0.5]`, and append at the bottom :

    `\qquad\qquad\qquad[(1543, x),(21, 1),(168,8),(1344,64), (1533,73), (10, 10/21),(10.5, 0.5)]`.

    We now continue, halving the bottom row and appending, halving the bottom row and appending, until the second number in the bottom row is comparable to the accuracy we require.  Suppose we want the fractional part of the quotient to be accurate to two decimal places, then :

    `\qquad\qquad\qquad[(1543, x),(21, 1),(168,8),(1344,64), (1533,73), (10, 10/21),(10.5, 0.5), (5.25, 0.25), (2.625, 0.125), (1.3125,0.0625), (0.65625,0.03125), (0.328125,0.015625), (0.1640625, 0.0078125)]`.

    We now make a sum as close as we can to the `10` in the target row `[10, 10/21]`, by adding together some of the rows below it.  `10.5` is larger than `10`, so we ignore that row.  `5.25` is smaller, so that row get used.  `10 - 5.25 = 4.75` left to account for. This is larger than `2.625`, so we use that row too, leaving `4.75 - 2.625 = 2.125` to account for.  Continuing, `2.125 - 1.3125 = 0.8125`; `0.8125 - 0.65625 = 0.15625`; skip `0.328125`.  For the last entry, we perform the subtraction, even though the result is negative, `0.15625 - 0.1640625 = -0.0078125`.  The reason is that it leaves an error `-0.0078125` that is smaller in magnitude than the error we would have without the subtraction, i.e. `0.1640625`. This gives us more accuracy than we expected.

    Deleting (or striking out) the rows to be ignored, we get :

    `\qquad\qquad\qquad [(1543, x),(21, 1),(168,8),(1344,64), (1533,73), (10, 10/21),(5.25, 0.25), (2.625, 0.125), (1.3125,0.0625), (0.65625,0.03125), (0.1640625, 0.0078125)]`.

    Adding the contributing rows, we get

    `5.25+2.625+1.3125+0.65625+0.1640625 = 10.0078125`,

    (or, easier, `10 - -0.0078125 = 10.0078125`) and

    `0.25+0.125+0.0625+0.03125+0.0078125 = 0.4765625`,

    so the table finally becomes

    `\qquad\qquad\qquad [(1543, x),(21, 1),(168,8),(1344,64), (1533,73), (10, 10/21),(5.25, 0.25), (2.625, 0.125), (1.3125,0.0625), (0.65625,0.03125), (0.1640625, 0.0078125),(10.0078125, 0.4765625)]`.

    Since `10.0078125` is within a tenth of a percent of `10`, we must have that `0.4765625` is within a tenth of a percent of `10/21`, i.e. `10/21 \approx 0.477`, this compares well with the accurate answer of `0.476190...`  i.e. we have almost three decimal places of accuracy.

    So `1543/71 \approx 73.477.`

    Although it makes relatively few demands in terms of times tables, and this part requires only that we know how to halve decimal quantities, one has to put in considerable labor for each decimal place.

    The method is much better adapted to binary fractions than to decimals.  These are sometimes useful, e.g. when one is working to sixteenths or thirty-seconds of an inch, say.  In binary fractions, the final table looks like this,

    `\qquad\qquad\qquad [(1543, x),(21, 1),(168,8),(1344,64), (1533,73), (10, 10/21),(5 1/4, 1/4), (2 5/8, 1/8), (1 5/16, 1/16), (21/32,1/32), (21/64, 1/64),(21/128, 1/128),(10 1/128, 61/128)]`,

    so that `1543/71 \approx 73 61/128.`

    Egyptian division and proportion tables

    Let us repeat the problem of the last posting, but solve it exactly using Egyptian division.  Egyptian division employs two columns of numbers that form a proportion table.  It does not require knowledge of times tables---knowing how to double suffices.  Nor does it require guess and check estimation of multiplies usually employed with the standard long division algorithm.  The disadvantage is that the calculation is roughly three times as long as for the standard algorithm. 

    We can start just as we did for approximate division in the last posting :

    `\qquad\qquad\qquad[(1543, x),(21, 1)]`.

    To this, double the last row and append, double the last row and append, continuing until the numbers at the bottom of the first column bracket `1543`, i.e. `1344 < 1543 < 2688` :

    `\qquad\qquad\qquad[(1543, x),(21, 1),(42,2),(84,4),(168,8),(336,16),(672,32),(1344,64),(2688,128)]`.

    Now we start add the bottom, succesively adding some rows but not others, trying to make `1543`.  `2688` is already too big, so we ignore it.  (In practice, we could usually forsee this and do not write that row in the first place.)  The next row up, led by `1344` is smaller than 1543, and contributes.

    `\qquad\qquad\qquad[(1543, x),(21, 1),(42,2),(84,4),(168,8),(336,16),(672,32),(1344,64)]`.

    The next row up, led by `1344` is smaller than `1543`, so that row contributes, as it always does. We still have `1543 - 1344 = 199` to account for.  `672` and `336` are both bigger than `199`, so those rows do not contribute, and can be ignored.  `168` is smaller, so it contributes, leaving `199 - 168 = 31` to account for. `84` and `42` are larger than `31`, so those rows do not contribute.  `21` is smaller, so that row contributes, and leaves a remainder is `31 - 21 = 10`.

    On paper, we would strike out the rows to be ignored: here we delete them all.

    `\qquad\qquad\qquad[(1543, x),(21, 1),(168,8),(1344,64)]`.

    Now, we append the sum of the bottom three rows :

    `\qquad\qquad\qquad[(1543, x),(21, 1),(168,8),(1344,64), (21+168+1344,1+8+64)] = [(1543, x),(21, 1),(168,8),(1344,64), (1533,73)]`.

    In practice, again, we would not perform the sum `21 + 168 + 1344 =1533`.  We do not need it, and even if we did, it is more readily calculated by subtracting the remainder from our original dividend, `1543 - 10 = 1533`.

    We do have to perform `1+8+64 = 73`, however, to get the quotient `73`.

    So we have, `1543 -: 21 = 73 " remainder "10`.

    So far, we have performed divmod division, i.e. found an integer quotient and a remainder.  (div and mod are two convenient computer arithmetic terms. div gives only the integer quotient, `1543 " div " 21 = 3`, while mod gives only the remainder,`1543 " mod " 21 = 10`.)

    Using wiggle notation, we can write :

    `\qquad\qquad1543 -: 21 = 73;_{21}10 = 73 10/21`.

    where now we are looking at the result as a mixed fraction.

    It is easy to extend Egyptian division so that it gives us a decimal fraction result to any desired degree of accuracy, as we shall see in the next post.

    Approximate division using a proportion table

    Suppose we are trying to get a roughly estimate of how many times `21` goes into `1543`.  i.e. we are looking to approximate `1543/21`.

    We can set this up as an incomplete proportion table :

    `\qquad\qquad\qquad[(1543, x),(21, 1)]`.

    Using the proportion table form of the Rule of Three, we can solve for `x` by multiplying the neighbors and dividing by the opposite corner :

    `\qquad\qquad\qquad x = \frac{1543 xx 1}{21}`,

    i.e., completing this proportion table correctly should indeed give us exactly the quantity we seek.  But we are not seeking an exact value, and are instead hoping to extract an approximate answer with less work.

    First, we multiply the last row by ten and append, and repeat this until the number at the top left of the table is bracketed by the first values on the two last rows, i.e. `210<1543<2100` :

    `\qquad\qquad\qquad[(1543, x),(21, 1),(210, 10),(2100, 100)]`.

    Since in the first column `210<1543<2100`, we can conclude from the second column that `10 < x < 100`.

    To sharpen this estimate a little, we can round `2100` to `2000` and `1543` to `1500`.  Now `1500` is three quarters of `2000`, so `x` is about three quarters of `100`, i.e. `1543/21` is roughly `75`.

    Extending a proportion table

    So far, we have rearranged proportion tables, we have deleted rows and/or columns, and we have cut proportion tables into smaller pieces.

    Now we want to make larger tables.

    One way to make a larger table is simply to duplicate a row,

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)] \qquad->\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(4, 8, 10, 18),(6, 12, 15, 27)] `.

    or a column,

    `\qquad\qquad [(2, 4, 5, 9, 5),(4, 8, 10, 18, 10),(6, 12, 15, 27, 15)] \qquad->\qquad [(2, 4, 5, 9, 5),(4, 8, 10, 18, 10),(6, 12, 15, 27, 15)] `.

    or both :

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)] \qquad->\qquad [(2, 4, 5, 9, 5),(4, 8, 10, 18, 10),(4, 8, 10, 18, 10),(6, 12, 15, 27, 15)] `

    Of course we can duplicate any row or column as many times as we like.  And we can do that to many distinct rows and many distinct columns.

    Another way to augment a proportion table is by appending a row that is a multiple of another row.   A multiple of one row is necessarily a multiple (usually by different multipliers) of every row :

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)] \qquad->\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27),(60, 120, 150, 270)] `.

    It should be clear that the result of appending a multiple row will always still be a proportion table, and mutatis mutandis for columns.

    One can always append a column that is a sum of two or more other columns (and mutatis mutandis for rows) :

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)] \qquad->\qquad [(2, 4, 5, 9, 5+9),(4, 8, 10, 18,10+18),(6, 12, 15, 27,15+27)] `,

    `\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad =  \qquad [(2, 4, 5, 9, 14),(4, 8, 10, 18, 28),(6, 12, 15, 27, 42)]`.

    More generally, the result of appending a sum or difference of existing  rows or of columns is another proportion table.

    In the last posting, we dealt with subtables and amalgamation.  Amalgamating two rows is equivalent to appending their sum, and deleting the original two rows, and similarly for amalgamating two columns. Any amalgamation whatever of a table (i.e. over a tartanlike decomposition) can be constructed by a suitably chosen succession of amalgamations of pairs of rows and pairs of columns.

    Suitable subtle subtables

    We can delete, or just simply ignore, arbitrary rows and columns of a given table.  The result is a subtable.  Any subtable of a proportion table is also a proportion table.  Here, we delete the third row, and the first and third columns, of a table to get a subtable :

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)] \qquad->\qquad [(4,  9),(8, 18)] `.

    In general, making a subtable is a lossy operation---there is less table when we are done.

    We can split a table into a complete, nonoverlapping collection of subtables.  For instance :

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27), (10, 20, 25, 45)] \qquad->\qquad{: ([(2, \qquad4),(4, \qquad8)]\qquad [(5, 9),(10, 18)]), ([(6, 12),(10, 20)]\qquad [(15, 27),(25, 45)]) :} `.

    The preceding patchwork of subtables was made by carving up the original table in an obvious way.  A nonoverlapping collection does not have to fit together like patchwork, however :

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27), (10, 20, 25, 45)] \qquad->\qquad{: ([(\quad2, 9),(10, 45)]\qquad [(4, 5),(20, 25)]), ([(\quad4, 18),(\quad6, 27)]\qquad [(8, 10),(12, 15)]) :} `.

    The subtables do not have to be square, or the same size, or deployed in a symmetrical pattern.  The most useful decompositions are those that are tartanlike, meaning that any split between cells belonging to distinct subtables goes all the way across the original table.

    The two preceding decompositions are tartanlike.  This one is not:

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27), (10, 20, 25, 45)] \qquad->\qquad{: ([(2, \qquad4,\qquad5, 9),(4, \qquad8,\qquad10, 18)]), ([(6, 12),(10, 20)]\qquad [(15, 27),(25, 45)]) :} `.

    We have arranged the subtables according to the position of its reference element---by convention its top left element---in the original table.  Using such a convention is no mere convenience, as we shall soon see.

    Tartanlike decompositions can be aggregated, by adding together the elements in each subtable :

    `\qquad\qquad\qquad{: ([(2, \qquad4),(4, \qquad8)]\qquad [(5, 9),(10, 18)]), ([(6, 12),(10, 20)]\qquad [(15, 27),(25, 45)]) :}\quad->\quad{: ([(),(\qquad18\qquad),()]\quad [(),(\qquad42\qquad),()]), ([(),(\qquad48\qquad),()]\quad [(),(\quad112\qquad),()]) :}`,

    where the result can also be written

    `\qquad\qquad\qquad[(18,42),(48,112)]`.

    Similarly,

    `\qquad\qquad\qquad{: ([(\quad2, 9),(10, 45)]\qquad [(4, 5),(20, 25)]), ([(\quad4, 18),(\quad6, 27)]\qquad [(8, 10),(12, 15)]) :}\quad->\quad[(66,54),(55,45)] `,

    where the convention we used before helps us keep the aggregated subtables in proportional relation.

    A table filled entirely with ones is a proportion table.  By aggregating such a table of suitable size, we can construct any proportion table whatever that has only positive integer elements.  For instance :

    `\qquad\qquad\qquad [(1,1,1,1,1,1),(1,1,1,1,1,1),(1,1,1,1,1,1),(1,1,1,1,1,1),(1,1,1,1,1,1),(1,1,1,1,1,1)]\quad->\quad[(1,2,3),(2,4,6),(3,6,9)],

    where an appropriate tartanlike decomposition that leads from the first of these tables to the second should be obvious.

    These three examples illustrate a general truth: aggregating a proportion table always gives another proportion table.

    Turning tables

    It is useful to have some operations that turn one proportion table into another.  In this posting, we deal with some operations that can be applied to many different kinds of table, not just proportion tables.

    Let's start with the simple operation of swapping (or transposing) two rows, here the second and the third :

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)] \qquad->\qquad [(2, 4, 5, 9),(6, 12, 15, 27),(4, 8, 10, 18)] `,

    or two columns, here the second and the fourth :

    `\qquad\qquad[(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)]  \qquad->\qquad [(2, 9, 5, 4),(4, 18, 10, 8),(6, 27, 15, 12)]`.

    Repeatedly transposing various pairs of rows can give every possible reordering (or permutation) of the rows :
     
    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)] \qquad->\qquad [(6, 12, 15, 27),(2, 4, 5, 9),(4, 8, 10, 18)] `,

    and similarly for arbitrary column permutations :

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)] \qquad->\qquad [(5, 9, 4, 2),(10, 18, 8, 4),(15, 27, 12, 6)] `.

    We can combine arbitrary row permutations and arbitrary column permutations to get arbitrary table permutations.  How the rows are reordered is independent of how the columns are reordered.  Combining the most recent row and column reorderings, we get :

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)] \qquad->\qquad [(15, 27, 12, 6),(5, 9, 4, 2),(10, 18, 8, 4)] `.

    All of the foregoing operations simply rearrange the proportion table to make a proportion table that contains exactly the same information.  When one can make table from another using only rearrangement, the tables are said to be equivalent up to rearrangment.  All of the tables in this posting are equivalent up to permutation---they are in a sense the same `3 xx 4` table, just displayed differently.

    Does this account for reliable ways to convert a proportion table to a proportion table?  In much later postings, when we deal with group tables and have more restrictions, the answer will be yes.

    Here, however, the answer is no---there are other possibilities.  One such possibility can be made by giving the table a quarter turn, e.g.

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)] \qquad->\qquad [(6, 4, 2),(12,8,4),(15,10,5),(27,18,9)] `.

    It should be clear that in the rotated version, rows are proportional to rows and columns to columns, as before, i.e. that the rotated version of the original proportion table is also a proportion table.  We could not have made the rotated version from permutations alone or the original, either, because permutations only ever turn a `3 xx 4` table into a `3 xx 4` table, never into a `4 xx 3` table, as this quarter turn has just done.

    Of course, this quarter-turned table can now be permuted to give many `4 xx 3` tables, all of which are equivalent up to permutation.  Indeed, there will be as many distinct `4 xx 3` tables are there are distinct `3 xx 4` tables.

    Does this exhaust all the possibilities?  What if one makes a quarter turn in the other direction?  It turns out that the two different ways of quarter-turning the original table lead to two tables that differ by a half turn,

    `\qquad\qquad\qquad  [(6, 4, 2),(12,8,4),(15,10,5),(27,18,9)] `,

    and

    `\qquad\qquad\qquad  [(9,18,27),(5,10,15),(4,8,12),(2, 4, 6)] `.

    Unlike a quarter turn, a half turn can be made just from permutations:  reverse the order of the rows, and reverse the order of the columns.  In this way, we get

    `\qquad\qquad\qquad  [(6, 4, 2),(12,8,4),(15,10,5),(27,18,9)] \qquad->\qquad [(9,18,27),(5,10,15),(4,8,12),(2, 4, 6)] `,

    and we also get

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)] \qquad->\qquad  [(27,15,12,6),(18,10,8,4),(9,5,4,2)] `.

    It should also be mentioned here that rotating by a quarter turn clockwise and reversing the order of the columns (or, alternatively, rotating a quarter of a turn anticlockwise and reversing the order of the rows) is often called transposing the table.

    Transposing a table is like flipping a rectangular piece of paper while keeping the original top left corner at the top and left, going from portrait orientation to landscape orientation, or vice versa :

    `\qquad\qquad [(2, 4, 5, 9),(4, 8, 10, 18),(6, 12, 15, 27)] \qquad->\qquad  [(2, 4, 6),(4,8,12),(5,10,15),(9,18,27)] `.
     
    Transposing in this sense is a little different from transposition as introduced above.  Transposition swaps a pair of rows, or else a pair of columns. Transposing, on the other hand turns all the columns to rows and all the rows to columns, in particular way.

    We shall actually have little use either for quarter turns or for transposing, while we are dealing with proportion tables.  Transposing become important when dealing with matrices, which come much later.

    Tuesday, February 23, 2010

    More about proportion tables

    Look again at the standard multiplication table :

    × 1 2 3 4 5 6 7 8 9 10
    1 1 2 3 4 5 6 7 8 9 10
    2 2 4 6 8 10 12 14 16 18 20
    3 3 6 9 12 15 18 21 24 27 30
    4 4 8 12 16 20 24 28 32 36 40
    5 5 10 15 20 25 30 35 40 45 50
    6 6 12 18 24 30 36 42 48 54 60
    7 7 14 21 28 35 42 49 56 63 70
    8 8 16 24 32 40 48 56 64 72 80
    9 9 18 27 36 45 54 63 72 81 90
    10 10 20 30 40 50 60 70 80 90 100

    By simply changing the '`xx`' to a `1` we have a proportion table.  The stubs no longer deserve special coloring because they have no special role.  This is generally true.  Any multiplication table can be converted to a proportion table in this way.

    Conversely, any '`1`' in a proportion table can be treated as if it is the '`xx`' symbol in a multiplication table.  So, for instance, Hutton gives his multiplication table, which he also says is called Pythagoras's table, in the following form, although his is `12 xx 12`.


    1 2 3 4 5 6 7 8 9 10
    2 4 6 8 10 12 14 16 18 20
    3 6 9 12 15 18 21 24 27 30
    4 8 12 16 20 24 28 32 36 40
    5 10 15 20 25 30 35 40 45 50
    6 12 18 24 30 36 42 48 54 60
    7 14 21 28 35 42 49 56 63 70
    8 16 24 32 40 48 56 64 72 80
    9 18 27 36 45 54 63 72 81 90
    10 20 30 40 50 60 70 80 90 100


    The '`1`' at the top left can serve as a multiplication sign.  This remains true for any '`1`' entry found in an arbitrary proportion table.

    `5` `8` `2` `1200` `14" hours"`
    `10" mph"` `16" mph"` `4" mph"` `2400" mph"` `28" miles"`
    `2 1/2` `4` `1` `600` `7" hours"`
    `22 1/2` `36` `9` `5400` `63" hours"`
    `250` `400` `100` `60000` `700" hours"`
    `20` `32` `8` `4800` `56" hours"`
    `5/6` `1 1/3` `1/3` `200` `2 1/3" hours"`

    It is readily apparent that the quantities directly below and directly to the right of the '`1`' serve as as stubs of a multiplication table, with the body of the table between these two arms, both below and to the right of the '`1`'. But the numbers directly above, and also directly to the left of the '`1`' can also serve as stubs. So, for instance, `8 xx 2 1/2 = 20`. On this view, here one has table bodies in all four quadrants.

    It is better, however, to think of entire row containing the '`1`' as a row stub, and the entire column containing the '`1`' as a column stub. Any value in the table has a marker value on the same row in the column stub, and a marker value in the same column in the row stub. The '`1`', the arbitrary value in the table, and the two marker values lie at the corners of a rectangular box.

    The four values

    `\qquad\qquad\qquad{:(2 1/2\qquad, 1),(20\qquad, 8):}`

    can be thought of as a `2 xx 2` subtable, with any value in this subtable equivalent to the product of its adjacent values divided by its diagonally opposite value :

    `\qquad\qquad\qquad 20 = \frac{8 xx 2 1/2}{1}`.

    In this form, we are using the proportion table version of the Rule of Three. Any `2 xx 2` subtable can serve in this way, and no '`1`' is required in the subtable, or indeed, anywhere in the proportion table :

    `5` `8` `2` `1200` `14" hours"`
    `10" mph"` `16" mph"` `4" mph"` `2400" mph"` `28" miles"`
    `2 1/2` `4` `1` `600` `7" hours"`
    `22 1/2` `36` `9` `5400` `63" hours"`
    `250` `400` `100` `60000` `700" hours"`
    `20` `32` `8` `4800` `56" hours"`
    `5/6` `1 1/3` `1/3` `200` `2 1/3" hours"`

    so that, e.g.

    `\qquad\qquad\qquad 4" mph" = \frac{28" miles " xx  ""8}{56" hours"}.`

    Here, we have used the top left entry of the subtable of the subtable as the target element, and we have continued to follow the convention of writing the same-row neighbor before the same column neighbor.

    But we could use of these three same elements to find the fourth.  e.g. if the top right element is our target element, we can write :

    `\qquad\qquad\qquad 28" miles" = \frac{4" mph  " xx" "56" hours"}{8}.`