Be - Computer Engineering - Semester 5 - 2022 - November - Theory of Computation Toc Pattern 2019
Be - Computer Engineering - Semester 5 - 2022 - November - Theory of Computation Toc Pattern 2019
8
23
PA-1442 [Total No. of Pages : 3
ic-
[5926]-58
tat
T.E. (Computer Engg.)
1s
THEORY OF COMPUTATION
0:1
(2019 Pattern) (Semester-I) (310242)
02 91
3:4
0
Time : 2½ Hours] [Max. Marks : 70
31
4/0 13
Instructions to the candidates:
1) Answer Q1 or Q2, Q3. orQ4, Q5 or Q6, and Q7 or Q8.
0
1/2
2) Neat diagrams must be drawn wherever necessary.
.23 GP
8
C
23
ic-
Q1) a) Convert the following grammar to Chomsky Normal form (CNF) [9]
16
tat
S → a | aA | B
8.2
1s
A → aBB | ε
.24
0:1
91
49
3:4
B → Aa | b
30
31
S → XB | AA
1/2
GP
4/0
A → a | SA
CE
81
8
B→b
23
.23
X→ a ic-
16
tat
8.2
1s
OR
.24
0:1
3:4
S-> iCtS
30
31
01
S-> iCtSes
02
1/2
GP
S-> a
4/0
C-> b
CE
81
P.T.O.
49
[5926]-58 1
c) Consider the following grammar. [6]
8
23
E-> E + E | E–E | id
ic-
tat
Derive the string id-id*id using
1s
i) Leftmost derivation
0:1
02 91
3:4
ii) Rightmost derivation.
0
31
4/0 13
0
1/2
Q3) a) Find the transition rules of PDA for accepting a language
.23 GP
L={w∈ {a,b}* |w is of the anbn with n ≥ 1} through both empty stack and
E
81
8
final state and demonstrates the stack operation for the string aaabbb.[9]
C
23
ic-
b) Design a PDA for accepting a language {anb2n | n>=1} [9]
16
tat
8.2
1s
.24
0:1
OR
91
49
3:4
Q4) a) Design a PDA for accepting a language {0n1m0n | m, n>=1}.
30
31
01
8
23
.23
ic-
16
tat
Q5) a) Write a short note on Halting problem of Turing machine. [4]
8.2
1s
0:1
91
3:4
30
31
i) TM That erases all non blank symbols on the tape where the
01
sequence of non blank symbols does not contain any blank symbol
02
1/2
B in between.
GP
4/0
and erases all leading 0’s in the string. However, if the string comprises of
16
OR
49
[5926]-58 2
Q6) a) Write short notes on: [4]
8
23
ic-
i) Reducibility
tat
ii) Multi-tape Turing Machine
1s
0:1
b) Construct a Turing Machine for R=aba*b [6]
02 91
3:4
c) Design a TM that multiplies two unary numbers over Σ={1}. Write
0
31
4/0 13
simulation for the string 11*111. [8]
0
1/2
.23 GP
8
C
23
b) Define and compare class P and class NP problem with suitable diagram
ic-
[8]
16
tat
8.2
OR
1s
.24
0:1
Q8) a) Explain in brief the term “recursively enumerable”. [6]
91
49
3:4
b) Explain examples of problems in NP. [6]
30
31
01
8
23
.23
ic-
16
tat
8.2
1s
.24
0:1
91
49
3:4
30
31
01
02
1/2
GP
4/0
CE
81
.23
16
8.2
.24
49
[5926]-58 3