15  Dimensions and units

Next time you’re at a family gathering with your 10-year-old cousin, give her the following math quiz.

  1. What’s 3 + 2?
  2. What’s 7 - 3?
  3. What’s 3 miles + 2 miles?
  4. What’s 3 miles + 2 kilometers?
  5. What’s 3 miles + 2 kilograms?

I don’t know your cousin, but I suspect she will have an easy time answering (a) and (b) correctly. As for (c), she might give the correct answer, “5 miles,” or just say “5.” If so, you will follow up with “5 what?” at which point she’ll respond, “miles.”

  1. is a bit harder. You might need to prompt her with the information that 1 kilometer is about 0.6 miles. Then, if she’s pretty smart, she’ll answer “4.2 miles.”

10-year-olds are pretty creative, so I’m not sure how she’ll answer (e). But if you ask your Ph.D. aunt, she’ll answer along the lines of “silly question,” or “there is no such thing.” That is true.

Consider these everyday quantities:

  1. 60 miles per hour: a typical speed for driving on a highway
  2. 2106 square feet: the in-bounds area for a court used for singles tennis.
  3. 355 cubic centimeters: the volume in a canned beverage (in the US).
  4. 2.5 gallons per minute: the US mandated maximum flow rate for water through a showerhead.
  5. 35 miles per gallon: a typical fuel economy for a small car in the US.
  6. 0.044 lbs per square foot: the body-mass index of Dwayne (“The Rock”) Johnson. In the more conventional units of kg per square meter, his BMI is 30.8.

How would you measure such things?

  1. We ordinarily use a speedometer to measure instantaneous car speed and police use a radar gun. But fundamentally, you measure the distance traveled and the time used and divide distance by time.
  2. Most people would rely on the internet for this information, but you would check your local court by measuring the width (27 feet is the standard) and the length of the court (78 feet). Multiply the two.
  3. Pour the beverage into a measuring cup and read off the volume. More geometrically, you could measure the circumference of the can (\(2 \pi r\)), square it (\(4 \pi^2 r^2\)), and divide by \(4 \pi\) to get the cross section area of the can. Then multiply that area by the height of the can.
  4. We don’t usually monitor water used in a shower. But if you need to, get a 5-gallon pail (the standard volume of the plastic pails used for so many purposes in construction), put it under the showerhead, and measure the time it takes to fill the pail. Divide the volume by the time.
  5. Record the mileage on the car’s odometer when you fill-up the car with gas. Drive. When you next get gas, measure the new odometer reading and the volume of gas you purchased. Divide the change in odometer reading by the gas volume. (In Europe, you would divide the gas volume by the change in odometer reading.)
  6. Weigh Dwayne. The scale is usually graduated in both pounds and kilograms: take your choice. Measure his height; the ruler-in-the-doorway method works well. Then divide his weight by the square of his height.

It makes sense to multiply and divide different types of quantities: feet, gallons, kilometers, kilograms, pounds, hours, etc. But you won’t ever see a quantity constructed by adding or subtracting miles and hours or gallons and square feet. You can square feet and cube centimeters, but can you take the square root of a gallon? Does it make sense to raise 2 to the power of 3 yards?

This chapter is about the mathematical structure of combining quantities; which kinds of mathematical operations are legitimate and which are not.

15.1 Mathematics of quantity

The first step in understanding the mathematics of quantity is to make an absolute distinction between two concepts that, in everyday life, are used interchangeably: dimension and unit.

Length is a dimension. Meters is a unit of length. We also measure length in microns, mm, cm, inches, feet, yards, kilometers, and miles, to say nothing of furlongs, fathoms, astronomical units (AU), and parsecs.

Time is a dimension. Seconds is a unit of time. We also measure time in micro-seconds, milliseconds, minutes, hours, days, weeks, months, years, decades, centuries, and millenia.

Mass is a dimension. Kilograms is a unit of mass.

Length, time, and mass are called fundamental dimensions. This is not because length is more important than area or volume. It is because you can construct area and volume by multiplying lengths together. This is evident when you consider units of area like square inches or cubic centimeters, but obscured in the names of units like acre, liter, gallon.

We use the notation L, T, and M to refer to the fundamental dimensions. Also useful are \(\Theta\) (“theta”) for temperature, S for money, and P for a count of organisms such as the population of the US or the size of a sheep herd.

The square brackets \([\) and \(]\) signify that we are looking at the dimension of the quantity inside the brackets. For instance,

  • [1 yard] = L
  • [1000 kg] = M
  • [3 years] = T
  • [10 \(\mu\) (microns)] = L.

Another example: the population of the US state Colorado is about 5.8 million people. The dimension of this quantity is P.

Application area 15.1 —Electrical current is another fundamental dimension.

{Application area 15.1 Electro-magnetism}

We will not have many examples involving electro-magnetism. But for those with an interest, note that electrical current is a fundamental dimension often denoted I. Combine I with other fundamental dimensions to produce the dimension of other quantities, for instance:

  • Voltage: M L2 T-3 I-1
  • Magnetic field; M T^{-2} I

15.2 Compound dimensions

There are other dimensions: volume, force, pressure, energy, torque, velocity, acceleration, and such. These are called compound dimensions because we represent them as combinations of the fundamental dimensions, L, T, and M. The notation for these combinations involves multiplication and division. For instance:

  • Volume is L \(\times\) L \(\times\) L \(=\) L\(^3\), as in “cubic centimeters”
  • Velocity is L/T, as in “miles per hour”
  • Force is M L/T\(^2\), which is obscure unless you remember Newton’s Second Law that \(\text{F} = \text{m}\,\text{a}\): “force equals mass times acceleration.” In terms of dimension, mass is M, acceleration is L/T\(^2\). Multiply the two together and you get the dimension “force.”

Multiplication and division are used to construct a compound dimension from the fundamental dimensions L, T, and M.

Addition and subtraction are never used to form a compound dimension.

Much of the work in understanding dimensions involves overcoming the looseness of everyday speech. Remember the weight scale graduated in pounds and kilograms. The unit kilograms is a way of measuring M, but the unit of pounds is a way of measuring force: M L/T\(^2\).

Weight is not the same as mass. This makes no sense to most people and does not matter in everyday life. It is only when you venture off the surface of the Earth that the difference shows up. The Mars rover Perseverance weighs 1000 kg on Earth. It was weightless for most of its journey to Mars. After landing on Mars, Perseverence weighed just 380 kg. But the rover’s mass didn’t change at all.

Another source of confusion carried over from everyday life is that sometimes we measure the same quantity using different dimensions. You can measure a volume by weighing water; a gallon of water weighs 8 pounds; a liter of water has a mass of 1 kg. Serious bakers measure flour by weight; a casual baker uses a measuring cup. We can measure water volume with length because water has a (more-or-less) constant mass density. But 8 pounds of gasoline is considerably more than a gallon. It turns out that the density of flour varies substantially depending on how it is packed, humidity, etc. This is why it matters whether you weigh flour for baking or measure it by volume. You can measure time by the swing of a pendulum. To measure the same time successfully with different pendula they need to have the same length, not the same mass.

A unit is a conventional amount of a quantity of a given dimension. All lengths are the same dimensionally, but they can be measured with different conventions: inches, yards, meters, … Units for the same dimension can all be converted unambiguously one into the other. A meter is the same quantity of length as 39.3701 inches, a mile is the same length as 1609.34 meters. Liters and gallons are both units of volume (L\(^3\)): a gallon is the same as 3.78541 liters.

You will hear it said that a kilogram is 2.2 pounds. That is not strictly true. A kilogram has dimension M and a pound has dimension ML/T\(^2\). Quantities with different dimensions cannot be “equal” or even legitimately compared to one another. Unless you bring something else into the game that physically changes the situation, for instance, gravity (dimension of acceleration due to gravity (dimension \(\text{L}/\text{T}^2\)). The weight of a kilogram on the surface of the Earth is 2.2 pounds because gravitational acceleration is (almost) the same everywhere on the surface of the Earth.

It is also potentially confusing that sometimes different dimensions are used to get at the same idea. For instance, the same car that gets 35 miles / gallon in the US (dimension \(\text{L}/\text{L}^3 = 1/\text{L}^2\)) will use 6.7 liters per 100 kilometers (\(\text{L}^3 / L = \text{L}^2\)) in Europe. Same car. Same fuel. Different conventions using different dimensions.

Keeping track of the various compound dimensions can be tricky. For many people, it is easier to keep track of the physical relationships involved and use that knowledge to put together the dimensions appropriately. Often, the relationship can be described using specific calculus operations, so knowing dimensions and units helps you use calculus successfully.

Easy compound dimensions that you likely already know:

  1. [Area] \(= \text{L}^2\). Some corresponding units to remind you: “square feet”, “square miles”, “square centimeters.”
  2. [Volume] \(= \text{L}^3\). Units to remind you: “cubic centimeters”, “cubic feet”, “cubic yards.” (What landscapers informally call a “yard,” for instance “10 yards of topsoil” should properly be called “10 cubic-yards of topsoil.”)
  3. [Velocity] \(= \text{L}/\text{T}\). Units: “miles per hour,” “inches per second.”
  4. [Momentum] \(= \text{M}\text{L}/\text{T}\). Units: “kilogram meters per second.”

Anticipating that you will return to this section for reference, we’ve also added some dimensions that can be understood through the relevant calculus operations.

  • [Acceleration] \(= \text{L}/\text{T}^2\). Units: “meters per second squared,” In calculus, acceleration is the derivative of velocity with respect to time, or, equivalently, the 2nd derivative of position with respect to time.
  • [Force] \(= \text{M}\, \text{L}/\text{T}^2\) In calculus: force is the derivative of momentum with respect to time.
  • [Energy] or [Work] \(= \text{M}\, \text{L}^2/\text{T}^2\) In calculus, energy is the integral of force with respect to length.
  • [Power] \(= \text{M}\, \text{L}^2/\text{T}^3\) In the language of calculus, power is the derivative of energy with respect to time.

Density sounds like a specific concept, but there are many different kinds of densities. These have in common that they are a ratio of a physical amount to a geometric extent:

  1. a physical amount: which might be mass, charge, people, etc.
  2. a geometric extent: which might be length, area, or volume.

Some examples:

  • “paper weight” is the mass per area, typically grams-per-square-meter
  • “charge density” is the amount of electrical charge, usually per area or volume
  • “lineal density of red blood cells” is the number of cells in a capillary divided by the length of the capillary. (Capillaries are narrow. Red blood cells go through one after the other.)
  • “population density” is people per area of ground.
Application area 15.3: A person as a unit

The theory of dimensions and units was developed for the physical sciences. Consequently, the fundamental dimensions are those of physics: length, mass, time, electrical current, and luminous intensity.

Since proper use of units is important even outside the physical sciences, it is helpful to recognize the dimension of several other kinds of quantity.

  • “people” / “passengers” / “customers” / “patients” / “cases” / “passenger deaths”: these are different different ways to refer to people. we will consider such quantities to have dimension P, for population.

  • “money”: Units are dollars (in many varieties: US, Canadian, Australian, New Zealand), euros, yuan (synonym: renminbi), yen, pounds (many varieties: UK, Egypt, Syria, Lebanon, Sudan, and South Sudan), pesos (many varieties), dinar, franc (Swiss, CFA), rand, riyal, rupee, won, and many others. Conversion rates depend on the situation and national policy, but we will consider money a dimension, denoted by S (from the name of the first coinage, the Mesopotamian Shekel).

Examples:

  • Passenger-miles is a standard unit of transport.
  • Passenger-miles-per-dollar is an appropriate unit of the economic efficiency of transport.
  • Passenger-deaths per million passenger-mile is one way to describe the risk of transport.

15.3 Arithmetic with dimensions

Recall the rules for arithmetic dimensioned quantities. We restate them briefly with the square-bracket notation for “the dimension of.” For instance, “the dimension of \(b\)” is written \([b]\). We also write \([1]\) to stand for the dimension of a pure number, that is, a quantity without dimension.

Table 15.1: Conditions under which functions can be applied to dimensionful quantitities. Note that \([a] = [b]\) means that the dimension of \(a\) and of \(b\) are the same. For instance, even though 1 mm and 500 miles are very different distances, [1 mm]\(=\)[500 miles]. Both [1 mm] and [500 miles] are dimension L. {#tbl-allowed-operations}
Operation Result Only if satisfies Metaphor
Multiplication \([a \times b] = [a] \times [b]\) anything goes promiscuous
Division \([a \div b] = [a] \div [b]\) anything goes promiscuous
Addition \([a + b] = [a]\) \([a] = [b]\) monogomous
Subtraction \([a - b] = [a]\) \([a] = [b]\) monogomous
Trigonometric \([\sin(a)] = [1]\) \([a] = [1]\) celibate
Exponential \([e^a] = [1]\) \([a] = [1]\) (of course, \([e] = [1]\)) celibate
Power-law \([b ^ a] = \underbrace{[b]\times[b]\times ...\times [b]}_{a\ \ \text{times}}\) \([a] = [1]\) with \(a\) an integer exponent celibate
Square root \([\sqrt{b}] = [c]\) \([b] = [c\times c]\) idiosyncratic
Cube root \([\sqrt[3]{b}] = [c]\) \([b] = [c \times c \times c]\) idiosyncratic
Bump \([\text{bump}(a)] = [1]\) \([a] = [1]\) celibate
Sigmoid \([\text{sigmoid}(a)] = [1]\) \([a] = [1]\) celibate

15.4 Example: Dimensional analysis

We want to relate the period (in T) of a pendulum to its length and mass. Acceleration (\(\text{L}\cdot \text{T}^{-2}\)) due to gravity also plays a role. For simplicity, we will assume that only the bob at the end of the pendulum cable or rod has mass.

The analysis strategy is to combine the four quantities we think play a role into one total quantity that is dimensionless. Since it is dimensionless, it can be constant regardless of the mass, length, period, or gravity of each situation.

\[\text{[Period]}^a \cdot \text{[Mass]}^b \cdot \text{[Length]}^c \cdot \text{[Gravity]}^d = T^a \cdot M^b \cdot L^c \cdot L^d \cdot T^{-2d} = [1]\] To be dimensionless:

  • \(c = -d\), cancel out the L
  • \(a = 2d\), cancel out the T
  • \(b=0\), there is no other mass term, and we need to cancel out the M

All of the exponents can be put in terms of \(d\). That does not tell us what \(d\) should be, but whatever value for \(d\) we decide to choose, we get a ratio that is equivalent to:

\[ \frac{[\text{Gravity}]\cdot [\text{Period}]^2}{[\text{Length}]} = [1]\]

This is a relationship between dimensions of quantities. To render it into a formula involving the quantities themselves we need to take into account the units.

\[ \frac{\text{Gravity}\cdot \text{Period}^2}{\text{Length}} = B\]

We can experimentally determine the numerical value of the dimensionless constant \(B\) by measuring the period and length of a pendulum and (on Earth) recognizing that gravitational acceleration on Earth’s surface is 9.8 meters-per-second-squared. Such experiments and mathematical models using differential equations give \(B = (2\pi)^2\).

15.5 Conversion: Flavors of 1

Numbers are dimensionless but not necessarily unitless. Failure to accept this distinction is one of the prime reasons people have trouble figuring out how to convert from one unit to another.

The number one is a favorite of elementary school students because its multiplication and division tables are completely simple. Anything times one, or anything divided by one, is simply that thing. Addition and subtraction are pretty simple, too, a matter of counting up or down.

When it comes to quantities, there is not just one one but many. And often they look nothing like the numeral 1. Some examples of 1 as a quantity:

  • \(\frac{180}{\pi} \frac{\text{degrees}}{\text{radians}}\)

  • \(0.621371 \frac{\text{mile}}{\text{kilometer}}\)

  • \(3.78541 \frac{\text{liter}}{\text{gallon}}\)

  • \(\frac{9}{5} \frac{^\circ F}{^\circ C}\)

  • \(\frac{1}{12} \frac{\text{dozen}}{\text{item}}\)

I like to call these and others different flavors of one.

In every one of the above examples, the dimension of the numerator matches the dimension of the denominator. The same is true when comparing feet and meters ([feet / meter] is L/L = [1]), or comparing cups and pints ([cups / pint] is \(\text{L}^3/\text{L}^3 = [1]\)) or comparing miles per hour and feet per second ([miles/hour / ft per sec] = L/T / L/T = [1]). Each of these quantities has units but it has no dimension.

It is helpful to think about conversion between units as a matter of multiplying by the appropriate flavor of 1. Such conversion will not change the dimension of the quantity but will render it in new units.

Try it! 15.1: fps to mph

Example: Convert 100 feet-per-second into miles-per-hour. First, write the quantity to be converted as a fraction and alongside it, write the desired units after the conversion. In this case that will be \[100 \frac{\text{feet}}{\text{second}} \ \ \ \text{into} \ \ \ \frac{\text{miles}}{\text{hour}}\]

First, we will change feet into miles. This can be accomplished by multiplying by the flavor of one that has units miles-per-foot. Second, we will change seconds into hours. Again, a flavor of 1 is involved.

What number will give a flavor of one? One mile is 5280 feet, so \[\frac{1}{5280} \frac{\text{miles}}{\text{foot}}\] is a flavor of one.

Next, we need a flavor of one that will turn \(\frac{1}{\text{second}}\) into \(\frac{\text{1}}{\text{hour}}\). We can make use of a minute being 60 seconds, and an hour being 60 minutes. \[\underbrace{\frac{60\ \text{s}}{\text{minute}}}_\text{flavor of 1}\ \underbrace{\frac{60\ \text{minutes}}{\text{hour}}}_\text{flavor of 1} = \underbrace{3600\frac{\text{s}}{ \text{hour}}}_\text{flavor of 1}\]

Multiplying our carefully selected flavors of one by the initial quantity, we get \[ \underbrace{\frac{1}{5280} \frac{\text{mile}}{\text{foot}}}_\text{flavor of 1} \times \underbrace{3600 \frac{\text{s}}{\text{hour}}}_\text{flavor of 1} \times \underbrace{100 \frac{\text{feet}}{\text{s}}}_\text{original quantity} = 100 \frac{3600}{5280} \frac{\text{miles}}{\text{hour}} = 68.18 \frac{\text{miles}}{\text{hour}}\]

15.6 Dimensions and linear combinations

Low-order polynomials are a useful way of constructing model functions. For instance, suppose we want a model of the yield of corn in a field per inch of rain over the growing season, will call it corn(rain). The output will have units of bushels (of corn). The input will have units of inches (of rain). A second-order polynomial will be appropriate for reasons to be discussed in Chapter 24.

\[\text{corn(rain)} \equiv a_0 + a_1\, \text{rain} + \frac{1}{2} a_2\, \text{rain}^2\] Of course, the addition in the linear combination will only make sense if all three terms \(a_0\), \(a_1\,\text{rain}\), and \(\frac{1}{2}\, a_2\, \text{rain}^2/2\) have the same dimension. But \([\text{rain}] \neq [\text{rain}^2]\). In order for things to work out, the coefficients must themselves have dimension. We know the output of the function will have dimension \([\text{volume}] = \text{L}^3\). Thus, \([a_0] = \text{L}^3\).

\([a_1]\) must be different, because it has to combine with the \([\text{rain}] = \text{L}\) and produce \(\text{L}^3\). Thus, \([a_1] = \text{L}^2\).

Finally, \([a_2] = \text{L}\). Multiplying that by \([\text{rain}]^2\) will give the required \(\text{L}^3\)

Think in degrees, compute in radians

In everyday communication as well as in most domains such as construction, geography, navigation, and astronomy we measure angles in degrees. 90 degrees is a right angle. But in mathematics, the unit of angle is radians where a right angle is 1.5708 radians. (1.5708 is the decimal version of \(\pi/2\).) The conversion function, which we will call raddeg(), is \[\text{raddeg}(r) \equiv \frac{180}{\pi} r\] The function that converts degrees to radians, which we will call degrad() is very similar: \[\text{degrad}(d) \equiv \frac{\pi}{180} d\] (Incidentally, \(\frac{180}{\pi} = 57.296\) while \(\frac{\pi}{180} = 0.017453\).)

In traditional notation, the trigonometric functions such as \(\sin()\) and \(\tan()\) can be written with an argument either in degrees or radians. For instance, \(\sin(90^\circ) = \sin\left(\frac{\pi}{2}\right)\). Similarly, for the inverse functions like \(\arccos()\) the units of the output are not specified. This works because there is always a human to intervene between the written expression and the eventual computation.

In R, as in many other computer languages, there an expression like sin(90 deg) generates an error. In these languages, 90 deg is not a valid expression (although it might be good if it were valid!). In these and many other languages, angles are always given in radians. Such consistency is admirable, but people are not always so consistent. It is a common source of computer bugs that angles in degrees are handed off to functions like \(\sin()\) and that the output of \(\arccos()\) is (wrongly) interpreted as degrees rather than radians.

Function composition to the rescue!

Consider this function given in the Wikipedia article on the position of the sun as seen from Earth.1 \[\delta_\odot(n) \equiv - 23.44^\circ \cdot \cos \left [ \frac{360^\circ}{365\, \text{days}} \cdot \left ( n + 10 \right ) \right ]\] Where \(n\) is zero at the midnight marking New Years and increases by 1 per day. (The \(n+10\) has units of days and translates New Years back 10 days, to the day of the winter solstice.) \(\delta_\odot()\) gives the declination of the sun: the latitude pieced by an imagined line connecting the centers of the earth and the sun.

The Wikipedia formula is well written in that it uses some familiar numbers to help the reader see where the formula comes from. 365 is recognizably the length of the year in days. \(360^\circ\) is the angle traversed when making a full cycle around a circle. \(23.44^\circ\) is less familiar, but the student of geography might recognize it as the latitude of the Tropic of Cancer, the latitude farthest north where the sun is directly overhead at noon (on the day of the summer solstice).

But there is a world of trouble for the programmer who implements the formula as

dec_sun <- makeFun(-23.44 * cos((360/365)*(n+10)) ~ n)

For instance, the equinoxes are around March 21 (n=81) and Sept 21 (n=264). On an equinox, the declination of the sun is zero degrees. But let’s plug \(n=81\) and \(n=264\) into the formula and see what we get.

dec_sun(81)
## [1] 5.070321
dec_sun(264)
## [1] -23.38324

The equinoxes aren’t even equal! And they are not close to zero. Does this mean astronomy is wrong?

The Wikipedia formula should have been programmed this way, using 2 \(\pi\) radians instead of 360 degrees in the argument to the cosine function:

dec_sun_right <- 
  makeFun(-23.44 * cos(( 2*pi/365)*(n+10)) ~ n)
dec_sun_right(81)
## [1] -0.1008749
dec_sun_right(264)
## [1] -0.1008749

The deviation of one-tenth of a degree reflects rounding off the time of the equinox to the nearest day.


  1. Article accessed on May 30, 2021↩︎