3

How Turing machine can loop forever when input length is always finite? I think this is a basic doubt but unable to understand how TM go into infinite loop? I think it can make transition forever on empty string. What are the other cases? Can it make without any empty alphabet ?

David Richerby
  • 82,470
  • 26
  • 145
  • 239
Mr. Sigma.
  • 1,301
  • 1
  • 16
  • 38

4 Answers4

5

It might help to think of Turing machines as a programming language. It's easy to see how a program in your favourite language might loop (its input is finite, too!) so you can translate that to a Turing machine.

David Richerby
  • 82,470
  • 26
  • 145
  • 239
4

Assuming the tape contains a string over $\{0,1\}$, so it represents a binary number.

Repeat: go to right end, add $1$.

Hendrik Jan
  • 31,459
  • 1
  • 54
  • 109
3

Is is a property of the transition function. Transition function might take the turing machine into an infinite loop on a particular input even when the input length is finite. Consider the transition function below with states Q0 and Q1 Q0 is the halt state If Q1 reads ‘L’, then stay in Q1 and go left one cell. If Q1 reads ‘R’, then stay in Q1 and go right one cell. If Q1 reads ‘H’, then change to Q0 and remain at this cell.

On the input RRRLLLL the machine goes into a loop but that doesn't mean language accepted by the machine is empty. It does halts on inputs such as RRRRH etc.

Shubham Singh rawat
  • 634
  • 1
  • 4
  • 11
3

A simple example is a Turing Machine with one state $q$, alphabet $\Sigma = \{a\}$, tape alphabet $\Gamma = \Sigma \cup \{\sqcup\}$ and the two transitions $q\times a \to q \times a \times \mathcal{R}$ and $q \times \sqcup \to q \times \sqcup \times \mathcal{R}$. It doesn't even change the tape.

Luke Mathieson
  • 18,373
  • 4
  • 60
  • 87