Tracing a Turing machine's configurations

[12/58%]
Show
LaTeX

Given a Turing machine M=({q,p,r},{Λ,0,1},P,q)\mathfrak {M}=(\left\{ q, p, r\right\} ,\left\{ \Lambda , 0,1\right\} , P, q) with the following program P={q,0→q,0,+1;q,1→q,1,+1;q,Λ→p,Λ,−1;p,0→p,1,−1;p,1→r,0,−1;r,0→r,0,−1;r,1→r,1,−1}P=\left\{ q, 0 \rightarrow q, 0,+1 ; q, 1 \rightarrow q, 1,+1 ; q, \Lambda \rightarrow p, \Lambda ,-1 ; p, 0 \rightarrow p, 1,-1 ; p, 1 \rightarrow r, 0,-1 ; r, 0 \rightarrow r, 0,-1 ; r, 1 \rightarrow r, 1,-1\right\}. What will the final configuration of this machine be when running on the input 1100? How many steps will be made? ⊛\circledast

?

There are three Turing machines Mi=(Q,Σ,Pi,q),i=1,2,3\mathfrak {M}_{i}=\left(Q, \Sigma , P_{i}, q\right), i=1,2,3, which share the tape alphabet Σ={Λ,a,b}\Sigma =\left\{ \Lambda , a, b\right\}, the set of states Q={q,p,r,s,t}Q=\left\{ q, p, r, s, t\right\}, and the initial state qq. Their programs PiP_{i} are given in the tables in Fig. 38 on the next page. Determine which of these machines transform every input word of the form a2nba^{2 n} b, n>0n>0, into the output banb a^{n}. ⊛\circledast

Fig. 38: Programs of the machines from problem 585.Fig. 38: Programs of the machines from problem 585.

Fig. 38: Programs of the machines from problem 585.Fig. 38: Programs of the machines from problem 585.

?

Trace DTM M1M_{1} of Example 4.1 and show the computation of M1M_{1} on inputs aabba and bbbab.

?

Consider the DTM M2=(Q,Σ,Γ,δ,s)M_{2}=(Q, \Sigma , \Gamma , \delta , s) with Q={s,q1,q2},Σ={a,b}Q=\left\{ s, q_{1}, q_{2}\right\} , \Sigma = \left\{ a, b\right\}, Γ={a,b, B}\Gamma =\left\{ a, b, \mathrm{~ B}\right\}, and

δ\deltaaabbB
ssq1, B,Lq_{1}, \mathrm{~ B}, L
q1q_{1}q1,a,Lq_{1}, a, Lq2,b,Rq_{2}, b, Rh, B,Rh, \mathrm{~ B}, R
q2q_{2}h,a,Lh, a, L
?
(a)

Trace M2M_{2} on inputs aaab, abaa and aaaa.

(b)

What is L(M2)L\left(M_{2}\right)?

Consider the DTM M3=(Q,Σ,Γ,δ,s)M_{3}=(Q, \Sigma , \Gamma , \delta , s), with Q={s,q1,q2,q3,q4,q5}Q=\left\{ s, q_{1}, q_{2}, q_{3}, q_{4}, q_{5}\right\}, Σ={a,b},Γ={a,b, B}\Sigma = \left\{ a, b\right\} , \Gamma =\left\{ a, b, \mathrm{~ B}\right\}, and

δ\deltaaabbB
ssq1, B,Lq_{1}, \mathrm{~ B}, L
q1q_{1}q1,a,Lq_{1}, a, Lq1,b,Lq_{1}, b, Lq2, B,Rq_{2}, \mathrm{~ B}, R
q2q_{2}q3,a,Rq_{3}, a, Rq4,b,Rq_{4}, b, Rq5, B,Lq_{5}, \mathrm{~ B}, L
q3q_{3}q3,a,Rq_{3}, a, Rq4,a,Rq_{4}, a, Rq5, B,Lq_{5}, \mathrm{~ B}, L
q4q_{4}q3,a,Rq_{3}, a, Rq4,b,Rq_{4}, b, Rq5, B,Lq_{5}, \mathrm{~ B}, L
q5q_{5}h,a,Rh, a, Rh, B,Rh, \mathrm{~ B}, R
?
(a)

Trace M3M_{3} on inputs aaabba and bbbabab b b a b a.

(b)

What is the function computed by M3M_{3}?

Consider the DTM M4=(Q,Σ,Γ,δ,s)M_{4}=(Q, \Sigma , \Gamma , \delta , s), in which Q,ΣQ, \Sigma and Γ\Gamma are the same as those of M3M_{3}, and δ\delta is the same as δ\delta of M3M_{3} except for

δ\deltaaabbB
q5q_{5}q5,a,Lq_{5}, a, Lh, B,Rh, \mathrm{~ B}, R

.

What is L(M4)L\left(M_{4}\right)?

?

For each of the following DTM's, trace the machine and show the computation on the given inputs:

?
(a)

The DTM MAM_{A} of Example 4.3 on inputs 0100 and 01010.

(b)

The DTM of Example 4.5 on inputs 0110 and 01010.

(c)

The DTM of Example 4.6 on inputs (3,0)(3,0) and (0,3)(0,3).

(d)

The DTM MM of Example 4.9, with k=3k=3 and i=2i=2, from configuration (q1, BaaBBab Bbba Baba)(q_{1}, \mathrm{~ B} a a \mathrm{BB} a b \mathrm{~ B} b b a \mathrm{~ B} a b a) to (q1, Baa Ba Bab Bbba Bab‾q_{1}, \mathrm{~ B} a a \mathrm{~ B} a \mathrm{~ B} a b \mathrm{~ B} b b a \mathrm{~ B} a \underline{b}).

Let M1M_{1} be the one-tape DTM defined by the quintuple (Q,ΣQ, \Sigma, Γ,δ,s)\Gamma , \delta , s), where Q={s,q1,q2,q3,p},Σ={a,b},Γ={a,b, B}Q=\left\{ s, q_{1}, q_{2}, q_{3}, p\right\} , \Sigma = \left\{ a, b\right\} , \Gamma =\left\{ a, b, \mathrm{~ B}\right\} and δ\delta is given by the following table:

δ\deltaaabbB
ssp,a,Rp, a, Rp,b,Rp, b, Rq1, B,Lq_{1}, \mathrm{~ B}, L
q1q_{1}q1,a,Lq_{1}, a, Lq1,b,Lq_{1}, b, Lq2, B,Rq_{2}, \mathrm{~ B}, R
q2q_{2}q2,a,Rq_{2}, a, Rq3,b,Rq_{3}, b, Rp, B,Lp, \mathrm{~ B}, L
q3q_{3}p,a,Rp, a, Rq3,b,Rq_{3}, b, Rh, B,Lh, \mathrm{~ B}, L
ppp,a,Rp, a, Rp,b,Rp, b, Rp, B,Lp, \mathrm{~ B}, L

Draw the transition diagram. What will be the computation on the input abbaa b b a? On the input a3ba^{3} b?

?

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 \, ?
?

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?

?

This exercise concerns TM M2M_{2}, whose description and state diagram appear in Example 3.7. In each of the parts, give the sequence of configurations that M2M_{2} enters when started on the indicated input string.

?
(a)
(b)

ᴬ 00.

(c)
(d)

This exercise concerns TM M1M_{1}, whose description and state diagram appear in Example 3.9. In each of the parts, give the sequence of configurations that M1M_{1} enters when started on the indicated input string.

?
(a)

ᴬ 11.

(b)
(c)
(d)
(e)

References

[ДДК+21] Дехтярь М.И., Дудаков С.М., Карлов М.И., Карлов Б.Н. Задачник по дискретной математике. 2-е изд., Тверской государственный университет, 2021.
[DuKo01] Du D., Ko K. Problem Solving in Automata, Languages, and Complexity. John Wiley & Sons, 2001.
[LaMa02] Lavrov I.A., Maksimova L.L. Задачи по теории множеств, математической логике и теории алгоритмов. 5-е изд., Физматлит, 2002.
[Sip13] Sipser M. Introduction to the Theory of Computation. 3rd ed., Cengage Learning, 2013.