Skip to main content.

Solution to puzzle 160: Absolute maximum

Skip restatement of puzzle.The absolute value of a real number is defined as its numerical value without regard for sign.  So, for example, abs(2) = abs(−2) = 2.

The maximum of two real numbers is defined as the numerically bigger of the two.  For example, max(2, −3) = max(2, 2) = 2.


  1. abs in terms of max
  2. max in terms of abs

  1. By inspection, abs(x) = max(x, −x).
  2. To express max(x, y) in terms of abs function(s), consider x and y positioned on the real number line.
    The midpoint of the line is ½(x + y).
    To obtain max(x, y), we then need to add half the length of the line segment connecting x and y; that is, we must add ½(abs(x − y)).
    Hence max(x, y) = ½(x + y + abs(x − y)).

Source: Puzzle: an absolute reader maximum conundrum

Back to top