Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 A million dollar question
Index -> Off Topic
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bugzpodder




PostPosted: 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
Sponsor
sponsor
Martin




PostPosted: Thu May 06, 2004 11:31 am   Post subject: (No subject)

negative values of n won't terminate.

pwn3d.
bugzpodder




PostPosted: Thu May 06, 2004 1:43 pm   Post subject: (No subject)

good, get your million dollar at:

www.I-want-to-get-a-million-dollar-so-give-it-to-me.com
Mazer




PostPosted: 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. Crying or Very sad
Martin




PostPosted: Thu May 06, 2004 7:32 pm   Post subject: (No subject)

Mazer you rock.
Mazer




PostPosted: 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




PostPosted: 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




PostPosted: Thu May 06, 2004 8:00 pm   Post subject: (No subject)

So if I get to the bank with the certificate before Darkn--
Martin




PostPosted: Thu May 06, 2004 9:34 pm   Post subject: (No subject)

zero doesn't work either Wink Come on mazer, you just missed the boat.
PaddyLong




PostPosted: Fri May 07, 2004 9:13 am   Post subject: (No subject)

the boat to the bank? or what boat are we talkin here?
Display posts from previous:   
   Index -> Off Topic
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: