ago
47 views
0 0 votes

Consider $L=\{0^n1^n2^n\mid n\ge0\}.$

Which of the following gives a correct high-level strategy for a single-tape Turing machine recognizing $L$?

  1. Repeatedly mark the leftmost unmarked $0$, then the leftmost unmarked $1$, then the leftmost unmarked $2$; return to the left end and repeat. When no unmarked $0$ remains, accept only if no unmarked $1$ or $2$ remains.
     
  2. Mark all $0$'s first, then all $1$'s, and finally all $2$'s. Accept whenever all symbols have been marked.
     
  3. Compare the first $0$ only with the final $2$. If they exist, accept without checking the number of $1$'s.
     
  4. Scan the input once from left to right using only the finite control to remember the exact number of $0$'s, $1$'s and $2$'s.

1 Answer

0 0 votes

The machine must enforce $\#0=\#1=\#2$

while also ensuring that the input has the form $0^*1^*2^*.$

A correct marking algorithm is:

  1. Find the leftmost unmarked $0$ and mark it.
     
  2. Move right and find the leftmost unmarked $1$. Mark it.
     
  3. Continue right and find the leftmost unmarked $2$. Mark it.
     
  4. Return left.
     
  5. Repeat.
     
  6. When no unmarked $0$ remains, check that no unmarked $1$ or $2$ remains.

If a required matching symbol is missing at any stage, reject.

Thus each iteration matches exactly one $0, 1, 2.$ 

Hence,

Answer : A

ago
Answer:
Position:
Show:

Related questions

1 1 vote
1 1 answer
74
74 views
GO Classes asked 3 days ago
74 views
Let $M$ be a Turing machine that recognizes language $L$, and suppose $w\notin L.$Which of the following behaviors are possible when $M$ is run on $w$?$M$ accepts $w$. $M...
0 0 votes
1 1 answer
50
50 views
GO Classes asked 3 days ago
50 views
Consider the following TM strategy for $L=\{b^ic^i\mid i\ge0\}.$It repeatedly:changes the leftmost unmatched $b$ to $\sqcup$ (blank symbol)$,$ scans right to the end of t...
0 0 votes
1 1 answer
39
39 views
GO Classes asked 3 days ago
39 views
Suppose a Turing machine makes the following one-step move:$$011q_7\,00101 \;\vdash\; 0110q_7\,0101.$$What transition must have been used, and what is the next configurat...
1 1 vote
1 1 answer
61
61 views
GO Classes asked 3 days ago
61 views
Consider a deterministic single-tape Turing machine$$M=(Q,\Sigma,\Gamma,\delta,q_0,q_{\text{accept}},q_{\text{reject}}).$$Which of the following are required in the stand...