This is an old revision of the document!


Lab 03 - Turing Machines

Key concepts

  1. acceptance vs decision
  2. complement of a problem

1. Accepting and deciding a decision problem

1.1 Can the problem $ f(w) = 0$ (for all w in Sigma*) be accepted by a Turing Machine?

1.2 Can a problem be accepted by two different Turing Machines?

1.3 Can a Turing Machine accept two different problems?

1.4 Write a Turing Machine which accepts the problem $ f(x) = 1$ iff x (as binary) is odd, but does NOT decide it.

1.5 Which of the following problems you think can be accepted and which can be decided? Use pseudocode instead of writing a TM.

  • V Undecidable example 1
  • V Hilbert undecidable
  • V Wang Tile
  • k-color
  • Linear Integer Programming

2. Complement

2.1 What is the complement of the previous problem?

2.2 What is the complement of k Vertex Cover?

2.3 If a problem is decided by some TM, can its complement be decided?

2.4 If a problem is accepted by some TM, can its complement be decided?

3. Turing Machine pseudocode

3.1 Write a TM pseudocode which:

  • takes a TM encoding enc(M)
  • accepts if there exists a word which is accepted by M, in k steps

Suppose M is encoded on binary words, and also working on binary words, for simplicity.

Pseudocode(M): <- input
- divide the tape on three sections:
- [word][value i][value k in binary][enc(M)]
- set the w=[word] section to "0", set the [value i] section to 0 in binary
- simulate w on M. After each transition, increment i and perform following checks
    - if M accepts (crt state of M is final), go to final state
    - if i == k:
        "increment" the current word w. E.g. "0010" may be incremented as "0011" this is the "next" binary word
        set i = 0
        repeat the same process all over