Pre-Calculus for Programmers

Algebra foundations: the toolkit calculus never reteaches

3 / 397
Contents

Contents

Pre-Calculus for Programmers

0 of 397 complete

9 min read

Absolute value is a distance, not a sign remover

A tolerance check on a machined part, and the one reading of $|a|$ that makes every rule about it easy to see.

A workshop cuts steel pins that are meant to be 50 millimetres long. A pin passes inspection if it is within 0.2 millimetres of that, too long or too short makes no difference. Here is the inspection loop.

Which pins pass?Python

Change tol to 0.05 and run it again. Two pins that passed now fail. Then set tol to 0 and see how many survive.

Look at what the test actually computes. It subtracts, throws away the sign, and compares. A pin at 49.8 and a pin at 50.2 get the same verdict, because they are the same distance from the target on opposite sides.

The definition

The absolute value of a real number aa, written ∣a∣|a|, is the distance from aa to 0 on the number line. Distance is never negative, so ∣a∣|a| is never negative. ∣7∣=7|7| = 7 and ∣−7∣=7|-7| = 7, because both numbers sit seven steps from zero.

Written as a rule with two cases, that is:

∣a∣  =  {aif a≥0−aif a<0|a| \;=\; \begin{cases} a & \text{if } a \ge 0 \\[2pt] -a & \text{if } a < 0 \end{cases}
The second line is the one people misread. When $a$ is negative, $-a$ is positive.

That second line deserves a sentence of its own. If a=−7a = -7, then −a-a means −(−7)-(-7), which is 77. The minus sign in the definition is not making anything negative; it is undoing a negative. So −a-a is not a negative quantity here, and reading it as one is the reason this definition looks wrong to people the first time they meet it.

The reading that makes everything else easy

Now the important step. The inspection loop did not compute ∣length∣|length|; it computed ∣length−50∣|length - 50|. In general, ∣a−b∣|a - b| is the distance between aa and bb on the number line. That is the reading to carry for the rest of your mathematical life.

Distance does not care which end you start from, so ∣a−b∣=∣b−a∣|a - b| = |b - a|. Check it: ∣3−10∣=∣−7∣=7|3 - 10| = |-7| = 7, and ∣10−3∣=∣7∣=7|10 - 3| = |7| = 7.

Distance from a fixed point
∣x−(2)∣at x=−1|x - (2)| \qquad \text{at } x = -1
-0.641.633.896.168.43-6-3036
tolerance line
Distance from aa to cc
3
Within tolerance? (1 means yes)
0

Drag c and watch the V slide sideways. The V is lowest exactly at x=cx = c, where the distance is zero. Drag d and read off the stretch of the line that stays under the dashed line: that stretch is [c−d,  c+d][c-d,\;c+d].

The picture is a V with its point at cc. Being within dd of cc means being in the part of the V below the dashed line, and that part is the interval from c−dc - d to c+dc + d. So the pin test ∣L−50∣≤0.2|L - 50| \le 0.2 is exactly the interval [49.8,50.2][49.8, 50.2], arrived at by reading, not by algebra.

The properties, and why each one holds

Five facts follow from the definition. None of them needs memorising if you keep hold of the distance picture.

PropertyCheck with numbersWhy
∣a∣≥0|a| \ge 0∣−4∣=4|-4| = 4a distance is never negative
∣−a∣=∣a∣|-a| = |a|∣−4∣=∣4∣=4|-4| = |4| = 4aa and −a-a sit the same distance either side of 0
∣ab∣=∣a∣ ∣b∣|ab| = |a|\,|b|∣(−3)(4)∣=12=3⋅4|(-3)(4)| = 12 = 3 \cdot 4sizes multiply; the signs only decide the sign, which is then discarded
∣ab∣=∣a∣∣b∣\left|\dfrac{a}{b}\right| = \dfrac{|a|}{|b|}∣−63∣=2=63\left|\dfrac{-6}{3}\right| = 2 = \dfrac{6}{3}same reason, for division
∣a∣2=a2|a|^{2} = a^{2}∣−5∣2=25=(−5)2|-5|^{2} = 25 = (-5)^{2}squaring destroys the sign anyway, so removing it first changes nothing
Properties of absolute value, with a numeric check for each.

There is a sixth fact that does more damage than any of those five when it is forgotten, and it is about square roots. The symbol x\sqrt{\phantom{x}} always returns the non-negative root, so 25=5\sqrt{25} = 5 and never −5-5. Feed it a square and see what comes back.

Does the square root of a square give you back what you started with?Python

Add −100-100 to the list and run it again. Which column ever disagrees with x itself, and for which values?

The middle column matches the last column every time, and matches xx only when xx is not negative. That is the rule:

a2  =  ∣a∣for every real a\sqrt{a^{2}} \;=\; |a| \qquad \text{for every real } a
Not $a$. Writing $\sqrt{a^{2}} = a$ is true only when you already know $a \ge 0$.

A worked example, every step

Write "xx is more than 3 away from −1-1" using absolute value, and then as intervals.

  1. The distance between xx and −1-1 is ∣x−(−1)∣|x - (-1)|, which tidies to ∣x+1∣|x + 1|, because subtracting a negative adds.
  2. "More than 3 away" makes the statement ∣x+1∣>3|x + 1| > 3.
  3. Read it on the line: the point −1-1 is the centre, and you must be further than 3 steps from it.
  4. Three steps to the right of −1-1 lands on 2; three steps to the left lands on −4-4.
  5. Further than that means beyond 2, or before −4-4, and neither endpoint itself counts because the distance there is exactly 3, not more than 3.
  6. So the answer is (−∞,−4)∪(2,∞)(-\infty, -4) \cup (2, \infty). Check one value: x=10x = 10 gives ∣11∣=11|11| = 11, which is more than 3, and 10 is indeed in the second piece.
Check yourself

For which values of xx is x2=x\sqrt{x^{2}} = x a true statement?

All lessons in Pre-Calculus for Programmers