wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> medium >> f(84)
(Message started by: tony123 on Jun 27th, 2007, 11:00am)

Title: f(84)
Post by tony123 on Jun 27th, 2007, 11:00am
let f function  from z to z(integers)

and

f(n)=n - 3 at   n  >  999

f(n)= f(f(n+5)  at n  < 1000




find
f(84)

Title: Re: f(84)
Post by Sameer on Jun 27th, 2007, 11:20am
hmmm flip flop .. flip flop .... flip flop ... thinking... choosing f(84) = f(0)

Title: Re: f(84)
Post by towr on Jun 27th, 2007, 11:23am
What a remarkably boring function..

Title: Re: f(84)
Post by SMQ on Jun 27th, 2007, 11:45am
Just to be thorough:
[hide]working forward using rule 1:

f(1000) = 997
f(1001) = 998
f(1002) = 999
f(1003) = 1000
f(1004) = 1001

working backward using rule 2:
f(999) = f(f(1004)) = f(1001) = 998
f(998) = f(f(1003)) = f(1000) = 997
f(997) = f(f(1002)) = f(999) = 998
f(996) = f(f(1001)) = f(998) = 997

And in general, for integer x: 0 <= x <= 497,
f(2x+1) = f(f(2x+6)) = f(997) = 998
f(2x) = f(f(2x+5)) = f(998) = 997

Therefore f(84) = 997[/hide]

--SMQ



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board