Primary Mathematics/Unit expressions

Unit math
Until now, most of the numbers we've used have been scalar (unitless). However, in the real world, most numbers have units associated with them. There are special rules which apply when doing math on numbers with units.

Addition and subtraction
The following rules apply:


 * If the units are the same, add or subtract normally.


 * If the units are different, then:


 * If they can be converted to the same units, then addition and subtraction can occur.


 * If they can't be converted to the same units, then addition and subtraction are not possible.

Examples
4 apples + 3 apples = 7 apples 4 apples - 3 apples = 1 apple

In the following case, we try adding apples and oranges, but encounter a roadblock: 4 apples + 3 oranges = ?

These two items cannot be directly added together. However, depending on the context, it may be possible to convert them into "pieces of fruit" and add them. The result would look like this: 4 pieces of fruit + 3 pieces of fruit = 7 pieces of fruit

While the same may apply to subtraction, it is highly dependent on context (for example, the problem may be solvable if you treat it as receiving 4 pieces of fruit and giving 3 pieces of fruit in exchange.).

More commonly, you will encounter situations where you use standard unit conversion (e.g. 1 foot = 12 inches):

1 foot + 3 inches = 12 inches + 3 inches = 15 inches

A complex example where unit conversion is required:

60 MPH - 30 fps = 60 miles/hr - 30 ft/sec = (60 miles × 5280 ft/ mile )/(1 hr × 3600 sec/ hr ) - 30 ft/sec = 316,800 ft / 3600 sec - 30 ft/sec = 88 ft/sec - 30 ft/sec = 58 ft/sec

This method is called unit cancellation, and is quite useful is science and engineering.

Here is an example where it isn't possible to convert to the same units:

4 apples + 3 degrees = ?

Multiplication and division
When multiplying or dividing numbers with units, the units are also multiplied or divided.

Examples
Here's are examples using the same base units:

2 feet × 3 feet = 6 square feet = 6 ft² 6 square feet / 2 feet = 3 feet 2 meters × 3 meters × 4 meters = 24 cubic meters = 24 m³ 24 m³ / 2 m = 12 m²

Here are examples using different base units:

2 feet × 3 pounds = 6 foot pounds (a unit of torque) 100 miles / 2 hours = 50 miles/hr = 50 MPH 60 pounds / 4 square inches = 15 pounds/square inch = 15 PSI 200 miles / 10 MPH = 200 miles / (10 miles/hr) = 200 miles × (1 hr / 10 miles ) = 20 hrs

It is also possible to multiply or divide a number with units by a scalar (a unitless number):

3 apples × 2 = 6 apples 3 apples / 2 = 1.5 apples

So, two groups of 3 apples each gives us 6 apples, while 3 apples divided into 2 equal groups gives us 1.5 apples per group.

Powers, roots, and exponents
Just like multiplication or division, the operation also applies to the units.

Examples
(2 ft)³ = 2³ ft³ = 8 ft³ = 8 cubic ft

(100 miles²)½ = 10 miles

So, in the first case we calculated that a cube 2 feet long on each side has a volume of 8 cubic feet, while in the second case we calculated that a square plot of 100 square miles of land would be 10 miles long on each side.

To distinguish between feet, square feet, and cubic feet, the term "linear feet" is sometimes used to clarify that we are talking about regular feet, not square or cubic feet.

Unit conversion
Sometimes it is necessary to do a unit conversion by itself. The unit cancellation method shown previously can be applied to convert from any unit to any other compatible units.

Examples
Convert 10 miles per day to inches per second:

(5280 ft/ mile ) × 10 miles /day = 52,800 ft/day (12 inches/ ft ) × 52800 ft /day = 633,600 inch/day 633,600 inch/ day × (1 day /24 hr) = 26,400 inch/hr 26,400 inch/ hr × (1 hr /60 min) = 440 inch/min 440 inch/ min × (1 min /60 sec) = 7.33333 inch/sec