Questions tagged [halting-problem]

The halting problem is a famous problem in theoretical computer science. Given as input a description of a program (typically a Turing machine) and an input to that program, the Halting problem is to decide whether that program terminates on that input.

The Halting Problem is a fundamental limitation on computability - that, given a program and a machine with infinite memory (usually a Turing Machine), it is impossible to know if the program will halt for a given input.

Although a program can be checked to see if it will halt on physical computers (because of limited memory), heuristics are used instead of an actual solution.

Here, most questions will have to do with how it impacts everyday coding and finding heuristics for code analysis purposes. However, consider asking your question on Computer Science if it is very abstract.

79 questions
-2
votes
2 answers

Discrete Logarithm in Prolog

I would like to check which of the two programs will stop: P1() { X = 819688; while (X != 77) { X = (X*12367+3466) mod 4294967296; } } P2() { X = 955725; while (X != 77) { X = (X*12367+3466) mod 4294967296; } } Since…
user502187
-2
votes
1 answer

Universal turing machine U should determine if M(x) stops

so we have a universal turing machine U, that should determine if a turing machine M with input x will stop. The solution should be presented in pseudo code. can someone help me a bit out, who should i solve it ?
RevoN
  • 11
  • 4
-3
votes
2 answers

The use of System.currentTimeMillis() in loops in Java

Let's observe the following segment of code in Java that uses System.currentTimeMillis() in a for loop. package loops; final public class Main { public static void main(String... args) { final long MAX_VAL=Long.MAX_VALUE; …
Lion
  • 18,729
  • 22
  • 80
  • 110
-3
votes
2 answers

Halting program explained

I am trying to understand why is it impossible to write a program H that can check whether another program P on a specific input I will halt or not (Halting problem), but i am unable to get a clear idea of it. Though intuition says that if this…
1 2 3 4 5
6