Test 1 - Theory of Computation | Computer Science(CS)

Description: GATE Previous year Topic Wise Questions and Answers | Theory of Computation
Number of Questions: 20
Created by:
Tags: GATE CS Theory of Computation
Attempted 0/20 Correct 0 Score 0

The regular expression 0*(10*)* denotes the same set as

  1. (1*0)1

  2. 0+(0+10)*

  3. (0+1)10(0+1)

  4. None of these


Correct Option: D
Explanation:

0* (10*)* = 0* = (1* 0*) (1) (1* 0)* 1* = (1* 0*) 1* (2) 0 + (0 +10)* = 0 + (0*1*0*) (3) (0 + 1)* 10 (0 + 1)* = 0* 1* 10 (0* 1*)

If the strings of a language L can be effectively enumerated in lexicographic (i.e., alphabetic) order, which of the following statements is true?

  1. L is necessarily finite

  2. L is regular but not necessarily finite

  3. L is context free but not necessarily regular

  4. L is recursive but not necessarily context free


Correct Option: B
Explanation:

Since L can be effectively enumerated so L has to be regular, but is doesn't mean that the decisions are finite.

Nobody knows yet if P = NP. Consider the language L defined as follows.

$$L = \begin{cases} (0 +1)^* \text { if } (P = NP) \in E \\ \phi \text{ otherwise} \end{cases}$$

Which of the following statements is true?

  1. L is recursive

  2. L is recursively enumerable but not recursive

  3. L is not recursively enumerable

  4. Whether L is recursive or not will be known after we find out if P = NP


Correct Option: A
Explanation:

A language L is said to be recursive if there exists any rule to determine whether an element belong to language or not, if language can be accepted by turning machine. So there exist the rules so L is recursive.

Consider the following deterministic finite state automaton M.

GATE 2003 Let S denote the set of seven bit binary strings in which the first, the fourth, and the last bits are 1. The number of strings in S that are accepted by M is

  1. 1

  2. 5

  3. 7

  4. 8


Correct Option: C
Explanation:

Ram and Shyam have been asked to show that a certain problem $\prod$is NP-complete. Ram shows a polynomial time reduction from the 3-SAT problem to$\prod$, and Shyam shows a polynomial time reduction from $\prod$to 3-SAT. Which of the following can be inferred from these reductions?

  1. $\prod$ is NP-hard but not NP-complete

  2. $\prod$ is in NP, but is not NP-complete

  3. $\prod$is NP-complete

  4. $\prod$is neither NP-hard, nor in NP


Correct Option: C
Explanation:

Let S be an NP-complete problem and Q and R be two other problems not known to be in NP. Q is polynomial time reducible to S and S is polynomial-time reducible to R. Which one of the following statements is true?

  1. R is NP-complete

  2. R is NP-hard

  3. Q is NP-complete

  4. Q is NP-hard


Correct Option: A
Explanation:

A single tape Turing Machine M has two states q0 and q1, of which q0 is the starting state. The tape alphabet of M is {0, 1, B} and its input alphabet is {0,1}. The symbol B is the blank symbol used to indicate end of an input string. The transition function of M is described in the following table.

0 1 B
q0 q1, 1, R q1, 1, R Halt
q1 q1, 1, R q0, 1, L q0, B, L

The table is interpreted as illustrated below. The entry (q1, 1, R) in row q0 and column 1 signifies that if M is in state q0 and reads 1 on the current tape square, then it writes 1 on the same tape square, moves its tape head one position to the right and transitions to state q1.

Which of the following statements is true about M?

  1. M does not halt on any string in (0+1)+

  2. M does not halt on any string in (00+1)*

  3. M halts on all strings ending in a 0

  4. M halts on all strings ending in a 1


Correct Option: A
Explanation:

Let G = ({S},{a,b},R,S) be a context free grammar where the rule set R is S $\rightarrow$ a S b | S S | $\epsilon$ Which of the following statements is true?

  1. G is not ambiguous

  2. There exist x, y $\epsilon$ L(G) such that xy $\require{cancel} \cancel{\epsilon}$ L(G)

  3. There is a deterministic pushdown automaton that accepts L(G)

  4. We can find a deterministic finite state automaton that accepts L(G)


Correct Option: C
Explanation:

(1) Incorrect since the production has same non terminal in both sides, so definitely ambiguous. (2) Since S $\rightarrow$ SS " this leads to conjunction of every possible string to make a valid string in L(G) . (3) Context free languages are accepted by push down automata so true. (4) The language is not regular so DFA is not possible.

Consider the NFA M shown below.

Let the language accepted by M be L. Let L1 be the language accepted by the NFA M1 obtained by changing the accepting state of M to a non-accepting state and by changing the non-accepting states of M to accepting states. Which of the following statements is true?

  1. L1 = {0,1}* - L

  2. L1 = {0,1}*

  3. L1$\subseteq $ L

  4. L1 = L


Correct Option: A
Explanation:

Consider two languages $L_1$ and $L_2$, each over the alphabet $\Sigma$.

Let $f: \Sigma \to \Sigma$ be a polynomial time, computable bijection, such that:

$$\forall x: \Bigl(x \in L_1 \iff f(x) \in L_2\Bigr )$$

Further, let $f^{-1}$ also be polynomial time computable.

Which of the following canNOT be true?

  1. L1 $\epsilon$ P and L2 is finite

  2. L1 $\epsilon$ NP and L2 $\epsilon$ P

  3. L1 is un decidable and L2 is decidable

  4. L1 is recursively enumerable and L2 is recursive


Correct Option: C
Explanation:

Let SHAM, be the problem of finding a Hamiltonian cycle in a graph G = (V, E) with V divisible by 3 and DHAM' be the problem of determining if a Hamiltonian cycle exists in such graphs. Which one of the following is true?

  1. Both DHAM, and SHAM, are NP-hard

  2. SHAM, is NP-hard, but DHAM, is not

  3. DHAM, is NP-hard, but SHAM, is not

  4. Neither DHAM, nor SHAM, is NP-hard


Correct Option: A

Which of the following problems is undecidable?

  1. Membership problem for CFGs.

  2. Ambiguity problem for CFGs.

  3. Finiteness problem for FSAs.

  4. Equivalence problem for FSAs.


Correct Option: B
Explanation:

Define languages L0 and L1 as follows: L0 = {<M, w, 0> | M halts on w} L1 = {<M, w, 1> | M does not halt on w} Here <M, w, i> is a triplet, whose first component, M, is an encoding of a Turing Machine, second component, w, is a string, and third component, i, is a bit. Let L = L0$\cup$L1. Which of the following is true?

  1. L is recursively enumerable, but $\bar L$ is not

  2. $\bar L$ is recursively enumerable, but L is not

  3. Both L and $\bar L$ are recursive

  4. Neither L nor $\bar L$ is recursively enumerable


Correct Option: B
Explanation:

Let L1 = {0n+m1n0m|n, m$\ge$0}. L2 = {0n+m1n+m0m|n, m$\ge$0} and L3 = {0n+m1n+m0n+m|n, m$\ge$0} Which of these languages are NOT context free?

  1. L1 only

  2. L2 only

  3. L1 and L2

  4. L2 and L3


Correct Option: D
Explanation:

Which of the following is TRUE?

  1. Every subset of a regular set is regular.

  2. Every finite subset of a non-regular set is regular.

  3. The union of two non-regular sets is not regular.

  4. Infinite union of finite sets is regular.


Correct Option: B
Explanation:

For S $\in$ (0 + 1) * let d (s) denote the decimal value of s (e.g. d (101) = 5). Let L = {s $\in$ (0 + 1)* d (s)mod 5 = 2 and d (s) mod 7 $\ne$ 4} Which one of the following statements is true?

  1. L is recursively enumerable, but not recursive

  2. L is recursive, but not context-free

  3. L is context-free, but not regular

  4. L is regular


Correct Option: D
Explanation:

Consider the regular language L = (111 + 11111) *. The minimum number of states in any DFA accepting these languages is:

  1. 3

  2. 5

  3. 8

  4. 9


Correct Option: D
Explanation:

If s is a string over (0 + 1)* then let n0 (s) denote the number of 0's in s and n1 (s) the number of 1's in s. Which one of the following languages is not regular?

  1. L = {s $\in$(0 + 1)*| n0 (s) is a 3-digit prime}

  2. L = {s $\in$(0 + 1)*| for every prefix s' of s1 |n0 (s') - n1 (s')| $\le$2 |

  3. L = {s $\in$(0 + 1)*| n0 (s') - n1 (s')| $\le$4 |

  4. L = {s $\in$(0 + 1)*| n0 (s) mod 7 = n1 (s) mod 5 = 0}


Correct Option: C
Explanation:

Let L1 be a regular language, L2 be a deterministic context-free language and L3 a recursively enumerable, but not recursive, language. Which one of the following statements is false?

  1. L1 $\cap$ L is a deterministic CFL

  2. L3 $\cap$ L1 is recursive

  3. L1 U L2 is context free

  4. L1 $\cap$ L2 $\cap$ L3 is recursively enumerable


Correct Option: B
Explanation:

Consider the following statements about the context free grammar G = {S $\rightarrow$ SS, S $\rightarrow$ ab, S $\rightarrow$ ba, S $\rightarrow$$\in$} I. G is ambiguous II. G produces all strings with equal number of a's and b's III. G can be accepted by a deterministic PDA. Which combination below expresses all the true statements about G?

  1. I only

  2. I and III only

  3. II and III only

  4. I, II and III


Correct Option: B
Explanation:

- Hide questions