Turing Machines - Self Assessment

Steven Zeil

Last modified: Apr 10, 2017
Contents:
1 Recognizing TMs
1.1 TMs as Language Acceptors
1.2 TMs as Functions
1.3 TMs as Functions 2
1.4 TMs as Functions 3
1.5 TMs as Functions 4
1.6 TMs as Functions 5
2 Constructing TMs
2.1 $a^ib^i$
2.2 wcw
2.3 Unary Form Integer Increment
2.4 Unary Form Integer Addition
2.5 Binary Interleave
2.6 Binary Addition
2.7 Binary Addition - Multitape

Abstract

This is a series of problems in the construction of Turing Machines, presented in lieu of a Blackboard-hosted self-assessment.

Try to solve each problem on your own, before revealing the solution.

1 Recognizing TMs

1.1 TMs as Language Acceptors

 

What language does this TM accept?

 
Answer

1.2 TMs as Functions

Often we think of TMs not so much as acceptors of languages as computers of functions. The input to the function is the initial content of the tape and the output is the final content of the tape when the TM reaches an accepting state.

 

What is the function computed by this TM?

 
Answer

1.3 TMs as Functions 2

 

What is the function computed by this TM?

 
Answer

1.4 TMs as Functions 3

 

What is the function computed by this TM?

 
Answer

1.5 TMs as Functions 4

 

What is the function (over the input language $\{a,b\}^*$) computed by this TM?

 
Answer

1.6 TMs as Functions 5

 

What is the function (over the input language $\{a,b\}^*$) computed by this TM?

 
Answer

2 Constructing TMs

2.1 $a^ib^i$

Construct a TM to recognize the language $\{a^ib^i | i \geq 0\}$.

Answer

2.2 wcw

Construct a TM to recognize the language $\left\{wcw | w \in \{a,b\}^*\right\}$.

Answer

2.3 Unary Form Integer Increment

Suppose that a tape contains an integer $k$ in unary form (i.e., a string of 1’s, where the value of the integer is the length of the string. Construct a TM to replace its input by the value of the function $f(k) = k+1$.

Answer

2.4 Unary Form Integer Addition

Suppose that a tape contains pair of integers $m, k$ in unary form separated by a single ‘x’. Construct a TM to replace its input by the value of the function $f(m,k) = m+k$.

Answer

2.5 Binary Interleave

Suppose that a tape contains two strings over {0,1} of equal length, separated by an x. Construct a TM to compute the interleave of those two strings, i.e., the string formed by taking alternate symbols from each of the input strings. e.g., given the input 0101x1110, we want to get 01110110

Answer

2.6 Binary Addition

Suppose that a tape contains pair of integers $m, k$ in conventional binary form separated by an ‘x’. Assume that m and k have the same number of binary digits. Construct a TM to compute the function $f(m,k) = m+k$.

(Hint; start with the interleave from the previous problem.)

Answer

2.7 Binary Addition - Multitape

Suppose that a TM has three tapes with a pair of integers $m, k$ in conventional binary form on tapes 1 and 2. Assume that m and k have the same number of binary digits. Construct a TM to compute the function $f(m,k) = m+k$, writing the output to the third tape.

Answer