The function $f(x) = |x|$ can be expressed piecewise as:
A$f(x) = x$ for all $x$
B$f(x) = x$ if $x \ge 0$; $f(x) = -x$ if $x < 0$
C$f(x) = -x$ for all $x$
D$f(x) = x^{2}$
Answer & Solution
Correct answer: B. $f(x) = x$ if $x \ge 0$; $f(x) = -x$ if $x < 0$
The modulus function returns the non-negative part. For $x \ge 0$, $|x| = x$. For $x < 0$, $|x| = -x$ (flipping the sign makes it positive).
Related questions
Odd man out: APPLE, MANGO, BANANA, POTATOIn a series 2, 3, 5, 7, 11, 13, ?, the next prime isIf A=1, B=2, C=3, ..., the value of PEN isOdd man out: 9, 16, 24, 36, 49, 64Find next: 1, 3, 6, 10, 15, ?Find next term: 8, 27, 64, 125, ?If the code for TEACHER is VGCEJGT, the code for STUDENT will beFind the missing term: 5, 9, 17, 33, 65, ?