Free preview
83 lessons
Mathematical Foundations for ML
Free preview
Mathematical Foundations for ML · 83 lessons
No surprise gaps
Actually remember it
Skip what you know
One subscription. All learning paths included.
Our content is best on a larger screen
Definition of absolute value
The absolute value of a number, written , measures how far is from zero on the number line - regardless of direction. Whether we move units to the left or units to the right, the distance is the same: . So and .
Because distance is never negative, for every value of .
The formal piecewise definition pins this down:
Definition
The absolute value of a number is
Gotcha
When is already negative, flips the sign and gives a positive result. For instance, if then . The minus sign in the definition simply removes any existing negative sign.
We can extend the distance idea beyond zero. The expression gives the distance between and on the number line. For example, , matching the units between and . The order does not matter: gives the same result.
Key Point
Three equivalent views of absolute value:
Evaluate and using the piecewise definition. Then compute when and interpret the result as a distance.
Solution
Evaluating :
Since , we use the second piece of the definition: . Substituting:
Evaluating :
Since , we use the first piece: . So:
Computing when :
Substituting :
Since , we apply :
The result confirms the distance interpretation: and are units apart on the number line.
Practice questions
4 questions
What is ?
Select the correct answer:
+ 3 more questions
Product and quotient rules
Absolute value interacts neatly with multiplication and division through two rules.
Definition
for any values and .
The absolute value of a product equals the product of the absolute values. It does not matter whether we take the absolute value before or after multiplying.
Definition
for any values and with .
The same idea works for division - take the absolute value of each part separately.
Gotcha
It is tempting to assume a similar rule holds for addition, but it does not. In general, . We will see the precise relationship between and later in this lesson.
Simplify and using the product and quotient rules.
Solution
Product rule:
Applying :
We can verify: , and .
Quotient rule:
Applying :
Again we can verify: , and .
Practice questions
4 questions
What is ?
Select the correct answer:
+ 3 more questions
The triangle inequality
We saw that is not equal to in general. The triangle inequality tells us the precise relationship: the left side is always less than or equal to the right.
Definition
For any values and :
In other words, the absolute value of a sum is at most the sum of the absolute values. The right-hand side acts as an upper bound on .
Key Point
To verify the triangle inequality for a particular pair, compute both sides and check .
The diagram gives both sides of the inequality a geometric meaning: is the total distance covered by the two steps, while is the distance from to the final position.
When the steps point the same way, no ground is retraced and the two sides agree. When they oppose, the second step retraces part of the first, so the final position is closer to than the total distance covered.
In terms of signs: equality holds exactly when and have the same sign (or either is zero), and opposite signs force strict inequality.
To verify the triangle inequality for a pair of values, compute and separately, then check the inequality holds.
Practice questions
4 questions
Let and . What are and ?
Select the correct answer:
+ 3 more questions