When you iterate a series, eg
you can use several
different rearrangements to iterate. Some, however, come to a solution far
faster than others; notably in this case
takes about 64
goes while a more complicated series takes nearer 4 (it involved squaring
but my teacher took it in...)
I can see from drawing graphs that the closer a graph's gradient
is to y=x the slower the iteration. However, this is not
proportional but seems to go a little like a tan graph - suddenly
zooming to infinity close to 1.
( Why, please? And what exactly is the relationship?)
An iteration of a curve f(x) must also depend on f''(x) but the
relationship is not obvious. I realise it depends where you start
but I'm hoping there is something else. The two curves I
mentioned earlier didn't have hugely different gradients ( though
quite diff like 0.7ish,0.2ish) & I started at the same point
for both iterations.
Does anyone know anything to help or the answer?
Dear Alexandra,
Well, I can help with the first part of your question. I presume
by ``iteration'' you mean that we are solving the equation x =
f(x)
by choosing an initial value x0 and then calculating
x1 = f(x0 ), x2 =
f(x1 ), and so on until we're close enough to the
correct value of x.
Well, as you know we can draw a graph with the curves y = x and
y= f(x) on it and follow the iteration on this graph. I'm going
to assume we're close enough to the correct value of x that we
can treat f(x) as a straight line with gradient g. Then if the
error in x0 is dx0 , the error in
x1 will be g x dx0 . (The easiest way to
visualise this without drawing the graph is to imagine that f(x)
= g x x, and then it's obvious that the error in x will be
multiplied by g (which is less than 1) at each iteration.)
Now, what do we mean by the slowness of an iteration? One
possible definition is the number of iterations required to
reduce the error by a factor of N. We can calculate this number
of iterations (call it ni ) - it is the solution to
the equation
gn i = 1/N
So ni = (log N) / (-log g).
This isn't quite a tan curve (it's 1/log g) but it does go to
infinity at g = 1, as you mentioned.
> An iteration of a curve f(x) must also depend on f''(x) but
the
> relationship is not obvious. I realise it depends where
you
> start but I'm hoping there is something else. The two curves
I
> mentioned earlier didn't have hugely different gradients
(though
> quite diff like 0.7ish,0.2ish) & I started at the same
point for
> both iterations.
log 0.7 = -0.36
log 0.2 = -1.61.
This is a ratio of 4.5, so I don't know how you got a ratio of 16
between the numbers of iterations you required for your two
different methods. I suppose it is affected by f''(x), but I
don't know exactly how. Iterations are fastest when f'(x) = 0 at
the solution point (for example to calculate the square root of y
by iteration, you use x = 1/2 * (x + y/x)), but that doesn't seem
to apply in your case.
Eva.
Dear Eva,
Thank you very much for answering my question. When I used the
exact values the log ratio thing worked.
Alexandra
PS - I just saw a really stupid error in my original question;
please excuse!