TOC-May Jun 2024 (1) Merged
TOC-May Jun 2024 (1) Merged
8
23
PB3778 [6262]-36
[Total No. of Pages :4
ic-
T.E. (Computer Engineering)
tat
THEORY OF COMPUTATION
6s
0:4
(2019 Pattern) (Semester-I) (310242)
02 91
9:4
Time : 2½ Hours] [Max. Marks : 70
0
40
Instructions to the candidates:
8/0 13
1) Answer Q.1 or Q.2, Q.3 or Q.4, Q.5 or Q.6, Q.7 or Q.8.
0
2) Neat diagrams must be drawn wherever necessary.
5/2
.23 GP
8
C
23
ic-
Q1) a) What is context free Grammar? Define CFG. What are the capabilities of
16
tat
CFG? [8]
8.2
6s
.24
0:4
Give a context Free Grammar for the following language
91
49
9:4
L = { w a, b * | w is a palindrome of odd length}.
30
40
01
02
8
23
.23
tat
8.2
tree. Derive the string a-b+c using leftmost derivation and Rightmost
.24
0:4
91
9:4
30
40
G = {S = S + S
01
02
S = S -S
5/2
GP
8/0
S=a|b|c
CE
81
} [10]
.23
16
OR
8.2
.24
[6262]-36 1 P.T.O.
49
Q2) a) When do we say that CFG is in Greibach Normal Form (GNF)? Explain
8
23
the steps to convert CFG to GNF for following Grammars [12]
ic-
G1 = {S aAB | aB, A aA | a, B bB | b}
tat
G2 = {S aAB | aB, A aA | , B bB | }
6s
0:4
G3 = {S XB | AA
02 91
9:4
A a | SA
0
40
Bb 8/0 13
0
Xa}
5/2
.23 GP
ambiguity in CFG.
81
8
C
23
ii) What is leftmost derivation and Rightmost derivation?
ic-
16
tat
8.2
6s
.24
0:4
G = { S = aSb | SS
91
49
9:4
S = }
30
40
[6]
01
02
5/2
GP
8
description.
23
.23
tat
b) Construct a context free grammar which accepts N (A), where [10]
8.2
6s
A = ({q0, q1}, {0, 1}, {Z0, Z}, ,q0, Z0, where is given by
.24
0:4
91
49
qq
9:4
30
40
q q
01
02
qq
5/2
GP
qq
8/0
qq
CE
81
qq
.23
16
8.2
OR
.24
[6262]-36 2
49
Q4) a) Design a PDA for accepting a language {0n1m0n | m, n>=1}. [6]
8
23
b) Draw a PDA for the CFG given below: [6]
ic-
tat
S aSb
6s
0:4
02 91
Sa|b|
9:4
0
40
8/0 13
And simulate PDA to recognize “aaabb”.
0
5/2
c) Design a push down automation to recognize the language generated by
.23 GP
8
C
23
grammar :
ic-
16
SS+S|S*S|4|2
tat
8.2
6s
.24
9:4
30
40
01
02
8
23
ii) Recursively Enumerable Languages
.23
ic-
16
tat
b) Design a TM that multiplies two unary numbers over = {1}. Write
8.2
6s
0:4
91
49
OR
01
02
5/2
GP
theory. [12]
8.2
.24
[6262]-36 3
49
Q7) a) What do you mean by polynomial time reduction? Explain with an example
8
23
of SAT. [7]
ic-
b) Explain the following terms with respect to computations complexity
tat
with example. [10]
6s
i) Solvable Vs Unsolvable problem
0:4
02 91
ii) Decidable Vs. Undecidable problem
9:4
0
40
iii) P Vs NP problem
8/0 13
OR
0
5/2
.23 GP
8
C
23
c) Differentiate between P class and NP class. [5]
ic-
16
tat
8.2
6s
.24
0:4
91
49
9:4
30
40
01
02
5/2
GP
8/0
CE
81
8
23
.23
ic-
16
tat
8.2
6s
.24
0:4
91
49
9:4
30
40
01
02
5/2
GP
8/0
CE
81
.23
16
8.2
.24
[6262]-36 4
49
Total No. of Questions : 8] SEAT No. :
8
23
P-7858 [Total No. of Pages : 3
ic-
tat
[6180]-46A
5s
T.E. (Computer Engineering)
0:2
02 91
9:4
THEORY OF COMPUTATION
0
30
(2019 Pattern) (Semester - I) (310242)
1/1 13
Time : 2½ Hours] [Max. Marks : 70
0
2/2
.23 GP
8
C
23
3) Figures to the right side indicate full marks.
ic-
4) Assume suitable data, if necessary.
16
tat
8.2
5s
Q1) a) Check whether the string 10010 is a member of the language generated
.24
9:4
S AB|BC
30
30
A BA|0
01
02
B CC|1
2/2
GP
C AB|0
1/1
CE
[8]
8
23
L = {w : na(w) mod 2=0 where w {a, b}*}
.23
ic-
i.e. Language of a and b in which number of number of a’s in the string is
16
tat
either zero or in multiple of 2 only.
8.2
5s
OR
.24
0:2
91
Q2) a) [9]
49
9:4
30
S aB|bA
30
01
A a|aS|bAA
02
2/2
B b|bS|aBB
GP
1/1
P.T.O.
.24
49
b) Find context Free Grammar generating each of these languages. [8]
8
23
i) L1={ai b j ck such that i = j+k where I, j, k > = l}
ic-
ii) L2={ai b j ck such that j = i+k where I, j, k > = l}
tat
5s
Q3) a) Construct a PDA equivalent to following CFG [10]
0:2
02 91
i)
9:4
0
X0
30
1/1 13
X 0X
0
2/2
X 1XX
.23 GP
X XX1
E
80
8
X X1X
C
23
ic-
ii) SBD|BC
16
tat
DSC
8.2
5s
CAA
.24
0:2
91
B0
49
9:4
A1
30
30
OR
2/2
GP
store. [6]
8
23
.23
tat
reverse of string X}. [6]
8.2
5s
0:2
L= w|w€ , a,b and n a w n b w by final state
91
*
49
[6]
9:4
30
30
01
02
b) Design a TM that accepts all strings over {1,0} with even number of 0’s
GP
1/1
c) Construct TM that recognizes language over alphabet 0,1 such that string
80
OR
16
8.2
.24
[6180]-46A 2
49
Q6) a) Construct a TM to accept the language over {0,1} containing the substring
8
001.
23
[6]
ic-
b) Design a TM to multiply a unary number by 2. [8]
tat
c) Design Turing Machine for l’s Complement. [4]
5s
0:2
Q7) a) What is post correspondence problem? Explain PCP with following
02 91
9:4
instance of the set of the strings A and B. [8]
0
30
1/1 13
0
2/2
.23 GP
E
80
8
C
23
ic-
16
tat
8.2
5s
b) State and explain with suitable example [9]
.24
0:2
i) Decidable Problem
91
49
9:4
ii) Undecidable Problem
30
OR
02
2/2
Complete.
CE
[8]
80
8
23
b) Explain with suitable example and diagrams [9]
.23
tat
ii) Multitape TM
8.2
5s
iii) Universal TM
.24
0:2
91
49
9:4
30
30
01
02
2/2
GP
1/1
CE
80
.23
16
8.2
.24
[6180]-46A 3
49