Chapter 13: Q27E (page 898)
Suppose that and \({T_2}\) are Turing machines with disjoint sets of states \({S_1}\) and \({S_2}\)and with transition functions \({f_1}\) and \({f_2}\), respectively. We can define the Turing machine \({{\bf{T}}_{\bf{1}}}{{\bf{T}}_2}\), the composite of \({{\bf{T}}_{\bf{1}}}\) and \({{\bf{T}}_2}\), as follows. The set of states of \({T_1}{T_2}\) is \({S_1} \cup {S_2}\) . \({T_1}{T_2}\) begins in the start state of \({{\bf{T}}_{\bf{1}}}\). It first executes the transitions of \({{\bf{T}}_{\bf{1}}}\) using \({f_1}\) up to, but not including, the step at which \({{\bf{T}}_{\bf{1}}}\) would halt. Then, for all moves for which \({{\bf{T}}_{\bf{1}}}\) halts, it executes the same transitions of \({{\bf{T}}_{\bf{1}}}\) except that it moves to the start state of \({{\bf{T}}_2}\). From this point on, the moves of \({{\bf{T}}_{\bf{1}}}{{\bf{T}}_2}\) are the same as the moves of \({{\bf{T}}_2}\).
By finding the composite of the Turing machines you constructed in Exercises \(18\) and \(22\), construct a Turing machine that computes the function \(f\left( n \right) = 2 n + 2\).
Short Answer
The constructed Turing machine that computes the function \(f\left( n \right) = 2 n + 2\) is
\(\begin{aligned}T = \left( {S,I,f,{s_0}} \right),S = \left\{ {{s_0},{s_1},{s_2},{s_3},{s_4},{s_5}{s_6},s_0',s_1',s_2'} \right\},I = \{ 0,1,B\} ,\\\left( {{s_0},1,{s_0},1,R} \right),\left( {{s_0},B{s_1},B,L} \right),\left( {{s_1},1,{s_2},0,L} \right),\left( {{s_2},0,{s_2},0,L}\right),\\\left( {{s_2},1,{s_3},0,R} \right),\left( {{s_2},B,{s_5},B,R} \right),\left( {{s_3},0,{s_3},0,R} \right),\left( {{s_3},1,{s_3},1,R} \right),\\\left( {{s_3},B,{s_4},1,L}\right),\left( {{s_4},0,{s_2},0,L} \right),\left( {{s_4},1,{s_4},1,L} \right),\left( {{s_5},0,{s_5},1,R} \right),\\\left( {{s_5},1,s_0',1,R} \right),\left( {{s_5},B,s_0',B,R}\right),\left( {s_0',0,s_0',0,L} \right),\left({s_0',0,s_0',1,L} \right), \\\left({s_0',B,s_1',1,L} \right),\left( {s_1',B,s_2',1,L} \right)\end{aligned}\)