R 1.18

The ancient Babylonians had an algorithm for determining the square root of a number a.

Start with an initial guess of a / 2. Then find the average of your guess g and a / g. That's your next guess. Repeat until two consecutive guesses are close enough.

Write pseudocode for this algorithm.

---

while (a/2 is not close to the average of g and a/g){
	change g; // what value?
	
}

while (a/2 is close to the average of g and a/g){
	stop;
}

---

  given a number a
  start with an initial guess g=a/2

  while (g^2 is not close enough( abs(a - g^2) < some number (e.g, 0.01) ) to original number)
        find the average of g and a/g

---
