f=: 4 : '108-(815-1500%y)%x'
g=: 3 : 'if. y e. 0 1 do. y{4 4.25 else. (g y-1) f g y-2 end.'
h=: 3 : 'if. y e. 0 1 do. y{4 17r4 else. (h y-1) f h y-2 end.'
g uses floating point and the analoguous h uses
rational numbers. Thus:
0j18 ": (g ,. h)"0 i.20
4.000000000000000000 4.000000000000000000
4.250000000000000000 4.250000000000000000
4.470588235294116000 4.470588235294117800
4.644736842105217500 4.644736842105262800
4.770538243625082900 4.770538243626061700
4.855700712568562900 4.855700712589073700
4.910847498660629600 4.910847499082793300
4.945537395530507800 4.945537404123916400
4.966962408040998900 4.966962581762701700
4.980042204293013700 4.980045701355631000
4.987909232795786400 4.987979448478392400
4.991362641314552200 4.992770288062068600
4.967455095552267600 4.995655891506634000
4.429690498308829700 4.997391268381343300
_7.817236578459315400 4.998433943944816900
168.939167671064580000 4.999060071970892400
102.039963152059270000 4.999435937146839300
100.099947516249700000 4.999661524103767200
100.004992040972440000 4.999796900713417500
100.000249579237310000 4.999878135477930900
In J6.02x, with M. used in the definition of h
to exploit memoization, I get:
0j40 ": h"0 ,.20*i.15
4.0000000000000000000000000000000000000000
4.9999268795045999044664529810255297667015
4.9999999973265010958050513865752991029792
4.9999999999999022526440386262622941532154
4.9999999999999999964262017950796589157574
4.9999999999999999999998693362752999858188
4.9999999999999999999999999952227272012798
4.9999999999999999999999999999998253353374
4.9999999999999999999999999999999999936140
4.9999999999999999999999999999999999999998
5.0000000000000000000000000000000000000000
5.0000000000000000000000000000000000000000
5.0000000000000000000000000000000000000000
5.0000000000000000000000000000000000000000
5.0000000000000000000000000000000000000000
The limit is 5.
----- Original Message -----
From: John Randall <[EMAIL PROTECTED]>
Date: Friday, December 8, 2006 11:48 am
Subject: RE: [Jgeneral] exp(y). sin(y) and accuracy.
> R.E. Boss wrote:
> > You do not mean g(n+1)=f(g(n),g(n-1)) ?
> >
>
> Sorry to keep garbling this. I believe the following is now correct.
>
> Let f(x,y)=108-(815-1500%y)%x and let g(n+1)=f(g(n),g(n-1)), with
> g(0)=4,g(1)=4.25.
>
> Then g(n)->L as n goes to infinity. The question is, what is L? Or
> even what is g(80)? [Hint: neither of these is 100.]
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm