Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Let \(T\) be the Turing machine defined by the five-tuples: \(\left( {{s_0},0,{s_1},1,R} \right),\left( {{s_0},1,{s_1},0,R} \right),\left( {{s_0},B,{s_1},0,R} \right),\left( {{s_1},0,{s_2},1,L} \right),\left( {{s_1},1,{s_1},0,R} \right)\), and \(\left( {{s_1},B,{s_2},0,L} \right)\). For each of these initial tapes, determine the final tape when \(T\) halts, assuming that \(T\) begins in initial position.

\(a)\)

\(\begin{array}{*{20}{c}} \cdots &B&B&0&0&1&1&B&B& \cdots \end{array}\)

\(b)\)

\(\begin{array}{*{20}{c}} \cdots &B&B&1&0&1&B&B&B& \cdots \end{array}\)

\(c)\)

\(\begin{array}{*{20}{c}} \cdots &B&B&1&1&B&0&1&B& \cdots \end{array}\)

\(d)\)

\(\begin{array}{*{20}{c}} \cdots &B&B&B&B&B&B&B&B& \cdots \end{array}\)

Short Answer

Expert verified

\((a)\)The final tape when \(T\) halts, assuming that \(T\) begins in initial position is \({\bf{1111}}\).

\((b)\)The final tape when \(T\) halts, assuming that \(T\) begins in initial position is \(011\).

\((c)\)The final tape when \(T\) halts, assuming that \(T\) begins in initial position is \(00001\).

\((d)\) The final tape when \(T\) halts, assuming that \(T\) begins in initial position is \(00\).

Step by step solution

01

Definition

\(T\)is defined by the following five-tuples:

\(\begin{array}{l}\left( {{s_0},0,{s_1},1,R} \right)\\\left( {{s_0},1,{s_1},0,R} \right)\\\left( {{s_0},B,{s_1},0,R} \right)\\\left( {{s_1},0,{s_2},1,L} \right)\\\left( {{s_1},1,{s_1},0,R} \right)\\\left( {{s_1},B,{s_2},0,L} \right)\end{array}\)

02

Determining the final tape

(a)

It starts from the initial state \({s_0}\) of the Turing machine \(T\). It starts from the first non-blank position on the tape.

\({\bf{ \ldots BB0011BB \ldots }}\)

Since itis at state \({s_0}\) while the position on the tape is \(0\), it uses the five-tuple \(\left( {{s_0},0,{s_1},1,R} \right)\). This implies that it moves to state \({s_1}\), the current position on the tape is changed to \(1\) and it moves one position to the right on the tape.

\({\bf{ \ldots BB1011BB \ldots }}\)

Since it is at state \({s_1}\) while the position on the tape is \(0\), it uses the five-tuple \(\left( {{s_1},0,{s_2},1,L} \right)\). This implies that it moves to state \({s_2}\), the current position on the tape is changed to \(1\) and it moves one position to the left on the tape.

\({\bf{ \ldots BB1111BB \ldots }}\)

Since it is at state \({s_2}\) while the position on the tape is \(1\), the machine halts (as there is no five-tuple that has \({s_2}\) as its first coordinate).

Therefore, the final tape then contains the string \({\bf{1111}}\).

03

Determining the final tape

(b)

It starts from the initial state \({s_0}\) of the Turing machine \(T\). It starts from the first non-blank position on the tape.

\({\bf{ \ldots BB101BBB \ldots }}\)

Since itis at state \({s_0}\) while the position on the tape is \(1\), it uses the five-tuple \(\left( {{s_0},1,{s_1},0,R} \right)\). This implies that it moves to state \({s_1}\), the current position on the tape is changed to \(0\) and it moves one position to the right on the tape.

\({\bf{ \ldots BB001BBB \ldots }}\)

Since itis at state \({s_1}\) while the position on the tape is \(0\), it uses the five-tuple \(\left( {{s_1},0,{s_2},1,L} \right)\). This implies that it moves to state \({s_2}\), the current position on the tape is changed to \(1\) and it moves one position to the left on the tape.

\({\bf{ \ldots BB011BBB \ldots }}\)

Since it is at state \({s_2}\) while the position on the tape is \(1\), the machine halts (as there is no five-tuple that has \({s_2}\) as its first coordinate).

Therefore, the final tape then contains the string \(011\).

04

Determining the final tape

(c)

It starts from the initial state \({s_0}\) of the Turing machine \(T\). It starts from the first non-blank position on the tape.

\({\bf{ \ldots BB11B01B \ldots }}\)

Since it is at state \({s_0}\) while the position on the tape is \(1\), it uses the five-tuple \(\left( {{s_0},1,{s_1},0,R} \right)\). This implies that it moves to state \({s_1}\), the current position on the tape is changed to \(0\) and it moves one position to the right on the tape.

\({\bf{ \ldots BB01B01B \ldots }}\)

Since itis at state \({s_1}\) while the position on the tape is \(1\), it uses the five-tuple \(\left( {{s_1},1,{s_1},0,R} \right)\). This implies that it remains at state \({s_1}\), the current position on the tape is changed to \(0\) and it moves one position to the right on the tape.

\({\bf{ \ldots BB00B01B \ldots }}\)

Since you are at state \({s_1}\) while the position on the tape is \(B\), you use the five-tuple \(\left( {{s_1},B,{s_2},0,L} \right)\). This implies that you move to state \({s_2}\), the current position on the tape is changed to \(0\) and you move one position to the left on the tape.

\({\bf{ \ldots BB00001B \ldots }}\)

Since itis at state \({s_2}\) while the position on the tape is \(0\), the machine halts (as there is no five-tuple that has \({s_2}\) as its first coordinate).

Therefore, the final tape then contains the string \(00001\).

05

Determining the final tape

(d)

It starts from the initial state \({s_0}\) of the Turing machine \(T\). It starts from some blank position on the tape (as there are no non-blank positions).

\({\bf{ \ldots BBBBBB \ldots }}\)

Since itis at state \({s_0}\) while the position on the tape is \(B\), it uses the five-tuple \(\left( {{s_0},B,{s_1},0,R} \right)\). This implies that it moves to state \({s_1}\), the current position on the tape is changed to \(0\) and it moves one position to the right on the tape.

\({\bf{ \ldots BB0BBBBB \ldots }}\)

Since itis at state \({s_1}\) while the position on the tape is \(B\), it uses the five-tuple \(\left( {{s_1},B,{s_2},0,L} \right)\). This implies that it remains at state \({s_2}\), the current position on the tape is changed to \(0\) and it moves one position to the right on the tape.

\( \ldots .BB00BBBB \ldots \)

Since itis at state \({s_2}\) while the position on the tape is \(0\), the machine halts (as there is no five-tuple that has \({s_2}\) as its first coordinate).

Therefore, the final tape then contains the string \(00\).

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Express each of these sets using a regular expression.

  1. The set consisting of the strings 0, 11, and 010
  2. The set of strings of three 0s followed by two or more 0s
  3. The set of strings of odd length
  4. The set of strings that contain exactly one 1
  5. The set of strings ending in 1 and not containing 000

Find a phrase-structure grammar for each of these languages.

a) the set of all bit strings containing an even number of 0s and no 1s

b) the set of all bit strings made up of a 1 followed by an odd number of 0s

c) the set of all bit strings containing an even number of 0s and an even number of 1s

d) the set of all strings containing 10 or more 0s and no 1s

e) the set of all strings containing more 0s than 1s

f) the set of all strings containing an equal number of 0s and 1s

g) the set of all strings containing an unequal number of 0s and 1s

In Exercises 16โ€“22 find the language recognized by the given deterministic finite-state automaton

In Exercises 43โ€“49 find the language recognized by the given nondeterministic finite-state automaton.

Let \({\bf{G = }}\left( {{\bf{V, T, S, P}}} \right)\) be the context-free grammar with \({\bf{V = }}\left\{ {\left( {\bf{,}} \right){\bf{S,A,B}}} \right\}{\bf{, T = }}\left\{ {\left( {\bf{,}} \right)} \right\}\) starting symbol \({\bf{S}}\), and productions \({\bf{S}} \to {\bf{A,A}} \to {\bf{AB,A}} \to {\bf{B,B}} \to {\bf{A,}}\)and \({\bf{B}} \to {\bf{(),S}} \to {\bf{\lambda }}\)

Construct the derivation trees of these strings.

\({\bf{a)}}\)\({\bf{(())}}\)

\({\bf{b)}}\)\({\bf{()(())}}\)

\({\bf{c)}}\)\({\bf{((()()))}}\)

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free