Understanding the Halting Problem: A Simple Example

  • Thread starter Thread starter teng125
  • Start date Start date
  • Tags Tags
    Example
AI Thread Summary
The discussion revolves around the Halting Problem and the request for simple examples to illustrate it. A participant suggests using the 3n + 1 problem as an example of a program that may or may not halt, describing a program that iterates through this algorithm. The conversation also touches on the standard proof of the Halting Problem's noncomputability, with a suggestion to refer to Wikipedia for details. Additionally, it is mentioned that any unsolved mathematical problem can serve as an example of the Halting Problem. The thread emphasizes the complexity of determining whether certain programs will halt.
teng125
Messages
416
Reaction score
0
can somnbody pls give me a simple example to show halting problem

pls

thanx
 
Physics news on Phys.org
What exactly do you want an example of? A program which we don't know whether it halts? Or are you just looking for the standard proof of the halting problem's noncomputability?
 
a simple example program which explains a program which we don't know whether it halts and also a simple example for the standard proof of the halting problem's noncomputability

thanx
 
Well, I don't know what an "example" would be for the standard proof of the halting problem's noncomputability. If you want the proof itself you can find it on wikipedia.

For an example of a program which may or may not halt, consider the 3n + 1 problem. (find an explanation at http://acm.uva.es/p/v1/100.html) . Now write a program which does the following:

i <- 0
start:
i <- i + 1
run the 3n + 1 algorithm starting from i until one of the following two things happen:
if the sequence entered a finite loop of numbers that repeat over and over and do not include 1, return 0
otherwise if the sequence generated by that algorithm terminated in 1, goto start

You can turn any unsolved problem in mathematics into this kind of "example" of the halting problem. For example you could do: "Iterate through all legal proofs in ZFC. If one of them is a proof for Goldbach's conjecture, return 0. Otherwise keep iterating."
 
Last edited by a moderator:
the link above is not found,
pls re - posted

thanx
 
http://acm.uva.es/p/v1/100.html
for some reason the parenthesis was considered part of the link
 
Last edited by a moderator:

Similar threads

Replies
4
Views
3K
Replies
6
Views
2K
Replies
9
Views
3K
Replies
3
Views
2K
Replies
1
Views
1K
Replies
16
Views
3K
Replies
8
Views
2K
Back
Top