Here is my riddle of the day for you. Explain why the following piece of Matlab code returns the following
Here is the piece of code:
for i = 1 : 100000
x = (x+y)/2;
y = 2*tmp*y/(tmp+y);
Also, generalize the above example and realize that the above gives you a numerical procedure to find the geometric mean of two numbers.