Following questions have been asked in GATE CS 2010 exam.

**1) Let L={w ∈ (0 + 1)*|w has even number of 1s}, i.e. L is the set of all bit strings with even number of 1s. Which one of the regular expression below represents L?**

(A) (0*10*1)*

(B) 0*(10*10*)*

(C) 0*(10*1*)*0*

(D) 0*1(10*1)*10*

Answer (B)

Option (A) is incorrect because it cannot accept “110”

Option (C) is incorrect because it accept a string with single 1.

Option (D) is incorrect because it cannot accept 11101

**2) Let L1 be a recursive language. Let L2 and L3 be languages that are recursively enumerable but not recursive. Which of the following statements is not necessarily true?**

(A) L2 – L1 is recursively enumerable.

(B) L1 – L3 is recursively enumberable

(C) L2 ∩ L1 is recursively enumberable

(D) L2 ∪ L1 is recursively enumberable

Answer (B)

**3) Consider the languages L1={0 ^{i}1^{j} | i != j}, L2={0^{i}1^{j} | i = j}, L3 = {0^{i}1^{j} | i = 2j+1}, L4 = {0^{i}1^{j} | i != 2j}. Which one of the following statements is true?**

(A) Only L2 is context free

(B) Only L2 and L3 are context free

(C) Only L1 and L2 are context free

(D) All are context free

Answer (D)

A Pushdown Automata can be built for all four languages.

**4) Let w be any string of length n is {0,1}*. Let L be the set of all substrings of w. What is the minimum number of states in a non-deterministic finite automaton that accepts L?**

(A) n-1

(B) n

(C) n+1

(D) 2n-1

Answer (C)

We need minimum n+1 states to build NFA that accepts all substrings of a binary string. For example, following NFA accepts all substrings of “010” and it has 4 states.

Please see GATE Corner for all previous year paper/solutions/explanations, syllabus, important dates, notes, etc.

Please write comments if you find any of the answers/explanations incorrect, or you want to share more information about the topics discussed above.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.