Jump to content
Can't remember your login details? Read more... ×
Sign in to follow this  
freespace

For the lols

Recommended Posts

Hahaha. Nice.

 

Here's my solution:

 

while (true){
   if (CurrentTick() >= infinity){
	  printf(I'm in an infinite loop. All your clocks are belong to us.");
   }else if{
	  printf("I'm not in an infinite loop, I'm merely calculating Pi, for your convenience.");
   }
}

Share this post


Link to post
Share on other sites

while (true){
   if (CurrentTick() >= infinity){
	  printf(I'm in an infinite loop. All your clocks are belong to us.");
   }else if{
	  printf("I'm not in an infinite loop, I'm merely calculating Pi, for your convenience.");
   }
}
?

Share this post


Link to post
Share on other sites

You and your lack of sense of humour!

 

It checks the current program run time, and if it's larger than or equal to infinity, it prints the first message. Otherwise it prints the second. Obviously, it doesn't actually work. :P

 

PS: The CurrentTick() function is actually from NXC (Not eXactly C).

Share this post


Link to post
Share on other sites

Oh, I thought you were trying to solve their problem :-)

 

You know, if currentTick() returns a IEEE floating point number, it can be equal to infinity, since that is a valid value :P

Share this post


Link to post
Share on other sites

Wow.

I'd forgotten how retarded people are when it comes to underbidding eachother on sites like this.

No wonder I get so many people wanting sites done for dirt cheap -_-

Share this post


Link to post
Share on other sites

erm, halting problem anyone?

 

that site looks like a great way to start a career in marketing and (self) promotion ;)

 

edit: spellings

Edited by pwarren

Share this post


Link to post
Share on other sites

pwarren: unfortunately only 1 person on that site seem to have make the same connection you have :)

 

cyber: If you do ever need fractions in NXT, just use fixed point maths :-)

Share this post


Link to post
Share on other sites

pwarren: unfortunately only 1 person on that site seem to have make the same connection you have :)

For those of you that are lazy like me, freespace is referring to jesus29's response :P

 

Rob.

Share this post


Link to post
Share on other sites

pwarren: unfortunately only 1 person on that site seem to have make the same connection you have :)

 

cyber: If you do ever need fractions in NXT, just use fixed point maths :-)

Yup, this is what we did. Floating point numbers was the least of our problems. Lack of multi-dimensional arrays and pointers was the read killer, only second to the dodgy light sensors. Edited by .:Cyb3rGlitch:.

Share this post


Link to post
Share on other sites

We've been studying estimation methods at uni this semester in one of my classes. In IT, project estimation can be VERY arbitrary. There's so many variables when considering an IT project, and you run the risk of under-estimating, making your project look like 95% of all IT projects, over budget and late.

 

This, however, is a bit ridiculous. $3000?

 

Doesn't valgrind do this anyway?

Share this post


Link to post
Share on other sites

Doesn't valgrind do this anyway?

As far as I'm aware, there is no solution to this problem (Halting Problem). It's mathematically impossible.

 

There's no perfect solution, but there are patterns that can be detected that can find many common cases of infinite recursion.

Share this post


Link to post
Share on other sites

Doesn't valgrind do this anyway?

As far as I'm aware, there is no solution to this problem (Halting Problem). It's mathematically impossible.

 

I thought that it was impossible to solve with a Turing machine, which is not necessarily mathematically impossible.

 

Hmm, according to this it is solvable for machines with 4 states or less.

Share this post


Link to post
Share on other sites

We've been studying estimation methods at uni this semester in one of my classes. In IT, project estimation can be VERY arbitrary. There's so many variables when considering an IT project, and you run the risk of under-estimating, making your project look like 95% of all IT projects, over budget and late.

 

This, however, is a bit ridiculous. $3000?

$3000 is 1.5 days work. Analysis + Engeering + QA would take a 12 hours easy :p

Share this post


Link to post
Share on other sites

$3000 is 1.5 days work.

Or 3 hours worth of hookers and blow :p

 

EDIT: And, this may seem naive, but wouldn't a desk check work? I was alway tought that it was good practice to do one.

Edited by AIMBOT

Share this post


Link to post
Share on other sites

Doesn't valgrind do this anyway?

As far as I'm aware, there is no solution to this problem (Halting Problem). It's mathematically impossible.

 

I thought that it was impossible to solve with a Turing machine, which is not necessarily mathematically impossible.

 

Hmm, according to this it is solvable for machines with 4 states or less.

 

Given that a microprocessor has more than four states (or so I assume from the small amount of reading I've just done on it) Cyb3rGlitch is correct in saying that the program being asked for is mathematically impossible :P

 

Rob.

Share this post


Link to post
Share on other sites

Given that a microprocessor has more than four states (or so I assume from the small amount of reading I've just done on it) Cyb3rGlitch is correct in saying that the program being asked for is mathematically impossible :P

 

Rob.

He said the a solution to the halting problem is mathematically impossible, not the advertised program.

Share this post


Link to post
Share on other sites

He said the a solution to the halting problem is mathematically impossible, not the advertised program.

Right you are. But I think I can weasel my way out of this... :P

 

He said there is no solution to this problem, and then specified this problem to be the halting problem. Since this problem is a halting problem with more than 4 states he was correct in asserting that solving this problem is mathematically impossible.

 

To rephrase that, he said that it was mathematically impossible to solve this problem (a specific case of halting problem).

 

Rob.

Share this post


Link to post
Share on other sites

Fair enough, his statement is open to interpretation until he clarifies :)

 

I took his statement as equating the advertised program with the Halting Program completely, and then inferring that the program was equivalent to the Halting problem, which is, as far as he is aware, not mathematically solvable(at all).

Share this post


Link to post
Share on other sites

The problem _might_ be interpreted as a weaker version of the halting problem. That is the only possible saving grace.

 

None the less, the halting problem isn't solvable for machines with 4 states or more.

 

Also, this thread has just became part of the joke :D

Share this post


Link to post
Share on other sites

The problem _might_ be interpreted as a weaker version of the halting problem.

Could you give a cliff-notes explanation as to why this would be a weaker version of the halting problem?

 

Rob.

Share this post


Link to post
Share on other sites

The problem _might_ be interpreted as a weaker version of the halting problem.

Could you give a cliff-notes explanation as to why this would be a weaker version of the halting problem?

 

Rob.

 

They want to know whether it is susceptible to not halting as opposed to whether it is going to halt or not. I consider it this a "weaker" version. But that's just conjecture on my part.

Share this post


Link to post
Share on other sites

Ah, I gotcha. I'd assume that it's unlikely they intended to make that distinction since if they knew the mathematical facts behind the problem they would have been clearer as to what they were asking.

 

[edit]: On second thought, while I don't know the specifics of the halting problem I'd guess that finding out if a program is susceptible to halting is just as hard to do as finding out if it does halt. 'cause that's just the way maths tends to do business :P

 

Rob.

Edited by robzy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×