Chapter III.2

Turing Machines

[25/96%]
Show
LaTeX
Problem III.2.1

Which function f(x)f(x) is computed by the machine TT with the following program of commands:

q10→q20R,q11→q01,q20→q01,q21→q21R ? q_{1}0 \to q_{2}0R, \qquad q_{1}1 \to q_{0}1, \qquad q_{2}0 \to q_{0}1, \qquad q_{2}1 \to q_{2}1R \, ?
?
Problem III.2.2

Let the machine TT have the following program:

q10→q00. q_{1}0 \to q_{0}0.

Which functions f1(x),f2(x1,x2),…,fn(x1,…,xn),…f_{1}(x), f_{2}(x_{1}, x_{2}), \ldots , f_{n}(x_{1}, \ldots , x_{n}), \ldots does this machine compute?

?
Problem III.2.3

Construct a Turing machine that correctly computes the function f(x)=x+1f(x) = x+1.

?
Problem III.2.4

Construct a Turing machine that correctly computes the function o(x)=0o(x) = 0.

?
Problem III.2.5

Construct the following Turing machines:

  1. Zero transfer: q1001x0∣⇒Aq001x00q_{1}001^{x}0 \mid \Rightarrow_{A} q_{0}01^{x}00.

  2. Right shift: q1001x0∣⇒B+01xq00q_{1}001^{x}0 \mid \Rightarrow_{B^{+}} 01^{x}q_{0}0.

  3. Left shift: 01xq10∣⇒B−q001x001^{x}q_{1}0 \mid \Rightarrow_{B^{-}} q_{0}01^{x}0.

  4. Transposition: 01xq101y0∣⇒C01yq001x001^{x}q_{1}01^{y}0 \mid \Rightarrow_{C} 01^{y}q_{0}01^{x}0.

  5. Doubling: q101x0⇒Dq001x01x0q_{1}01^{x}0 \Rightarrow_{D} q_{0}01^{x}01^{x}0.

  6. Cyclic shift: q101x101x2…01xn0∣⇒Cynq001x2…01xn01x10q_{1}01^{x_{1}}01^{x_{2}}\ldots 01^{x_{n}}0 \mid \Rightarrow_{\text{Cy}_{n}} q_{0}01^{x_{2}}\ldots 01^{x_{n}}01^{x_{1}}0.

  7. Copying: q101x1…01xn0⇒Cpnq001x1…01xn01x1…01xn0q_{1}01^{x_{1}}\ldots 01^{x_{n}}0 \Rightarrow_{\text{Cp}_{n}} q_{0}01^{x_{1}}\ldots 01^{x_{n}}01^{x_{1}}\ldots 01^{x_{n}}0.

?
Problem III.2.6

Construct a Turing machine that correctly computes the function Imn(x1,…,xn)I_{m}^{n}(x_{1}, \ldots , x_{n}) (where 1≤m≤n1 \leq m \leq n).

?
Problem III.2.7
?
(a)

Let the functions f(x)f(x) and g(x)g(x) be correctly Turing computable. Show that the function h(x)=f(g(x))h(x) = f(g(x)) is correctly Turing computable.

(b)

Let the functions f(x1,…,xn)f(x_{1}, \ldots , x_{n}) and g1(x1,…,xm),…,gn(x1,…,xm)g_{1}(x_{1}, \ldots , x_{m}), \ldots , g_{n}(x_{1}, \ldots , x_{m}) be correctly Turing computable. Show that the function h(x1,…,xn)=f(g1(x1,…,xm),…,gn(x1,…,xm))h(x_{1}, \ldots , x_{n}) = f(g_{1}(x_{1}, \ldots , x_{m}), \ldots , g_{n}(x_{1}, \ldots , x_{m})) is correctly Turing computable.

Problem III.2.8

Construct a Turing machine for the correct computation of the functions:

?
(a)

x+yx+y;

(b)

x\symdiff1x \symdiff 1;

(c)

sg⁡(x)\operatorname {sg}(x);

(d)

sg⁡‾(x)\overline{\operatorname {sg}}(x);

(e)

x\symdiffyx \symdiff y;

(f)

x−yx - y;

(g)

x2\dfrac {x}{2};

(h)

[x2]\left[\dfrac {x}{2}\right].

Problem III.2.9

Prove that:

?
(a)

if the function fn+1f^{n+1} is obtained from correctly Turing computable functions gng^{n} and hn+2h^{n+2} by means of primitive recursion, then fn+1f^{n+1} is correctly Turing computable;

(b)

if the function fnf^{n} is obtained from a correctly Turing computable function gn+1g^{n+1} by means of the μ\mu-operator, then fnf^{n} is correctly Turing computable.

Problem III.2.10

Prove that every partial recursive function is correctly Turing computable.

?
Problem III.2.11

Prove that there exist primitive recursive functions α,β,γ\alpha , \beta , \gamma such that:

?
(a)

α(x,y)=λ(T1⋅T2)\alpha (x, y) = \lambda (T_{1} \cdot T_{2}), if λ(T1)=x\lambda (T_{1}) = x and λ(T2)=y\lambda (T_{2}) = y;

(b)

β(x)=λ(T)\beta (x) = \lambda (T) for some machine TT that transforms the word q10q_{1}0 into the word q101x0q_{1}01^{x}0;

(c)

γ(x,y,z)=λ(T1{qi=T2qj=T3)\gamma (x, y, z) = \lambda \left(T_{1}\begin{cases} q_{i} = T_{2} \\ q_{j} = T_{3} \end{cases}\right), if λ(T1)=x\lambda (T_{1}) = x, λ(T2)=y\lambda (T_{2}) = y, λ(T3)=z\lambda (T_{3}) = z.

Problem III.2.12

Construct primitive recursive functions γn(x1,…,xn)\gamma^{n}(x_{1}, \ldots , x_{n}) such that

ν(q101x1…01xn0)=γn(x1,…,xn). \nu (q_{1}01^{x_{1}}\ldots 01^{x_{n}}0) = \gamma ^{n}(x_{1}, \ldots , x_{n}).
?
Problem III.2.13

Construct a primitive recursive function ρ(s,k,l,u,ν)\rho (s, k, l, u, \nu ) satisfying the condition: if u=kl(A)u = k_{l}(A), ν=kr(B)\nu = k_{r}(B), 0≤s≤20 \leq s \leq 2, then ρ(s,k,l,u,ν)=ν((AqiajB)T′)\rho (s, k, l, u, \nu ) = \nu ((Aq_{i}a_{j}B)_{T}'), where T(i,j)T(i,j) is qiaj→qkalq_{i}a_{j} \to q_{k}a_{l} for s=0s=0, qiaj→qkalLq_{i}a_{j} \to q_{k}a_{l}L for s=1s=1, qiaj→qkalRq_{i}a_{j} \to q_{k}a_{l}R for s=2s=2.

?
Problem III.2.14

Construct a primitive recursive function σ(t,i,j,u,ν)\sigma (t, i, j, u, \nu ) satisfying the condition: if u=kl(A)u = k_{l}(A), ν=kr(B)\nu = k_{r}(B), t=λ(T)t = \lambda (T), qiq_{i} occurs in the alphabet of internal states, and aja_{j} in the external alphabet of the machine TT, then σ(t,i,j,u,ν)=ν((AqiajB)T′)\sigma (t, i, j, u, \nu ) = \nu ((Aq_{i}a_{j}B)_{T}').

?
Problem III.2.15

Construct a primitive recursive function τ(t,x)\tau (t, x) satisfying the condition: if t=λ(T)t = \lambda (T), x=ν(M)x = \nu (M), where M=AqiajBM = Aq_{i}a_{j}B is a machine word in the alphabet of the machine TT, then τ(t,x)=ν(MT′)\tau (t,x) = \nu (M_{T}').

?
Problem III.2.16

Construct a primitive recursive function w(t,x,y)w(t, x, y) satisfying the condition: if t=λ(T)t = \lambda (T), x=ν(M)x = \nu (M), where MM is a machine word in the alphabet of the machine TT, then w(t,x,y)=ν(MT(y))w(t, x, y) = \nu (M_{T}^{(y)}).

?
Problem III.2.17

Construct a primitive recursive function ε(x)\varepsilon (x) satisfying the condition: if x=ν(M)x = \nu (M), then ε(x)\varepsilon (x) is the number of occurrences of the symbol a1a_{1} in the word MM.

?
Problem III.2.18

Prove that if the machine TT computes f(x1,…,xn)f(x_{1}, \ldots , x_{n}) and t0=λ(T)t_{0} = \lambda (T), then:

?
(a)

⟨x1,…,xn⟩∈δf⇔ex⁡(1,w(t0,γn(x1,…,xn),y))=0\langle x_{1}, \ldots , x_{n} \rangle \in \delta_{f} \Leftrightarrow \operatorname {ex}(1, w(t_{0}, \gamma^{n}(x_{1}, \ldots , x_{n}), y)) = 0 for some yy;

(b)

f(x1,…,xn)=ε(w(t0,γn(x1,…,xn),hn+1(t0,x1,…,xn)))f(x_{1}, \ldots , x_{n}) = \varepsilon (w(t_{0}, \gamma^{n}(x_{1}, \ldots , x_{n}), h^{n+1}(t_{0}, x_{1}, \ldots , x_{n}))), where hn+1(t0,x1,…,xn)=μy[ex⁡(1,w(t0,γn(x1,…,xn),y))=0]h^{n+1}(t_{0}, x_{1}, \ldots , x_{n}) = \mu y \left[\operatorname {ex}(1, w(t_{0}, \gamma^{n}(x_{1}, \ldots , x_{n}), y)) = 0\right], and the functions γ,w\gamma , w, and ε\varepsilon are taken from problems III.2.12, III.2.16, and III.2.17.

Problem III.2.19

Prove that every Turing computable function is partial recursive.

?
Problem III.2.20

Prove that a function is Turing computable if and only if there is a Turing machine with external alphabet {0,1}\left\{ 0,1\right\} computing this function.

?
Problem III.2.21

Prove that there exists a two-place partial recursive function U(t,x)U(t, x) universal for the family of all one-place partial recursive functions.

?
Problem III.2.22

Prove that there exists an (n+1)(n+1)-place partial recursive function Un+1(t,x1,…,xn)U^{n+1}(t, x_{1}, \ldots , x_{n}) universal for the family of all nn-ary partial recursive functions.

?
Problem III.2.23

Prove that the following functions are not partial recursive:

?
(a)

h(x,y)={1,if x is the number of a machine T and the machine T halts, starting to work from the machine word q101y0,0otherwise;h(x, y) = \begin{cases} 1, & \text{if } x \text{ is the number of a machine } T \text{ and the machine } T \text{ halts, starting to work from the machine word } q_{1}01^{y}0, \\ 0 & \text{otherwise;} \end{cases}

(b)

g(x)=h(x,x)g(x) = h(x,x);

(c)

h0(x)={1,if x is the number of a machine T and the machine T halts, starting to work from the machine word q10,0otherwise.h_{0}(x) = \begin{cases} 1, & \text{if } x \text{ is the number of a machine } T \text{ and the machine } T \text{ halts, starting to work from the machine word } q_{1}0, \\ 0 & \text{otherwise.} \end{cases}

Problem III.2.24

Prove that there exists a primitive recursive function S(z,x,y,w)S(z, x, y, w) such that

S(z,x,y,w)={1,if z=λ(T) and the machine T transforms the word q101x0 into the word q001y0…0 in at most w steps,0otherwise. S(z, x, y, w) = \begin{cases} 1, & \text{if } z = \lambda (T) \text{ and the machine } T \text{ transforms the word } q_{1}01^{x}0 \text{ into the word } q_{0}01^{y}0\ldots 0 \text{ in at most } w \text{ steps,} \\ 0 & \text{otherwise.} \end{cases}
?
Problem III.2.25

Prove that there exist primitive recursive functions p,T1,T2,…p, T_{1}, T_{2}, \ldots such that:

?
(a)

U(m,x)=p(μy[T1(m,x,y)=0])U(m, x) = p(\mu y \left[T_{1}(m, x, y) = 0\right]);

(b)

Un+1(m,x1,…,xn)=p(μy[Tn(m,x1,…,xn,y)=0])U^{n+1}(m, x_{1}, \ldots , x_{n}) = p(\mu y \left[T_{n}(m, x_{1}, \ldots , x_{n}, y) = 0\right]).