Re: How to examine x=(x+a)/b
- To: mathgroup at smc.vnet.net
- Subject: [mg40913] Re: [mg40900] How to examine x=(x+a)/b
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Thu, 24 Apr 2003 05:24:39 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Well, I am in general against this forum being used for homework solving, but this particular case is a little more interesting than most requests of this kind, since one can actually make reasonable use of Mathematica in dealing with it. Presumably what you are talking about is iterating the function x - > (x+a)/b , starting with some particular value of x, say c. This will have a genuine fixed point only if you start with c equal to Simplify[x /. First[Solve[x == (x + a)/b, x]]] a/(-1 + b) For example, if b =5 and a=2, then applying the function x -> (x+2)/5 to 1/2 gives you 1/2, applying it again gives you again 1/2 etc. If on the other hand you start with the same function but another value, say 100, then you will never get an actual fixed point, but your values will converge to 0.5, which you can see by looking at: FixedPoint[N[(#+2)/5]&,100] 0.5 The use of FixedPoint here must be correctly understood: it is simply the result of the fact that beyond a certain iteration Mathematica can no longer distinguish between successive values, which are in fact always different. In other words, you do not have a fixed point but a limit. Note that if you do this without N your computation will never stop! If, on the other hand, you take a function with b<1 and a !=0, you won't get an unbounded function and thus not convergence unless your starting value is again a/(-1 + b) For example, FixedPoint[N[(#1 + 5)/(1/2)] & , 100, 50] 1.2384898975268864*^17 a pretty large number. All this is pretty easy to prove, so I shall leave it to you. In fact one can use Mathematica to approach this in a somewhat different way, without needing to use N. Load in the package: << "DiscreteMath`RSolve`" and solve the recurrence relation: x[n] /. RSolve[x[n + 1] == (x[n] + a)/b, x[n], n][[1]] (a*(-1 + b^n) + (-1 + b)*C[1])/(b^n*(-1 + b)) here C[1] is the value you start the iteration with, and you have an explicit formula for the value of the function after n iterations. You can now easily see that if b>1, then as n gets large b^n ->0, and the successive iterations tend to a/(-1 + b), while with b<1 you get divergence, unless your starting point is a/(-1 + b). Andrzej Kozlowski Yokohama, Japan http://www.mimuw.edu.pl/~akoz/ http://platon.c.u-tokyo.ac.jp/andrzej/ On Wednesday, April 23, 2003, at 06:17 pm, Andy wrote: > Hi > > I have been asked to examine the following as part of some homework. > > x=(x+a)/b > > I know the calculation repeats its self and reaches a point where the > input and output numbers are the same, however, i cant explain why and > how. > > Any help or guidance would be appreciated. > > > >