HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

What is the complement of Halting Problem?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
problemthewhathaltingcomplement

Problem

I understand that Halting problem is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running or continue to run forever. That is, there are two options for HP: Halt (accept/reject) OR loop.

With this definition of HP, I am unable to understand what is co-HP, since any program can have only 2 options, Halt or loop, so what is co-HP? How do we even know co-HP exists?

Solution

The complement of a language $L$ is the language of all strings (over the same alphabet) not in $L$. So the complement of any language exists, by definition. It may be empty, which seems to be the case here.

However, your definition of HP is a bit strange, as every program for a given input either halts after a finite number of steps or does not. So, including both in HP obviously gives you all programs.

It might be more useful to consider something similar to the halting set $K := \{ (i, x) | \text{program $i$ halts when run on input $x$}\}$ (see wikipedia),
i.e. the language of all programs that halt.

The complement of $K$ is then, of course, the set of all programs that do not halt.

Context

StackExchange Computer Science Q#74650, answer score: 5

Revisions (0)

No revisions yet.