Given that f(q) = q/|q|, and q is a non-zero real number, the value of [f(f(q)) - f(-q)] is A. 0 B. -1 C. 1 D. 2 or -2

GATE 2011 · General Aptitude · Absolute Value · medium

Answer: The value is 2 when q > 0 and -2 when q < 0, so the expression equals 2 or -2. Answer: D.

  1. Evaluate f(f(q)): Since f(q) = +1 when q > 0 and f(q) = -1 when q < 0, the output of f is always a nonzero real with |f(q)| = 1. Applying f again: f(f(q)) = f(q)/|f(q)| = f(q)/1 = f(q). So f(f(q)) = f(q).
  2. Evaluate f(-q): Since |-q| = |q| for all q, we have f(-q) = (-q)/|q| = -(q/|q|) = -f(q). The sign function is odd.
  3. Compute the expression f(f(q)) - f(-q): Substituting the results: f(f(q)) - f(-q) = f(q) - (-f(q)) = f(q) + f(q) = 2*f(q). When q > 0, f(q) = 1 so the expression = 2. When q < 0, f(q) = -1 so the expression = -2.