1

I'm given the equation: $$3x-5=0$$ I can rewrite it as: $$(2+1)x-5=0 \implies x=-\frac{1}{2}x+\frac{5}{2}$$ The obvious root is $\bar{x}=\frac{5}{3}$ and I can define $g(x)=-\frac{1}{2}x+\frac{5}{2}$. Therefore: $$\bar{x}=-\frac{1}{2}\bar{x}+\frac{5}{2}=g(\bar{x})$$ The latter means that $\bar{x}$ is a fixed point for $g$.

I can define an iterative method. Let $x_0=0$ be the starting point: $$x_{n+1}=-\frac{1}{2}x_n+\frac{5}{2}=g(x_n)$$ I have used Python to calculate each value of the sequence:

[0, 2.5, 1.25, 1.875, 1.5625, 1.71875, 1.640625, 1.6796875, 1.66015625, 1.669921875, 1.6650390625, 1.66748046875, 1.666259765625, 1.6668701171875, 1.66656494140625, 1.666717529296875, 1.6666412353515625, 1.6666793823242188, 1.6666603088378906, 1.6666698455810547, 1.6666650772094727, 1.6666674613952637, 1.6666662693023682, 1.666666865348816, 1.666666567325592, 1.666666716337204, 1.666666641831398, 1.666666679084301, 1.6666666604578495, 1.6666666697710752, 1.6666666651144624, 1.6666666674427688, 1.6666666662786156, 1.6666666668606922, 1.666666666569654, 1.666666666715173, 1.6666666666424135, 1.6666666666787933, 1.6666666666606034, 1.6666666666696983, 1.6666666666651508, 1.6666666666674246, 1.6666666666662877, 1.6666666666668561, 1.666666666666572, 1.666666666666714, 1.666666666666643, 1.6666666666666785, 1.6666666666666607, 1.6666666666666696, 1.6666666666666652, 1.6666666666666674, 1.6666666666666663, 1.666666666666667, 1.6666666666666665, 1.6666666666666667]

If I want to represent the values in a graph I can use the latter as the x-axis and the following as the y-axis (because $x_{n+1}=g(x_n)$):

[2.5, 1.25, 1.875, 1.5625, 1.71875, 1.640625, 1.6796875, 1.66015625, 1.669921875, 1.6650390625, 1.66748046875, 1.666259765625, 1.6668701171875, 1.66656494140625, 1.666717529296875, 1.6666412353515625, 1.6666793823242188, 1.6666603088378906, 1.6666698455810547, 1.6666650772094727, 1.6666674613952637, 1.6666662693023682, 1.666666865348816, 1.666666567325592, 1.666666716337204, 1.666666641831398, 1.666666679084301, 1.6666666604578495, 1.6666666697710752, 1.6666666651144624, 1.6666666674427688, 1.6666666662786156, 1.6666666668606922, 1.666666666569654, 1.666666666715173, 1.6666666666424135, 1.6666666666787933, 1.6666666666606034, 1.6666666666696983, 1.6666666666651508, 1.6666666666674246, 1.6666666666662877, 1.6666666666668561, 1.666666666666572, 1.666666666666714, 1.666666666666643, 1.6666666666666785, 1.6666666666666607, 1.6666666666666696, 1.6666666666666652, 1.6666666666666674, 1.6666666666666663, 1.666666666666667, 1.6666666666666665, 1.6666666666666667, 1.6666666666666667]

In this last set I've only removed the initial $0$ and I've duplicated the last value because $g(\bar{x})=\bar{x}$.

I expect $g(x)$ to be a straight line and indeed this is what I get in Python. enter image description here

But shouldn't it be an horizontal line since the last two points (1.6666666666666665, 1.6666666666666667) have the same value (1.6666666666666667, 1.6666666666666667)?

The blue line is obtained by joining all the points. Since the two last points are very small and very near to each other, you can't see any difference in the graph. The scattered graph looks like this: enter image description here

I've tried to zoom in but the values are so too small to appreciate a difference.

I'm probably doing something wrong but I can't see what.

EDIT 29/12/2019

The last two iterations of the iterative method should be: $$...$$ $$x_{n-1}=g(x_{n-2})$$ $$x_n=\bar{x}=g(x_{n-1})$$ Then I can calculate: $$g(x_n)=g(\bar{x})=\bar{x}$$ because $\bar{x}$ is a fixed point for $g$. Now $x_{n-1}$ and $x_n$ are two different but very small and very near points in which the function has the same value. So zoomed in it would look like:

enter image description here

And those two points alone should draw an horizontal line.

zcb
  • 53

1 Answers1

1

There's nothing wrong with what you have done.

$y=g(x)$ is a straight line of gradient $-\frac{1}{2}$ as shown by your diagram. The final point is the point where$y=g(x)$ and $y=x$ meet, again as shown by your diagram.

  • But the second last point should have the same value as the last. I have edited the question to better explain what I mean. – zcb Dec 29 '19 at 10:09
  • 1
    The numbers are of course converging to $\frac{5}{3}$ and I am sure that the issue here is simply one of rounding errors as ths fraction is approximated by decimals. –  Dec 29 '19 at 10:30
  • I don't think it is a rounding error. If we use decimal we have $g(x_{n-1})=\frac{5}{3}$. So $\frac{5}{3}$ is both the value of the function in $x_{n-1}$ and the next and final point of the sequence. And if again we calculate the value of the function in $\frac{5}{3}$ we get $\frac{5}{3}$ because it is a fixed point. – zcb Dec 29 '19 at 14:13