Академический Документы
Профессиональный Документы
Культура Документы
THEORY OF COMPUTATION
YEAR 2001
Q. 1
Q. 2
Q. 3
Q. 4
Consider a DFA over S = {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 ?
(A) 8
(B) 14
(C) 15
(D) 48
Q. 5
L4 = {0i i is an integer}
Which of the languages are regular ?
(A) Only L1 and L2
(C) Only L3 and L4
Q. 6
mywbut.com
THEORY OF COMPUTATION
Q. 8
Q. 9
The C language is :
(A) A context free language
(C) A regular language
machine
Q. 10
ONE MARK
Q. 11
Ram and Shyam have been asked to show that a certain problem P is NPcomplete. Ram shows a polynomial time reduction from the 3-SAT problem to P
, and Shyam shows a polynomial time reduction from P to 3-SAT. Which of the
following can be inferred from these reduction?
(A) P is NP-hard but not NP-complete
(b) P is in NP, but is not NP-complete
(C) P is NP-complete
(D) P is neither Np-hard, nor in NP
Q. 12
mywbut.com
THEORY OF COMPUTATION
Q. 13
Q. 14
Q. 15
TWO MARKS
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
(A) 1
(B) 5
(C) 7
(D) 8
Q. 16
Q. 17
Q. 18
mywbut.com
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
q0
THEORY OF COMPUTATION
q1, 1,R
Q1, 1,R
Halt
Q. 20
mywbut.com
ONE MARK
THEORY OF COMPUTATION
YEAR 2004
Q. 22
TWO MARKS
The following finite state machine accepts all those binary strings in which the
number of 1s and 0s are respectively
Q. 23
Q. 24
Q. 25
Q. 26
Consider three decision problem P1, P2 and P3 . It is known that P1 is decidable and
P2 is undecidable. Which one of the following is TRUE?
(A) P3 is decidable if P1 is reducible to P3
(B) P3 is undecidable if P3 is reducible to P2
(C) PL3 is undecidable if P2 is reducible to P3
(D) P3 is decidable if P3 is reducible to P2 s complement
mywbut.com
TWO MARKS
Q. 27
THEORY OF COMPUTATION
Q. 29
Q. 30
Q. 31
mywbut.com
Q. 32
THEORY OF COMPUTATION
ONE MARK
Q. 33
Q. 34
Let
and
L1 = {0n + m 1n 0m | n, m # 0}, L2 = {0n + m 1n + m 0m | n, m # 0},
L3 = {0n + m 1n + m 0n + m | n, m # 0}. Which of these languages are NOT context free?
(B) L3 only
(A) L1 only
(C) L1 and L2
(D) L2 and L3
YEAR 2006
TWO MARKS
Q. 35
If s is a string over (0+1)*, then let n0 (s) denote the number of 0s in s and n1 (s)
the number of 1s in s . Which one of the following languages is not regular?
(A) L = {s ! (0 + 1)*| n0 (s) is a 3-digit prime}
(B) L = {s ! (0 + 1)*| for every prefixes of s,| n0 (s') - n1 (s')| # 2}
(C) L = {s ! (0 + 1)*|| n0 (s) - n1 (s) # 4
(D) L = {s ! (0 + 1)*| n0 (s) mod 7=n1 (s) mod5 = 0 }
Q. 36
For s ! (0 + 1)* let d (s) denote the decimal value of s (e.g.d (101) = 5)
Let L = {s ! (0 + 1)*| d (s) mod 5=2 and d (s) mod 7 ! 4}
Which one of the following statements is true?
(A) L is recursively enumerable, but not recursive
(B) L is recursive, but not context-free
(C) L is context_free, but not regular
(D) Lis regular
Q. 37
mywbut.com
THEORY OF COMPUTATION
Q. 38
Q. 39
Q. 40
Q. 41
Q. 42
ONE MARK
TWO MARKS
Q. 43
Q. 44
mywbut.com
THEORY OF COMPUTATION
Q. 45
Q. 46
Q. 47
The minimum state automaton equivalent to the above FSA has the following
number of states
(A) 1
(B) 2
(C) 3
(D) 4
YEAR 2008
ONE MARK
Q. 48
Q. 49
Which of the
1. Whether
2. Whether
3. Whether
4. Whether
(A) 1 and 2
(C) 2 and 3
Q. 50
mywbut.com
THEORY OF COMPUTATION
YEAR 2008
TWO MARKS
Q. 51
Q. 52
Given below are two finite state automata("indicates the start and F indicates
a final state)
Z:
Y:
a
"
2F
(A)
mywbut.com
"
2F
(B)
a
-P
-P
R(F)
R(F)
(C)
Q. 53
(D)
a
-P
-P
R(F)
R(F)
Q. 54
THEORY OF COMPUTATION
Match List-I with List-II and select the correct answer using the codes given
below the lists:
List-I
List-II
mywbut.com
S
4
2
4
2
Match List I with List II and select the correct answer using the codes given
below the lists:
THEORY OF COMPUTATION
Code:
(A)
(B)
(C)
(D)
Q. 56
a
2
1
1
3
b
1
3
2
2
c
3
3
3
1
d
4
4
4
4
ONE MARK
Q. 57
Q. 58
Which one of the following languages over the alphabet {0, 1} is described by the
regular expression :
(0 + 1))0 (0 + 1))0 (0 + 1)) ?
(A) The set of all strings containing the substring 00
(B) The set of all strings containing at most two 0s
(C) The set of all strings containing at least two 0s
(D) The set of all strings that being and end with either 0 or 1
Q. 59
mywbut.com
Q. 60
THEORY OF COMPUTATION
Match all items in Group I with correct options from those given in Group 2
Group 2
Group 1
1.
Syntax analysis
P.
Regular expression
2.
Code generation
Q.
Pushdown automata
3.
Lexical analysis
R.
Data flow analysis
4.
Code Optimization
S.
Register allocation
YEAR 2009
Q. 61
TWO MARKS
Given the following state table of an FSM with two states A and B , one input
and one output :
Present
State A
Present
State B
Input
Next
State A
Next
State B
Output
Q. 63
The following DFA accept the set of all string over {0, 1} that
mywbut.com
YEAR 2010
Q. 64
THEORY OF COMPUTATION
ONE MARK
TWO MARKS
Q. 65
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 expressions below
represents L ?
(A) (0)10)1))
(B) 0)(10)10)))
(C) 0)(10)1))0)
(D) 0)1 (10)1))10)
Q. 66
Q. 67
Let w by any string of length n in{0, 1}). Let L be the set of all substring so w.
What is the minimum number of states in a non-deterministic finite automation
that accepts L ?
(A) n - 1
(B) n
(C) n + 1
(D) 2n + 1
YEAR 2011
ONE MARK
Q. 68
Q. 69
The lexical analysis for a modern computer language such as Java needs the
power of which one of the following machine models in a necessary and sufficient
sense?
(A) Finite state automata
(B) Deterministic pushdown automata
(C) Non-deterministic pushdown automata
(D) Turing machine
mywbut.com
Q. 70
Q. 71
THEORY OF COMPUTATION
TWO MARKS
Q. 72
Q. 73
Which of the following finite state machines is a valid minimal DFA which accepts
the same language as D?
mywbut.com
THEORY OF COMPUTATION
YEAR 2012
ONE MARK
Q. 74
assuming P =
Y NP , which of the following is TRUE?
(A) NP -complete = NP
(B) NP-complete + P = Q
(C) NP -hard = NP
(D) P = NP -complete
Q. 75
What is the complement of the language accepted by the NFA shown below?
Assume S = "a , and e is the empty string.
(A) Q
(C) a *
Q. 76
(B) " e ,
(D) "a, e,
Q. 77
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
YEAR 2012
Q. 78
mywbut.com
TWO MARKS
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
THEORY OF COMPUTATION
(A)
(B)
00
00
01
10
01
10
11
00
1
0
00
01
10
11
(C)
11
10
11
(D)
00
01
00
01
10
11
10
00
q
0
00
01
10
10
11
1
1
0
11
q
0
01
0
11
**********
mywbut.com
01
THEORY OF COMPUTATION
ANSWER KEY
Theory of Computation
1
10
(A)
(B)
(C)
(C)
(C)
(A)
(B)
(A)
(A)
(B)
11
12
13
14
15
16
17
18
19
20
(C)
(A)
(?)
(D)
(C)
(C)
(C)
(A)
(B)
(C)
21
22
23
24
25
26
27
28
29
30
(C)
(A)
(B)
(C)
(B)
(C)
(B)
(D)
(A)
(B)
31
32
33
34
35
36
37
38
39
40
(B)
(?)
(B)
(D)
(C)
(D)
(?)
(B)
(B)
(D)
41
42
43
44
45
46
47
48
49
50
(B)
(B)
(A)
(B)
(C)
(C)
(B)
(D)
(B)
(D)
51
52
53
54
55
56
57
58
59
60
(D)
(A)
(C)
(C)
(C)
(A)
(B)
(C)
(D)
(B)
61
62
63
64
65
66
67
68
69
70
(A)
(C)
(A)
(B)
(B)
(D)
(C)
(B)
(A)
(C)
71
72
73
74
75
76
77
78
(C)
(B)
(A)
(B)
(B)
(D)
(C)
(D)
mywbut.com