Multiple choice

What does the following algorithm approximate? (Assume m > 1, Î > 0) x = m; y - i; while (x - y > Î) { x = (x + y) / 2;
y = m/x ; } print (x);

  1. log m

  2. m2

  3. m1/2

  4. m1/3

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

This is the Babylonian method (or Heron's method) for calculating the square root of a number m. The sequence x_n+1 = (x_n + m/x_n) / 2 converges to sqrt(m).