2
$\begingroup$

I'm wondering if constructing a non-halting turing machine is as simple as I think it is. It seems like all that's required is one loop.

Is the flow-chart machine attached accurately non-halting? Basically, you pass over all marks in the alphabet (moving in some arbitrary direction) and then switch states whenever you get to a blank, so that you just keep switching back and forth in a blank stretch of tape. This seems like it wouldn't halt but I fear I'm critically misunderstanding something. enter image description here

  • 1
    Sure, or you could read and write the same symbol every time, or just move left every time, or right every time, etc. You're right, it's easy to come up with non-halting Turing machines.2017-02-14
  • 0
    As Hayden has pointed out, you only need a single state and two instructions: "If 1, keep it a 1, move right, stay in same state. If blank, keep it a blank, move right, stay in same state." But then again, this depends on how you define a turing machine.2017-02-14
  • 0
    You can remove the $q_2$ state altogether (and any transitions to and from), and this machine will still not halt: with just the $*:*$ transition from $q_1$ to $q_1$, this machine will forever write the same symbol it is reading while staying in place.2017-02-14

2 Answers 2

3

Your example is quite right, and shows that it is often easy to tell if a Turing machine will halt or not. However, it is not always easy to do so.

For example, here is a piece of pseudocode that - with work - can be turned into a Turing machine (which ignores its input):

  • At stage $n$, we look at the odd number $2n+3$.

  • We search through the primes below $n$ until we find two, $p, q$, which sum to $2n+3$ (note that this is a finite search - there are at most $(2n+3)^2$-such pairs, and in fact vastly fewer than that).

  • If we find such, we move on to stage $n+1$; otherwise, we halt.

This Turing machine halts if and only if the Goldbach conjecture is false. Indeed, there are lots of problems in mathematics which can be "coded" into the halting/non-halting question of a specific Turing machine on a specific input. For instance, all questions of the form "Do [axioms] imply [statement]?" can be so coded (although I'm being a bit vague here, and it takes some work to make this precise).

There are also questions in math which can't be so coded, or which we don't currently know how to code in this way; for instance, the twin prime conjecture may be one of these. Such statements, however, can often be coded as questions about Turing machines in other ways. E.g., while TPC is not (obviously) equivalent to a sentence of the form "This machine halts on this input," it is easily equivalent to the statement "$M$ halts on all inputs" for some TM $M$.


Hopefully, the above explains how - while building examples of Turing machines with specific properties is often easy - telling whether an arbitrary Turing machine has a specific property is generally very hard (and indeed this can be made precise, and proved, as Rice's theorem).

  • 0
    I think you mean that the example TM halts iff Goldbach is false, since it halts2017-02-16
  • 0
    @StellaBiderman Derp, quite right - fixed!2017-02-16
  • 0
    are you sure about the twin prime conjecture? I thought all $\Pi_2^0$ statements were computable by a TM?2017-02-17
  • 1
    @StellaBiderman $\Pi^0_2$ questions correspond to asking whether a given Turing machine halts *on all inputs*; I meant a specific *instance* of a Turing machine, that is the machine and input fixed (analogously to how the Goldbach machine ignores its input). I've edited for clarity. (Also, it's not really meaningful to say that a statement is computed by a TM.)2017-02-17
2

As mentioned in the comments, this seems to be a perfectly reasonable description of a non-halting Turing Machine. Do you have a particular reason to think that the description of a non-halting Turing Machine would be complicated?

One reason people tend to think that non-halting Turing Machines would be complicated is due to the halting problem, but that's a fundamental misunderstanding. Figuring out if a particular TM halts is often quite easy: any TM that computes addition, or multiplication, or any other total function clearly halts on every input. The difficulty arises when you try to determine the set of all halting TMs.

  • 1
    Said differently, there are Turing machines that clearly halt, the are Turing machines that clearly do not halt; the halting problem concerns the ones in-between.2017-02-14
  • 0
    It might be worth adding here that there are simple machines that clearly halt, simple machines that clearly do not, but also *relatively* simple machines (with a small number of input states) that are giving us more problems. Computing even a small number of terms of the [busy beaver function](http://oeis.org/A028444) turns out to be difficult.2017-02-14