Author |
Message |
bugzpodder
|
Posted: Thu May 06, 2004 7:35 am Post subject: A million dollar question |
|
|
similar to the halting problem
will this function terminate for all values of n (prove it)? if not, find a value of n such that it doesnt. (if you do, somebody will give you $1,000,000)
int f(int n){
if (n==1) return 1;
else if (n%2==0) return f(n/2);
else return f(3*n+1);
}
function f(n:int):int
if n=1 then
result 1
elsif n mod 2=0 then
result f(n/2);
else
result f(3*n+1);
end if
end f |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Martin
|
Posted: Thu May 06, 2004 11:31 am Post subject: (No subject) |
|
|
negative values of n won't terminate.
pwn3d. |
|
|
|
|
|
bugzpodder
|
|
|
|
|
Mazer
|
Posted: Thu May 06, 2004 7:28 pm Post subject: (No subject) |
|
|
Bugz, I think you mispelled the URL or something, the link didn't work for me. |
|
|
|
|
|
Martin
|
Posted: Thu May 06, 2004 7:32 pm Post subject: (No subject) |
|
|
Mazer you rock. |
|
|
|
|
|
Mazer
|
Posted: Thu May 06, 2004 7:37 pm Post subject: (No subject) |
|
|
Wha? Why do I rock? Darkness, did the link work for you? I sure could use the million dollars... I broke my original CDs and I need to buy myself a new copy of Linux. |
|
|
|
|
|
bugzpodder
|
Posted: Thu May 06, 2004 7:57 pm Post subject: (No subject) |
|
|
sorry, darkness is the only one eligible for the million dollars. ask him to split the money. btw it is not a link. it is a certificate (use print screen to get it and goto paint and paste it and print it) and you can redeem it at your local bank. |
|
|
|
|
|
Mazer
|
Posted: Thu May 06, 2004 8:00 pm Post subject: (No subject) |
|
|
So if I get to the bank with the certificate before Darkn-- |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Martin
|
Posted: Thu May 06, 2004 9:34 pm Post subject: (No subject) |
|
|
zero doesn't work either Come on mazer, you just missed the boat. |
|
|
|
|
|
PaddyLong
|
Posted: Fri May 07, 2004 9:13 am Post subject: (No subject) |
|
|
the boat to the bank? or what boat are we talkin here? |
|
|
|
|
|
|