Test 3 - Theory of Computation | Computer Science
GATE Previous year Topic Wise Questions and Answers | Theory of Computation
Questions
The smallest finite automaton, which accepts the language { x | length of x is divisible by 3} has
- 2 states
- 3 states
- 4 states
- 5 states
Which of the following statements true?
- If a language is context free it can be always be accepted by a deterministic push-down automaton.
- The union of two context free language is context free.
- The intersection of two context free language is context free
- The complement of a context free language is context free
Given an arbitary non-deterministic finite automaton (NFA) with N states, the maximum number of states in an equivalent minimized DFA is at least.
- N2
- 2N
- 2N
- N!
The C language is
- a context free language
- a context sensitive language
- a regular language
- parsable fully only by a turing machine
Consider a DFA over $\sum$= {a,b} accepting all strings which have number of a's divisible by 6 and number of b's divisible by 8. What is the minimum number of states that the DFA will have?
- 8
- 14
- 15
- 48
Consider the following languages:

Which of these languages is/are regular?
- Only L1 and L2
- Only L2, L3 and L4
- Only L3 and L4
- Only L3
Which of the following is true?
- The complement of a recursive language is recursive.
- The complement of a recursively enumerable language is recursively enumerable.
- The complement of a recursive language is either recursive or recursively enumerable.
- The complement of a context-free language is context-free.
The language accepted by a Pushdown Automaton in which the stack is limited to 10 items is best described as
- context free
- regular
- deterministic context free
- recursive
The problems 3-SAT and 2-SAT are
- both in P
- both NP-complete
- NP-complete and in P respectively
- undecidable and NP-complete respectively
Consider the two statements:
S1 : {02n |n $\ge$ 1| } is a regular language
S2 : {0m1n 0m+n | m $\ge$ 1 and n $\ge$ 1| } is a regular language
Which of the following statements is incorrect?
- Only S1 is correct
- Only S2 is correct
- Both S1 and S2 are correct
- Neither S1 nor S2 is correct
pts all those binary strings in which the number of 1's and 0's are respectively

- divisible by 3 and 2
- odd and even
- even and odd
- divisible by 2 and 3
Consider the following problem x:
Given a Turing machine M over the input alphabet $\sum$, any state q of M. A word w $\in\sum^*$ does the computation of M on w visit the state q.
Which of the following statements about x is correct?
- x is decidable.
- x is undecidable but partially decidable.
- x is undecidable and not even partially decidable.
- x is not a decision problem.
The language {ambm+n | m,n $\le$ 1} is
- regular
- context-free but not regular
- context sensitive but not context free
- type-0 but not context sensitive
Consider the flowing grammar C
S $\rightarrow$ bS |aA| b
A$\rightarrow$ bA | aB
B bB |aS| a
Let Na (W) and Nb (W) denote the number of a's and b's in a string W respectively. The language L(G)
{a,b}+ generated by G is
- {W| Na (W) > 3Nb (W)}
- {W| Nb (W) > 3Na (W)}
- {W| Na (W) = 3k,k $\in$ {0,1,2,...}}
- {W| Nb (W) = 3k,k $\in$ {0,1,2,...}}
L1 is a recursively enumerable language over$\sum$. An algorithm A effectively enumerates its words as w1,w2,w3,.... Define another language L2 over $\sum \cup$ {#} as {wi # wj: wi, wj $\in$ L1, i < j}. Here # is a new symbol. Consider the following assertion.
S1:L1 is recursive implies L2 is recursive
S2:L2 is recursive implies L1 is recursive
Which of the following statements is true?
- Both S1 and S2 are true
- S1 is true but S2 is not necessarily true
- S2 is true but S1 ins necessarily true
- Neither is necessarily true
Let L1 be a recursive language, and let L2 be a recursively enumerable but not a recursive language. Which one of the following is true?
- $\bar L_1$ is recursive and $\bar L_2$ is recursively enumerable
- $\bar L_1$ is recursive and $\bar L_2$ is not recursively enumerable
- $\bar L_1$ and L2 are recursively enumerable
- $\bar L_1$ is recursively enumerable and $\bar L_2$ is recursive
Consider the machine M

The language recognized by M is
- {W $\in$ {a,b}*/ every a in w is followed by exactly two b's}
- {W $\in$ {a,b}*/ every a in w is followed by at least two b's}
- {W $\in$ {a,b}*/ w contains the substring 'abb'
- {W $\in$ {a,b}*/ w does not contain 'aa' as a substring}
Let Nf and Np denote the classes of languages accepted by nondeterministic finite automata and non-deterministic push-down automata, respectively. let Df and DP denote the classes of languages accepted by deterministic finite automata and deterministic push down automata, respectively. Which one of the following is true?
- Df $\subset$ Nf and DP $\subset$ NP
- Df $\subset$ Nf and DP = NP
- Df = Nf and DP = NP
- Df = Nf and DP $\subset$ NP
Consider three decision problems P1, P2 and P3. It is known that P1 is decidable and P2 is undecidable. Which of the following statements is true?
- P3 is decidable if P1 is reducible to P3.
- P3 is undecidable if P3 is reducible to P2.
- P3 is undecidable if P2 is reducible to P3.
- P3 is decidable if P3 is reducible to P2’s complement.
Consider the languages
L1 {an bn cm | n, m > 0} and L2 {an bm cm | n, m > 0}
- L1 $\cap$ L2 is a context-free language
- L1 $\cup$ L2 is a context-free language
- L1 and L2 are context-free language
- L1 $\cap$ L2 is a context sensitive language
Consider the following languages:
L1 = {WWR | W$\in$ {0, 1}}
L2 = {W # WR |W$\in$ {0, 1}} where # is a special symbol
L3 = {WW | W$\in$ {0, 1}*}
Which of the following statements is true?
- L1 is a deterministic CFL.
- L2 is a deterministic CFL.
- L3 is a CFL, but not a deterministic CFL.
- L3 is a deterministic CFL.
Consider the following two problems on undirected graphs
$\alpha$: Given G(V,E), does G have an independent set of size |V |− 4?
$\beta$: Given G(V,E), does G have an independent set of size 5?
Which one of the following is true?
- $\alpha$ is in the P and $\beta$ is NP-complete
- $\alpha$ is NP-complete and $\beta$ is P
- Both $\alpha$ and $\beta$ are NP-complete
- Both $\alpha$ and $\beta$ are in P






