Go Back   Science Forums
View Single Post
Old 03-24-2009   #45 (permalink)
Kriminal99's Avatar
Kriminal99
Explaining


 



Not Ranked  0 score     
Re: Halting Proof Fails

Quote:
Originally Posted by phillip1882 View Post
the halting problem is not saying you can't determine whether a particular program will halt.
its saying there's no universal program to determine whether any program will halt.
let me show you what i mean.

let's say we have the program
Code:
x =0
while x <10:
   x = x+1
   x = x-1
and want an algorithm to determine whether or not this program will halt. we note that x goes back and forth between two numbers 0, and 1. so one possible algorithm would be
if x value resets, the program will never halt.
now however consider
Code:
y = 0
while x <10:
   y=y+1
   x = 0
   x = y
the x value resets every iteration, but then quickly goes to the value y. so we need a new algorithm. one possible algorithm would be, if x repeats its pattern, the program will never halt.
now consider
Code:
y = 0
while x <10:
    y = y+1
    x = 0
    x = 1
    if y = 10:
       x = 11
x repeats its pattern 10 times, yet the program still halts.
in short there is no algorithm that will guarantee an accurate halt detection.
Hey. There is a common thread in each of the programs that loop forever that is not in the program that does halt. Namely, there is a complete state or configuration that repeats. At one point, the program is at the same point with the same value for the variables. This is clear evidence of an infinite loop.

In the final code, this is not the case because y has a different value in each iteration.

There is another kind of infinite loop where values change, but they never go in a direction that will allow the program to halt. This is also easily detectable.

I suppose the most difficult question is to ask how does one know that a program that takes N steps toward a ending value (x - n; if (x < 10) {quit;} else {x + n + m;}) then M steps back halts or not in general.

Last edited by Kriminal99; 03-24-2009 at 07:51 AM..
Reply With Quote
 
» Advertisement
» Current Poll
Who's the sexiest man alive? Johnny Depp or Robert Pattinson?
Johnny Depp - 27.27%
3 Votes
Robert Pattinson - 0%
0 Votes
Someone else (please specify) - 45.45%
5 Votes
I'm too macho to think a guy is sexy - 27.27%
3 Votes
Total Votes: 11
You may not vote on this poll.


All times are GMT -8. The time now is 12:19 PM.

Hypography?

Hypography [n.]: A combination of "hyperlink" and "bibliography" - ie, a list of links to electronic documents. Comparable to discography and bibliography, but not cartography.

We have been online since May 2000, and aim to be the best place to find and share science-related content of all kinds.

Share the love!

Please add more science to your life. Use our RSS feeds on your blog, your portal, or your favorite feedreader!


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000-2009 Hypography
Part of the Hypography - Science for Everyone Network