Absolute Value, Distance & Intervals

Start from zero — the basic math you need before everything else

Absolute value is a distance. Not a distance from anywhere in particular, but a distance from zero, and a distance can never be negative. Walk 6 steps left or 6 steps right and either way you've walked 6 steps. That's the whole idea behind a symbol like |−6|: strip away the direction and keep only how far you went.

Picture a canal towpath with mileposts along the edge. Walk from milepost 2 to milepost 7 and you cover 5 miles. Walk back the other way and it's still 5 miles: the direction changed, the distance didn't. Further along the same towpath, a pair of lock gates marks off one stretch of water, and each gate is either part of that stretch or just outside it, which is exactly how the two ends of an interval work. Try dragging the two points below. Watch the distance between them, and see how opening or closing each end changes both the shaded stretch and the notation underneath it.

For a positive number, or for zero, absolute value does nothing at all. It just hands the number straight back. For a negative number it flips the sign, because that's exactly what turns "6 steps to the left" into a plain count of 6 steps. The two bars around a number are not brackets. They don't mean "delete what's inside". They mean "measure how far this is from zero".

Where this lives in MLAbsolute error uses the same distance idea: |prediction − target|. Stack that up across every component of a vector and you get the L1 norm, which is exactly this lesson's absolute value, just applied many times over. Intervals show up as valid parameter ranges, clipping limits, and confidence ranges: anywhere a value is only allowed to live between two bounds. The centre-and-radius view of |x −…
▶ Absolute Value, Distance & Intervals
← InequalitiesThe Coordinate Plane →