Recent questions tagged goclasses-toc-practice-questions

1 1 vote
1 1 answer
118
118 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
79
79 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
80
80 views
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$?Repeatedly mark the leftm...
0 0 votes
1 1 answer
81
81 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
94
94 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...
0 0 votes
1 1 answer
82
82 views
Let \(I \subseteq \Sigma^*\) be any nonregular language.For every string \(w \notin I\), define $R_w = \Sigma^* - \{w\}.$Now consider $K = \bigcap_{w \notin I} R_w.$What ...
0 0 votes
1 1 answer
95
95 views
For every $n\geq 0$, define $L_n=\{a^nb^n\}$.Which statement is correct?Every $L_n$ is nonregular, but $\bigcup_{n=0}^{\infty}L_n$ is regular. Every $L_n$ is regular, and...
0 0 votes
1 1 answer
93
93 views
Let $\Sigma=\{0,1\}.$Which of the following are valid examples?$A=\{01\}, \qquad B=\{0^n1^n\mid n\ge0\}$where $A$ is regular, $B$ is nonregular, and $A\subseteq B$. $C=\{...
0 0 votes
1 1 answer
81
81 views
Let $L$ be a context-free language that is not regular.Which of the following must be true?$L$ is recursive. $L$ is not recursive. There exists a regular grammar $G$ such...
0 0 votes
1 1 answer
93
93 views
Consider the grammar $$S\rightarrow aS\mid Sb\mid b$$ Which of the following statements are correct?The given grammar is a Type $3$ grammar. The given grammar is a Type $...
1 1 vote
1 1 answer
83
83 views
Suppose $L_1$ and $L_2$ are both nonregular languages.Which statement about $L_1\cup L_2$ is correct?It must be nonregular. It must be regular. It may be regular or nonre...
1 1 vote
1 1 answer
76
76 views
Let $L$ be a nonregular language.What can always be concluded about $L^R$?$L^R$ is regular. $L^R$ is nonregular. $L^R$ may be regular or nonregular. Nothing can be conclu...
1 1 vote
2 2 answers
89
89 views
Suppose $L$ is a deterministic context-free language.Which of the following is always correct about$$L^R=\{w^R\mid w\in L\}?$$$L^R$ must be regular. $L^R$ must be determi...
2 2 votes
2 2 answers
132
132 views
Consider $$L= \{a^ib^jc^k\mid i=j\text{ or }j=k\}.$$ Which of the following correctly classifies $L$?$L$ is regular. $L$ is DCFL but not regular. $L$ is CFL but not DCFL....
1 1 vote
1 1 answer
72
72 views
Let $L_1,L_2$ be deterministic context-free languages and let $R$ be a regular language.Which of the following statements are always true?$L_1\cup L_2$ is deterministic c...
1 1 vote
1 1 answer
87
87 views
Let $L$ be a context-free language and $R$ be a regular language.Consider the problem$$L-R=\varnothing?$$Which statement is correct?It is decidable because $L-R$ is conte...
1 1 vote
1 1 answer
81
81 views
For a language $L$, define$$L^R=\{w^R\mid w\in L\}.$$ If $L$ is context-free, which statement is correct?$L^R$ is always regular. $L^R$ is always context-free. $L^R$ may ...
1 1 vote
1 1 answer
77
77 views
Suppose a language $L$ is accepted by some pushdown automaton.What can always be concluded about $L^*$?$L^*$ must be regular. $L^*$ must be context-free. $L^*$ need not b...
1 1 vote
1 1 answer
80
80 views
Let $R$ be a regular language and $C$ be a context-free language over the same alphabet.Which statement about $R\cup C$ is always true?$R\cup C$ must be regular. $R\cup C...
1 1 vote
1 1 answer
77
77 views
The class of context-free languages satisfies which one of the following?It is closed under intersection. It is closed under complementation. It is closed under concatena...
2 2 votes
1 1 answer
116
116 views
For languages $X,Y\subseteq\Sigma^*$, define$$X/Y = \{w:\exists y\in Y,\ wy\in X\}$$ Suppose $X$ is regular, but nothing is assumed about $Y$.Which statement is always tr...
0 0 votes
1 1 answer
94
94 views
Let $X$ and $Y$ be regular languages. Their symmetric difference is$$X\triangle Y=\{w:w\text{ belongs to exactly one of }X,Y\}$$. Which expression correctly represents $X...
2 2 votes
1 1 answer
101
101 views
Let $M$ and $N$ be two DFAs. Define$$Z=\{u_1v_1u_2v_2\cdots u_kv_k : k\ge0, ~u_i\in L(M), ~v_i\in L(N)\}.$$Which regular-language expression describes $Z$?$L(M)^*L(N)^*$ ...
1 1 vote
1 1 answer
90
90 views
Let $L$ be an arbitrary regular language over $\Sigma$, and define$$K=\{w\in\Sigma^*:w^Rw\in L\}$$.Which statement is correct?$K$ is always regular. $K$ is regular only i...
0 0 votes
1 1 answer
82
82 views
For an arbitrary language $L$, which of the following statements is correct?If $L^*$ is regular, then $L$ must be regular. If $L$ is nonregular, then $L^*$ must be nonreg...
2 2 votes
1 1 answer
139
139 views
Let $L_1$ and $L_2$ be regular languages and let $L_3$ be non-regular. Which statements are always true?$L_1=L_2$ iff $L_1\cap\overline{L_2}=\emptyset$ $L_1\cup L_3$ is n...
1 1 vote
1 1 answer
113
113 views
Consider,Statement $1:$ If a language family is closed under union and complement, then it must also be closed under intersection. Statement $2:$ An NFA can be constructe...
2 2 votes
1 1 answer
108
108 views
Which statements are true?Every language recognized by an $n$-state DFA can be recognized by an NFA with $n$ states. Every language recognized by an $n$-state NFA can be ...
1 1 vote
1 1 answer
96
96 views
Let $L_1$ be regular where specified. Which of the following languages are guaranteed to be regular?$\{ww\mid w\in{0,1}^*\}$ $\{ww\mid w\in L_1\}$ $\{w\mid ww\in L_1\}$ $...
1 1 vote
1 1 answer
106
106 views
All languages are over $\{0,1\}$. Which statements are true?If $L_1\subseteq L_2$ and $L_2$ is regular, then $L_1$ must be regular. If $L_1$ and $L_2$ are both non-regula...