Beruflich Dokumente
Kultur Dokumente
Syllabus :
Regular expressions and finite automata. Context-free grammars and push-down automata. Regular
and contex-free languages, pumping lemma. Turing machines and undecidability.
Exam
year
1990
Ques.
year
Ques.
1991
2007
12
1992
1993
10
2008
13
2009
11
1994
14
1995
1996
1
3
2
2
5
7
2010
2011
1
3
3
3
7
9
2012
1997
2013
1998
1999
5
3
3
1
11
5
2014Set 1
2000
2014Set 2
2001
2002
3
1
2
6
7
18
2014Set 3
2015Set 1
2003
15
2015Set 2
2004
2005
1
_
4
7
9
14
2015Set 3
2016Set 1
1
3
1
3
3
9
2006
12
2016Set 2
11
Ques.
3
Ques.
Ques.
Marks
6
Ques.
Marks
Theory of Computation
Page no.2
Chapter 1
Finite Automata : Regular Languages
2.
3.
4.
5.
6.
[1990 : 2 Marks]
Let r = 1(1 + 0)*, s = 11*0 and t = 1 * 0 be three
regular expressions. Which one of the following is
true?
(a) L(s) L(r) and L(s) L(t)
(b) L(r) L(s) and L(s) L(t)
(c) L(s) L(t) and L(s) L(r)
(d) L(t) L(s) and L(s) L(r)
[1991 : 2 Marks]
Which of the following regular expression identifies
are true?
(a) r (*) = r *
(b) (r * s *)* = (r + s) *
(c) (r + s) = r* + s*
(d) r * s* = r * + s *
[1992 : 2 Marks]
State True or False with one line explanation. A FSM (Finite
State Machine) can be designed to add two integers of any
arbitrary length (arbitrary number of digits).
[1994 : 1 Marks]
The number of substrings (of all lengths inclusive) that can
be formed from a character string of length n is
(a) n
(b) n2
(c)
(d)
n(n 1)
2
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
1.
n(n 1)
1
2
[1994 : 2 Marks]
Divine Academy for Engineering Competitions | www.daecindia.com |www.gaterank.com
Indias Best Institution for GATE ESE PSUs & SSCJE/AE 9821876102/03/04/06
Page no.3
Theory of Computation
0
0
C
1
8.
9.
[1994 : 2 Marks]
Which of the following definitions below generates the same
languages as L
Where L = {xn yn | n 1}
(i) E xEy | xy
(ii) xy | (x+xyy+)
(iii) x+y+ (a)
(a) (i) only
(b) (i) and (ii)
(c) (ii) and (iii)
(d) (ii) only
[1995 : 2 Marks]
A finite state machine with the follows state table has a single
input X and a single output Z.
present state next state, z next state, z
x 1
x0
A
D, 0
B, 0
B
B,1
C,1
C
B, 0
D,1
D
10.
B,1
C, 0
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
7.
11.
12.
13.
14.
15.
16.
Page no.4
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
Page no.5
Theory of Computation
18.
19.
20.
21.
22.
(d)
n(n 1)
2
[1998 : 1 Marks]
Let L be the set of all binary strings whose last two symbols
are the same. The number of states in the minimum state
deterministic finite states automaton accepting L is
(b) 5
(a) 2
(c) 8
(d) 3
[1998 : 2 Marks]
Consider the regular expression (0 + 1) (0 + 1)..... n
times. The minimum state finite automaton the
languages represented by this regular expression
contains
(a) n states
(b) n + 1 states
(c) n + 2 states
(d) None of these
[1999 : 1 Mark]
Let S and T be language over ={a, b} represented by
the regular expression (a + b*)* and (a + b)*,
respectively. Which of the following is true?
(a) S T
(b) T S
(c) S = T
(d) S T
[2000 : 1 Mark]
Let L denotes the language generated by the grammar
S 0S0 | 00. Which of the following is true?
(a) L = 0+
(b) L is regular but not 0+
(c) L is context free but not regular
(d) L is not context free
[2000 : 1 Mark]
What can be said about a regular language L over {a}
whose minimal finite state has two states?
(a) Can be {an | n is odd}
(b) Can be {an | n is even}
(c) Can be {a n 0}
(d) Either L can be {an | n is odd} or L can be {an | n is
even}
[2000 : 2 Marks]
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
17.
Page no.6
23.
24.
25.
26.
27.
A
0/00
1/01
B
0/01
1/10
C
1/10
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
(a) Output the sum of the present and the previous bits of the
input
(b) Output 01 whenever the input sequence contains 11
(c) Output 00 whenever the input sequence contains 10
(d) None of the above
[2002 : 2 Marks]
Divine Academy for Engineering Competitions | www.daecindia.com |www.gaterank.com
Indias Best Institution for GATE ESE PSUs & SSCJE/AE 9821876102/03/04/06
Page no.7
28.
29.
0
0
0,1
0
1
30.
Let S denotes 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
(a) 1
(b) 5
(c) 7
(d) 8
[2003: 2 Marks]
Consider the NFA M shown below.
q1
0
1
1,0
q2
q3
1,0
0
31.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
Page no.8
32.
33.
1
0
1
1
34.
35.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
Page no.9
Theory of Computation
36.
Z
0
37.
38.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
0
0
Page no.10
Theory of Computation
Consider the machine M
b
a
b
a
a, b
40.
0/1
1/0
1/1
Q1
Q0
41.
S
b
a
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
39.
Page no.11
42.
a,b
44.
45.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
46.
47.
48.
49.
50.
51.
Page no.12
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
Page no.13
Theory of Computation
q3
b
b
a
q0
q1
q2
52.
53.
54.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Page no.14
Theory of Computation
x
x
y
y
S0
S2
x
y
y
56.
57.
S3
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
55.
Page no.15
Theory of Computation
b
b
p0
p1
p2
p3
c
a
P
b
c
a
q0
q1
q2
q3
a
Q
r0
r1
r2
r3
(b)
b
a
r0
b
r1
r2
a
r3
c
(c)
b
a
r0
b
r1
r2
a
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
r3
c
Page no.16
Theory of Computation
(d)
r0
r1
r2
r3
c
b
58.
S1
S0
a, b
b
b
S3
b
S2
(b)
a, b
S1
S0
b
S3
b
S2
a, b
(c)
a, b
S1
a
b
S0
b
a
a
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
S3
b
S2
a, b
Page no.17
Theory of Computation
(d)
a, b
S1
S0
b
S3
b
S2
a, b
59.
[IT-2007 : 2 Marks]
Which deterministic finite automaton accepts the language
represented by the regular expression R?
(a)
a
b
S0
b
S1
S3
S2
a
S4
(b)
S1
b
a
S2
S0
S3
b
a
S4
(c)
S1
S3
S0
b
a
S2
a, b
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Page no.18
Theory of Computation
(d)
S3
S0
a, b
b
a
S2
[IT-2007 : 2 Marks]
60.
61.
62.
63.
a
a
b
b
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Page no.19
64.
65.
0
1
0
66.
0,1
0,1
1
1
M2
M1
(a) L1 = L2
(b) L1 L 2
(c) L1 L2
(d) L1 L 2 L1
[IT-2008 : 2 Marks]
Given below are two finite state automata ( indicates the
start and F indicates a final states)
Y:
Z:
1 1 2
1 2 2
2(F) 2 1
2(F) 1 1
Q
R
R(F) Q
S
P
(c)
Q
R
R(F) Q
S
P
(d)
a
P
Q S
Q
R S
R(F) Q P
S
Q P
Q
S R
R(F) Q P
S
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
[2008 : 2 Marks]
Divine Academy for Engineering Competitions | www.daecindia.com |www.gaterank.com
Indias Best Institution for GATE ESE PSUs & SSCJE/AE 9821876102/03/04/06
Page no.20
Theory of Computation
Match List-I with List-II and select the correct answer using
the codes given below the lists:
List-I
(a)
1
0
0
(b)
1
1
0
(c)
1
1
0
(d)
1
1
0
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
67.
Page no.21
Theory of Computation
List-II
A B C D
(a) 2 1 3 4
(b)
(c)
(d)
68.
1
1
3
3
2
2
2
3
1
4
4
4
[2008 : 2 Marks]
Which of the following are regular sets?
1. {a n b 2m | n 0, m 0}
2. {a n b m | n 2m}
3. {a n b m | n m}
4. {xcy | x, y {a, b}*}
(a) 1 and 4 only
(c) 1 only
69.
70.
0
0
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
1. + 0(01 * 1 + 00)*01*
2. + 0(10 * 1 + 00)*0
3. + 0(10 * 1 + 10)*1
4. + 0(10 * 1 + 10)*10*
Codes :
Page no.22
71.
72.
73.
74.
(d) * Q
[2011 : 1 Mark]
Definition of a language L with alphabet {a} is given as follows:
L = {ank | k > 0, and n is a positive integer constant}.
What is the minimum number of states needed in a dfa to
recognize L?
(a) k + 1
(b) n + 1
n+1
(c) 2
(d) 2k+1
[2011 : 2 Marks]
A deterministic finite automaton (DFA) D with alphabet
= {a, b} is given below:
(c) * P
75.
76.
p
a
a, b
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
a, b t
a, b
Page no.23
Theory of Computation
a, b
a
s
a, b
(b)
a, b
s
b
p
a, b
a, b
(c)
a
p
a, b
a, b
(d)
b
p
a
s
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
a, b
[2011 : 2 Marks]
Divine Academy for Engineering Competitions | www.daecindia.com |www.gaterank.com
Indias Best Institution for GATE ESE PSUs & SSCJE/AE 9821876102/03/04/06
Page no.24
Theory of Computation
(a)
(c) a*
78.
79.
(b) {}
(d) {a, }
[2012 : 1 Mark]
Given the language L = {ab, aa, baa}, which of the following
strings are in L*?
1. abaabaaabaa
2. aaaabaaaa
3. baaaaabaaaab
4. baaaaabaa
(a) 1, 2 and 3
(b) 2, 3 and 4
(c) 1, 2 and 4
(d) 1, 3 and 4
[2012 : 1 Mark]
Consider the set of strings on {0, 1} in which, every substring
of 3 symbols has at most two zeros. For example, 001110
and 011001 are in the language, but 100010 is not. All strings
of length less than 3 are also in the language. A partially
complete DFA that accepts this language is shown below.
The missing arcs in the DFA are
00
0
0
01
0
11
1
10
0,1
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
77.
Page no.25
Theory of Computation
(a)
00 01 10 11 q
00 1 0
01
1
10 0
11
(b)
00 01 10 11 q
00
0
1
01
1
10
0
11
(c)
00 01 10 11 q
00
1
0
01
1
10
0
11
(d)
00 01 10 11 q
00
1
0
01
1
10 0
11
[2012 : 2 Marks]
80.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Page no.26
Theory of Computation
81.
0.1
83.
1
1
q1
0,1
q2
0,1
q3
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Page no.27
Theory of Computation
1
I. 0*1 (1 + 00* 1)*
II. 0*1*1 + 11* 0* 1
III. (0 + 1)* 1
(a) I and II only
(c) II and III only
85.
If L1 {a n | n 0} and L2 {b n | n 0} , consider
I. L1 L2 is a regular language
II. L1 L2 = {a nb n | n 0}
Which one of the following is CORRECT?
(a) Only I
(b) Only II
(c) Both I and II
(d) Neither I nor II
[2014 (Set-2) : 1 Mark]
86.
87.
88.
b
M:
a
a
b
N:
b
b
a
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
84.
Page no.28
Theory of Computation
90.
Consider alphabet
91.
92.
93.
(b) L2 only
(d) L3 only
[2015 (Set-2) : 2 Marks]
The number of states in the minimal deterministic finite
automaton corresponding to the regular expression (0+1)*
(10) is ______.
[2015 (Set-2) : 2 Marks]
Let L be the language represented by the regular expression
*0011 * where {0,1} . What is the minimum number
of states in a DFA that recognize L (complement of L)?
(a) 4
(b) 5
(c) 6
(d) 8
[2015 (Set-3) : 1 Mark]
Which of the following languages is generated by the given
grammar?
S aS | bS |
(a) {a nb m | n, m 0}
(b) {w {a, b}* | w has equal number of as and bs}
(c) {a n | n 0} {b n | n 0} {a nb n | n 0}
(d) {a, b)*
[2016 (Set-1) : 1 Mark]
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
89.
Theory of Computation
94.
Page no.29
95.
96.
97.
x L (G ) ?
III. Given CFGs G1 & G2, is L(G1) = L(G1)?
IV. Given a TM, M is L ( M ) ?
(a) I and IV only
(b) II and III only
(c) III and IV only
(d) II and IV only
[2016 (Set-1) : 1 Mark]
Which one of the following regular expressions represents
the language: the set of all binary strings having two
consecutive 0s and two consecutive 1s?
(a) (0+1)*0011(0+1)* + (0+1)*1100(0+1)*
(b) (0+1)*(00(0+1)*11 + 11(0+1)*00)(0+1)*
(c) (0+1)*00(0+1)* + (0+1)*11(0+1)*
(d) 00(0+1)*11 + 11(0+1)*00
[2016 (Set-1) : 1 Mark]
The number of states in the minimum sized DFA that accepts
the language defined by the regular expression (0+1)* (0+1)
(0+1)* is_______.
[2016 (Set-2) : 1 Mark]
Consider the following two statements:
I. If all states of an NFA are accepting states then the
language accepted by the NFA is *.
II. There exists a regular languages A such that for all
languages B, A B is regular..
Which one of the following is CORRECT?
(a) Only I is true
(b) Only II is true
(c) Both I and II are true
(d) Both I and II are false
[2016 (Set-2) : 2 Marks]
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
(c)
(a,c)
(b)
(d)
(a)
(b)
(c)
(d)
(b)
(d)
(d)
(a)
(c,d)
(d)
(b)
(b)
(c)
(b)
(d)
(a)
(b)
(d)
(d)
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
(a)
(b)
(c)
(b)
(c)
(b)
(a)
(b)
(a)
(a)
(b)
(d)
(b)
(b)
(d)
(a)
(a)
(c)
(b)
(a)
(c)
(d)
(b)
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
(a)
(c)
(c)
(b)
(a)
(d)
(c)
(b)
(b)
(a)
(c)
(c)
(a)
(a)
(d)
(a)
(a)
(c)
(a)
(c)
(c)
(b)
(c)
73.
74.
75.
76.
77.
78
79.
80.
81.
82.
83.
84.
85.
86.
89.
90.
92.
93.
94.
95.
97.
(a)
(c)
(b)
(a)
(b)
(c)
(d)
(a)
(d)
(c)
(a)
(b)
(a)
(a)
(c)
(a)
(b)
(d)
(c)
(b)
(b)
Theory of Computation
Page no.31
Space For Rough Work
1.
2.
3.
4.
5.
6.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Chapter 2
Push Down Automata: CFL & DCFL
7.
8.
9.
10.
Page no.32
(c) L1 L2
(d) L1 L2
[1996 : 2 Marks]
Let G be a context free grammar with productions given
below.
S ABCD
A aA |
B bB |
C d
Transform the grammar G to an equivalent form G that has
no productions and no unit productions.
[1996 : 2 Marks]
Which of the following language over {a, b, c} is accepted
by a deterministic push down automata?
(a) {wcw R | w {a, b}*}
(b) {ww R | w {a, b, c}*}
11.
12.
(c) {a n b n c n | n 0}
(d) {w | w is a palindrome over {a, b, c}}
[1997 : 2 Marks]
Which of the following statement is false?
(a) Every finite subset of a non-regular set is regular
(b) Every subset of a regular set is regular
(c) Every finite subset of a regular set is regular
(d) The intersection of two regular sets is regular
[1998 : 2 Marks]
Context free languages are closed under
(a) union, intersection
(b) union, kleene closure
(c) intersection, complement
(d) complement, kleene closure
[1999 : 1 Mark]
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
Theory of Computation
13.
Page no.33
(c) L D L E
(d) None of the above
14.
[1999 : 1 Mark]
If L1 is a context free language and L2 is a regular language
which of the following is are false?
(a) L1 L2 is not context free
(b) L1 L 2 is context free
(c) ~L1 is context free
(d) ~ L2 is regular
15.
16.
17.
[1999 : 2 Marks]
Which of the following statement is true?
(a) if a language is context free it can always be accepted by
a deterministic push-down automaton
(b) the union of two context free language is context free
(c) the intersection of two context free languages is context
free
(d) the complement of a context free languages is context
free
[2001 : 1 Mark]
The language accepted by a Pushdown Automaton in which
the stack is limited to 10 items is best described as
(a) context free
(b) regular
(c) deterministic context free
(d) recursive
[2001 : 1 Mark]
Let G = ({S}, {a, b}, R, S) be a context free grammar
where the rule set R is
S a S b| S S |
Which of the following statements is true?
(a) G is not ambiguous
(b) There exist x, y, L(G) such that xy L(G)
(c) There is a deterministic pushdown automaton that accepts
L(G)
(d) We can find a deterministic finite state automaton that
accepts L(G)
[2003 : 2 Marks]
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
(b) L D L E
Page no.34
18.
19.
20.
21.
22.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
[2004 : 2 Marks]
Let L be regular language and M be a context-free language,
both over the al phabet . Let L c and M c denote the
complements of L and M respectively.
Which of the following statements about the language
Lc M c is TRUE?
(a) It is necessarily regular but not necessarily context-free.
(b) It is necessarily context-free.
(c) It is necessarily non-regular.
(d) None of the above
[IT-2005 : 1 Mark]
Divine Academy for Engineering Competitions | www.daecindia.com |www.gaterank.com
Indias Best Institution for GATE ESE PSUs & SSCJE/AE 9821876102/03/04/06
23.
24.
Page no.35
25.
26.
L1 {ww R | w {0,1}*}
L 2 {w # w R | w {0,1}*} , where # is a special symbol
L3 {ww | w {0,1}*}
Which one of the following is TRUE?
(a) L1 is a deterministic CFL
(b) L2 is a deterministic CFL
(c) L3 is a CFL, but not a deterministic CFL
(d) L3 is a deterministic CFL
[2005 : 2 Marks]
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
Theory of Computation
Let L 1 {0 n m1n 0 m | n, m 0},
L 2 {0
28.
29.
n m nm
0 | n, m 0}, and
(a) {a n b n c n | n 0}
(b) {a1b m c n | l m or m n}
(c) {a n b n | n 0}
(d) {a m b n | m, n 0}
30.
31.
[IT-2006 : 2 Marks]
Let L be a context-free language and M a regular language.
Then the language L M is
(a) always regular
(b) never regular
(c) always a deterministic context-free language
(d) always a context-free language
[IT-2006 : 2 Marks]
Consider the pushdown automaton (PDA) below which runs
over the input alphabet (a, b, c). It has the stack alphabet
{Z0, X} where Z0 is the bottom-of-stack marker. The set of
states of the PDA is {s, t, u, f} where is the start state and f
is the final state. The PDA accepts by final state. The
transitions of the PDA given below are depicted in a standard
manner. For example, the transition (s, b, X) (t, XZ0)
means that if the PDA is in state s and the symbol on the top
of the stack is X, then it can read b from the input and move
to state after popping the top of stack and pushing the symbols
Z0 and X (in that order) on the stack.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
27.
Page no.36
Theory of Computation
Page no.37
(s, , Z0 ) (f , )
(s, b, X) (t, )
(t, c, X) (u, )
(u, c, X) (u, )
32.
(u, , Z0 ) (f , )
The language accepted by the PDA is
(a) {al bm cn| l = m = n}
(b) {al bm cn| l = m}
(c) {al bm cn| 2l = m + n}
(d) {al bm cn| m = n}
[IT-2006 : 2 Marks]
In the context-free grammar below, S is the start symbol, a
and b are terminals, and denotes the empty string.
S aSAb |
A bA |
The grammar generates the language
(a) ((a + b)* b)*
(b) {a m b n | m n}
(c) {ambn | m = n}
(d) a* b*
33.
34.
[IT-2006 : 2 Marks]
Consider the following statements about the context-free
grammar,
G {S SS,S ab,S ba,S }
1. G is ambiguous.
2. G produces all strings with equal number of as and bs.
3. G can be accepted by a deterministic PDA.
Which combination below expresses all the true statements
about G?
(a) 1 only
(b) 1 and 3 only
(c) 2 and 3 only
(d) 1, 2 and 3
[2006 : 2 Marks]
Consider an ambiguous grammar G and its unambiguous
version D. Let the language recognized by the two grammars
be denoted by L(G) and L(D) respectively. Which one of
the following is true ?
(a) L(D) L(G)
(b) L(D) L(G)
(c) L(D) = L(G)
(d) L(D) is empty
[2007 : 1 Mark]
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
(t, b, X) (t, )
36.
37.
38.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Page no.38
Theory of Computation
35.
Consider the following grammars. Names representing
terminals have been specified in capital letters.
G1: stmnt WHILE (expr) stmnt
stmnt OTHER
expr ID
G2: stmnt WHILE (expr) stmnt
stmnt OTHER
expr expr + expr
expr expr * expr
expr ID
Which one of the following statements is true?
(a) G1 is context-free but not regular and G2 is regular
(b) G2 is context-free but not regular and G1 is regular
(c) Both G1 and G2 are regular
(d) Both G1 and G2 are context-free but neither of them is
regular
[IT-2007 : 2 Marks]
Page no.39
39.
Match List-I with List-II and select the correct answer using
the codes given below the lists:
List-I
A. Checking that identifies are declared before their use
B. Number of formal parameters in the declaration of a
function agrees with the number of actual parameters in
a use of that function
C. Arithmetic expressions with matched pairs of parentheses
D. Palindromes
List-II
1. L {a n b m c n d m | n 1, m 1}
2. X X b X | X c X |d X f | g
3. L {wcw | w (a |b)*}
4. X b X b | c X c |
Codes:
A
B
(a) 1
3
(b) 3
1
(c) 3
1
(d) 1
3
C
2
4
2
4
D
4
2
4
2
[2008 : 2 Marks]
40.
L1 {a i b jc k | i j, k 1}
L 2 {a i b j | j 2i,i 0}
Which of the following is true?
(a) L1 is not a CFL but L2 is
(b) L1 L 2 and L1 is non-regular
(c) L1 L 2 is not a CFL but L2 is
41.
S AA | B
A 0A | A0 |1
B 0B00 |1
S is the start symbol, A and B are non-terminals and 0 and 1
are the terminals. The language generated by this grammar is
(a) {0n 102n | n 1}
(b) {0i 10 j 10k | i, j, k 0} {0n 102n | n 1}
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
Theory of Computation
Page no.40
42.
43.
44.
45.
46.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
A aAb | bAa |
[2009 : 1Mark]
Divine Academy for Engineering Competitions | www.daecindia.com |www.gaterank.com
Indias Best Institution for GATE ESE PSUs & SSCJE/AE 9821876102/03/04/06
Page no.41
Theory of Computation
0
1
Input
0
0
0
0
1
1
Next
Next
State A State B
0
0
1
0
0
1
1
0
0
1
0
0
1
1
0
0
1
0
Output
1
0
0
0
0
1
1
1
L 2 {a i b j c k | i, j, k 0}
49.
Then L is
(a) not recursive
(b) regular
(c) context-free but not regular
(d) recursively enumerable but not context-free
[2009 : 2 Mark]
Consider
the
language
L1 {0i1j | i j} ,
L2 {0i1j | i j} , L3 = (0 i 1 j | i = 2j + 1},
L4 {0i1j | i 2 j} .
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
[2010 : 2 Marks]
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
47.
Theory of Computation
50.
Page no.42
51.
52.
(b) L1 L 2 is context-free
(c) Complement of L2 is recursive
(d) Complement of L1 is context-free but not regular
[2013 : 2 Marks]
Consider the following languages over the alphabet
= {0, 1, c}:
L1 {0 n1n | n 0}
L2 {wcwr | w {0,1}*}
L3 {wwr | w {0,1}*}
Here, wr is the reverse of the string w. Which of these
languages are deterministic Context-free languages?
(a) None of the languages
(b) Only L1
(c) Only L1 and L2
(d) All the three languages
[2014 (Set-3) : 2 Marks]
53.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Page no.43
Theory of Computation
0, 1Z
1, 0Z
1Z
0Z
q0
q1
0/1/, Z
54.
Z
Z
55.
56.
G2: S aA | bB, A aA | B | , B bB |
Which one of the following pairs of languages is generated
by G1 and G2 , resepectively?
(a) {ambn | m > 0 or n > 0} and {ambn | m > 0 and n > 0}
(b) {ambn | m > 0 and n > 0} and {ambn | m > 0 and n 0}
(c) {ambn | m 0 or n > 0} and {ambn | m > 0 and n > 0}
(d) {ambn | m 0 or n > 0} and {ambn | m > 0 and n > 0}
[2016 (Set-13) : 2 Marks]
Consider the transition diagram of a PDA given below with
input alphabet = {a, b} and stack alphabet { X , Z }. Z
is the initial stack symbol. Let L denote the language accepted
by the PDA.
a,X/XX
a,Z/XZ
b, X /
b, X /
,Z/Z
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
1, Z
0, Z
Page no.44
Theory of Computation
Which one of the following is TRUE?
57.
58.
L2 {a n b n c 2 n : n 1}
Which one of the following is TRUE?
(a) Both L1 and L2 are context-free.
(b) L1 is context-free while L2 is not context-free
(c) L2 is context-free while L1 is not context-free
(d) Neither L1 nor L2 is context-free
[2016 (Set-2) : 2 Marks]
Language L1 is defined by the grammar:
S1 aS1b |
Language L1 is defined by the grammar:
59.
S2 abS2 |
Consider the following statements:
P: L1 is regular
Q: L2 is regular
Which one of the following is TRUE?
(a) Both P and Q are true
(b) P is true and Q is false
(c) P is false and Q is true
(d) Both P and Q are false
[2016 (Set-2) : 1 Mark]
Which one of the following grammars is free from left
recursion?
(a)
(b)
S AB
A Aa | b
S Ab | Bb | c
A Bd |
Bc
Be
(c)
(d)
S Aa | B
A Bb | Sc |
Bd
S Aa | Bb | c
A Bb |
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
B Ae |
(c)
(a,c)
(a,d)
(c)
(c)
(c)
(b)
(a)
(b)
(b)
(a)
(a,c)
(b)
(b)
(c)
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
(c)
(b)
(b)
(c)
(d)
(d)
(d)
(a)
(b)
(d)
(b)
(b)
(d)
(c)
(b)
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
(b)
(c)
(d)
(b)
(d)
(c)
(c)
(b)
(b)
(d)
(a)
(b)
(d)
(b)
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
(a)
(c)
(d)
(c)
(d)
(c)
(b)
(b)
(d)
(a)
(b)
(c)
(b)
Theory of Computation
Page no.46
Space For Rough Work
1.
2.
3.
4.
5.
6.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Chapter3
Turing Machine: RE, REC and
Undecidability
7.
8.
9.
10.
11.
Page no.47
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
12.
13.
14.
15.
16.
Page no.48
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
Page no.49
Theory of Computation
0
17.
18.
q1 ,1, R q1 ,1, R
Halt
q1 ,1, R q 0 ,1, L q 0 , B, L
19.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
q0
q1
Theory of Computation
20.
Page no.50
Let L1 be regular lanuguage, L2 be a deterministic contextfree language and L3 a recursively enumerable, but not
recursive, language. Which one of the following statements
is false?
(b) L3 L1 is recursive
(c) L1 L 2 is context free
21.
22.
23.
24.
25.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
(b) 1, 2
(d) 3, 4
[2012 : 1 Mark]
Which of the following statements is/are FALSE?
1. For every non-deterministic Turing machine, there exists
an equivalent deterministic Turing machine.
2. Turing recognizable languages are closed under union
and complementation.
3. Turing decidable languages are closed under intersection
and complementation.
4. Turing recognizable languages are closed under union
and intersection.
(a) 1 and 4 only
(c) 2 only
29.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Page no.51
Theory of Computation
26.
Which of the following pairs have DIFFERENT expressive
power?
(a) Deterministic finite automata (DFA) and Non-deterministic
finite automata (NFA)
(b) Deterministic push down automata (DPDA) and Nondeterministic push down automata (NPDA)
(c) Deterministic single-tape Turing machine and Nondeterministic single-tape Turing machine
(d) Single-tape Truing machine and multi-tape Turing machine
[2011 : 1 Mark]
27.
Whcih of the following problems are decidable?
1. Does a given program ever produce an output?
Theory of Computation
30.
Page no.52
32.
33.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
(b) One of L and L is r.e. but not recursive; the other is not r.e.
Page no.53
Theory of Computation
35.
36.
4. L1 L 2 is recursively enumerable
(a) 1 only
(b) 3 only
(c) 3 and 4 only
(d) 1 and 4 only
[2015 (Set-1) : 1 Mark]
Consider the following statements:
1. The complement of every Turning decidable language is
Turning decidable
2. There exists some language which is in NP but is not
Turing decidable
3. If L is a language in NP, L is Turing decidable
Which of the above statements is/are True?
(a) Only 2
(b) Only 3
(c) Only 1 and 2
(d) Only 1 and 3
[2015 (Set-2) : 1 Mark]
37.
38.
L3 L4 is recursively enumerable
II. L 2 L3 is recursive
III. L*1 L2 is context-free
IV. L1 L 2 iscontext-free
(a) I only
(c) I and IV only
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
Theory of Computation
Consider the following languages.
Divine academy for Engineering Competitions | Indias Best Institution for GATE ESE PSUs & SSC JE/AE
39.
Page no.54
(b, d)
(b, c)
(a, d)
(c)
(a, c)
(c)
(d)
(b)
(b)
(a)
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
(b)
(b)
(a)
(d)
(a)
(c)
(b)
(d)
(b)
(b)
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
(d)
(d)
(b)
(b)
(b)
(d)
(c)
(d)
(c)
(b)
32.
33.
34.
35.
36.
37.
38.
39.
(d)
(c)
(a)
(d)
(d)
(c)
(d)
(c)