0% found this document useful (0 votes)
119 views14 pages

TOC PYQs - 2022 To 2024

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views14 pages

TOC PYQs - 2022 To 2024

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Total No. of Questions : 8] SEAT No.

8
23
P806 [5870]-1126
[Total No. of Pages : 2

ic-
tat
T.E. (Computer Engineering)

9s
THEORY OF COMPUTATIONS

8:5
(2019 Pattern) (Semester-I) (310242)

02 91
8:5
0
Time : 2½ Hours] [Max. Marks : 70

20
4/0 13
Instructions to the candidates:
1) Answer Q1 or Q2, Q3 or Q4, Q5 or Q6, Q7 or Q8.
0
7/2
2) Figures to the right side indicate full marks.
.23 GP

3) Neat diagrams must be drawn wherever necessary.


4) Assume suitable data, if necessary.
E
81

8
C

23
ic-
16

Q1) a) Write a grammar G for generating the language [9]

tat
8.2

i) L={w belongs to {a,b}* | w is an even length palindrome with

9s
|w|>0}
.24

8:5
91
ii) Set of odd length strings in {0,1}* with middle symbol ‘1’
49

8:5
30
20

b) Simplify the following grammar [9]


S 0A0|1B1|BB
01
02

A C
7/2
GP

B S|A
4/0

C S|€
CE
81

8
23
OR
.23

ic-
Q2) a) Reduce the following grammar to Greibach Normal form. [9]
16

S AA | 0
tat
8.2

A SS | 1
9s

b) Construct a DFA for the following left linear grammar. [9]


.24

8:5

S C
91
49

8:5

 
30

 C
20

C A0
01
02
7/2
GP

Q3) a) Construct a context free grammar which accepts N(A), where [9]
A = ({q0,q1}, {0,1}, {Z0,Z}, , q0, Z0,  }where  is given by
4/0

q0, 1, Z0) = {(q0, ZZ0)}


CE
81

q0, Z0) = {(q0,)}


.23

q0, Z) = {(q0, Z Z)}


q0, Z) = {(q1, Z)}
16

q1, Z) = {(q1, )}


8.2

(q1, Z0) = {(q0, Z0)}


.24
49

P.T.O.
b) Construct a PDA that accept the language generated by grammar [8]

8
i) S 0S1| A, A  1A0|S|€

23
ic-
ii) S aABB|aAA, A  aBB|a,B  bAA|A

tat
OR

9s
Q4) a) What is NPDA? Construct a NPDA for the set of all strings over {a,b}

8:5
with odd length palindrome. [9]

02 91
8:5
b) Design a push down automaton to recognize the language generated by

0
the following grammar: [8]

20
4/0 13
SS+S|S S|4|2
0
Show the acceptance of the input string 2 + 2*4 by this PDA.
7/2
.23 GP

Q5) a) What is a Turing Machine? Give the formal definition of TM. [9]
E
81

8
C

23
Design a TM that replaces every occurrence of abb by baa.

ic-
b) What are the different ways for extension of TM? Explain. [9]
16

tat
Design TM for language L = {a^i b^j | i<j}
8.2

9s
OR
.24

8:5
Q6) a) What is TM? Design TM to check well formedness of Parenthesis. Expand
91
49

8:5
the transition for (())() [9]
30

b) Elaborate the following terms [9]


20

i) Universal Turing Machine (UTM)


01
02

ii) Recursively Enumerable Languages


7/2
GP

iii) Halting Problem of Turing Machine


4/0
CE
81

8
23
Q7) a) Justify “Halting Problem of Turing machine is undecidable”. [9]
.23

ic-
b) Define the Class P and Class NP and Problem with their example in
16

tat
detail. [8]
8.2

9s
.24

8:5

OR
91
49

8:5

Q8) a) Explain Satisfiability Problem and SAT Problem and comment on NP


30
20

Completeness of the SAT Problem. [9]


01
02

b) What do you mean by polynomial time reduction? Explain with suitable


7/2

example. [8]
GP
4/0
CE
81
.23


16
8.2
.24
49

[5870]-1126 2
Total No. of Questions : 8] SEAT No. :

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

3) Figure to the right indicate full marks.


4) Assume suiable data if necessary.
E
81

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

b) Convert the following grammar to GNF. [9]


01
02

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

Q2) a) Show that the following grammar is ambiguous. [6]


91
49

3:4

S-> iCtS
30
31
01

S-> iCtSes
02
1/2
GP

S-> a
4/0

C-> b
CE
81

b) Convert the following grammar to chomsky normal form (CNF) [6]


.23

G=({S}, {a, b}, P, S)


16

P = {S → aSa | bSb | a | b | aa | bb}


8.2
.24

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

Simulate this PDA for the input string “aaabbbbbb”.

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

Simulate this PDA for the input string “0011100”. [9]


02
1/2
GP

b) Construct a PDA for L= {0n1m2m3n | m,n ≥ 0} [6]


4/0

c) Compare FA and PDA. [3]


CE
81

8
23
.23

ic-
16

tat
Q5) a) Write a short note on Halting problem of Turing machine. [4]
8.2

1s

b) Design a Turing Machine for the following language by Considering


.24

0:1
91

transition table and diagram. [9]


49

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

ii) TM that find 2’s complement of a binary machine.


CE
81

c) Design a Turing Machine that reads a string representing a binary number


.23

and erases all leading 0’s in the string. However, if the string comprises of
16

only 0’s it keeps one 0. [5]


8.2
.24

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

Q7) a) Justify “ Halting problem of Turing machine is undecidable” [8]


E
81

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

c) Differentiate between P Class and NP class. [4]


02
1/2
GP
4/0
CE
81

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
Total No. of Questions : 8] SEAT No. :

8
P269

23
[Total No. of Pages : 2

ic-
[6003]-347

t
T.E. (Computer Engineering)

sta
THEORY OF COMPUTATION

5
0:1
02 91
(2019 Pattern) (Semester-I) (310242)

0:2
6/2 0
31
8/0 13
Time : 2½ Hours] [Max. Marks : 70
Instructions to the candidates:
8 0 P0
1) Answer Q.1 or Q.2, Q.3 or Q.4, Q.5 or Q.6, Q.7 or Q.8.
2) Neat diagrams must be drawn wherever necessary.
.23 G

3) Figures to the right side indicate marks.


CE

8
4) Assume suitable data, if necessary.

23
ic-
16

Q1) a) Give a Context Free Grammar for the following language. [9]

tat
8.2

i) L1={ai bj ck | i = j + k} such that i, j, k > 0

5s
.24

0:1
ii) L2={ai bj ck | j = i + k} such that i, j, k > 0
91
49

b) Reduce the following grammar to Greibach Normal form. [9]


0:2
30
SSS, S0S1 01
31
01

OR
02
6/2

Q2) a) Show that the following grammar is ambiguous. [6]


GP
8/0

S-> iCtS
CE
80

S-> iCtSeS

8
23
.23

S-> a

ic-
16

C-> b
tat
8.2

b) Convert the following grammar to Chomsky Normal Form (CNF). [6]


5s
.24

G=({S}, {a,b}, P,S)


0:1
91
49

P={S aSa | bSb | a | b | aa | bb}


0:2
30

c) Consider the following grammar. [6]


31

E -> E + E | E – E | id
01
02

Derive the string id-id*id using


6/2
.23 G
P

i) Leftmost derivation
8/0
16 E

ii) Rightmost derivation


80
C

Q3) a) Find the transition rules of PDA for accepting a language L={w {a,b}*|w
is of the an bn with n 1}through both empty stack and final state and
8.2

demonstrates the stack operation for the string aaabbb. [9]


.24
49

P.T.O.
b) Design a push down automation to recognize the language generated by

8
the following

23
ic-
grammar :

t
SS + S | S  S | 4 |2

sta
Show the acceptance of the input string 2+2*4 by this PDA. [8]

5
0:1
OR

02 91
Q4) a) What is NPDA? Construct a NPDA for the set of all strings over {a,b}

0:2
6/2 0
with odd length palindrome. [9]

31
8/0 13
b) Design a push down automation to recognize the language generated by
8 0 P0
the following. [8]
SS + S | S  S | 4 |2
.23 G

Show the acceptance of the input string 2+2*4 by this PDA.


CE

8
23
Q5) a) Design a Turing Machine for the following language by considering

ic-
transition table and diagram. [9]
16

tat
i) TM that erases all non blank symbols on the tape where the sequence
8.2

5s
of non blank symbols does not contain any blank symbol B in
.24

0:1
between. 91
49

0:2
ii) TM that find 2’s complement of a binary machine.
30
b) What is TM? Design TM to check well formedness of parenthesis. Expand
31
the transition for (()) () [9]
01
02

OR
6/2
GP

Q6) a) How turing machine can be use to compute the functions? Design turing
8/0

machine for multiplication of two numbers. [9]


CE
80

b) Elaborate the following terms. [9]

8
23
.23

i) Universal Turing Machine (UTM)

ic-
16

ii) Recursively Enumerable Languages


tat
8.2

iii) Halting problem of Turing Machine 5s


.24

0:1

Q7) a) Define and Compare Class P and Class NP Problem with suitable diagram.
91
49

0:2

[9]
30

b) What do you mean by polynomial time reduction? Explain with suitable


31

example. [8]
01
02

OR
6/2
P

Q8) a) Explain Satisfiability Problem and SAT Problem and comment on NP


.23 G
8/0

Completeness of the SAT Problem. [9]


16 E
80

b) What makes a problem NP-Complete? How do we prove a problem is


C

NP-complete? Are all decision problems NP-complete? [8]


8.2


.24

[6003]-347
49

2
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

Instructions to the candidates :


1) Answer Q1 or Q2, Q3 or Q4, Q5 or Q6, Q7 or Q8.
E
80

2) Neat diagrams must be drawn wherever necessary.

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

by following grammar by using Cocke-Younger-Kasami Algorithm- [9]


0:2
91
49

9:4
S  AB|BC
30
30

A  BA|0
01
02

B  CC|1
2/2
GP

C  AB|0
1/1
CE

b) Obtain grammar to generate the following language :


80

[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

Derive using Leftmost Derivation and Rightmost Derivation:


CE
80

i) bbaaba ii) aaabbb.


.23

Draw parse tree for the same.


16
8.2

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
X0

30
1/1 13
X  0X
0
2/2
X  1XX
.23 GP

X  XX1
E
80

8
X  X1X
C

23
ic-
ii) SBD|BC
16

tat
DSC
8.2

5s
CAA
.24

0:2
91
B0
49

9:4
A1
30
30

b) Design a PDA for a language L={anb2n|n > =1} [8]


01
02

OR
2/2
GP

Q4) a) Construct a PDA accepting the language L= a n b m a n | n,m>=0 by null


1/1
CE
80

store. [6]

8
23
.23

b) Design a PDA for a language L={XcX r |X€{a,b}* and string Xr is the


ic-
16

tat
reverse of string X}. [6]
8.2

5s

c) Obtain a PDA to accept the language -


.24

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

Q5) a) Design a Turing machine for well formed parenthesis. [6]


2/2

b) Design a TM that accepts all strings over {1,0} with even number of 0’s
GP
1/1

and even number of 1’s. [8]


CE

c) Construct TM that recognizes language over alphabet 0,1 such that string
80

ends in 10. [4]


.23

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

iii) Church-Turing Thesis.


30
01

OR
02
2/2

Q8) a) What is reducibility in Computability Theory ? Explain in detail, the


GP

polynomial - time reduction approach for proving that a problem is NP-


1/1

Complete.
CE

[8]
80

8
23
b) Explain with suitable example and diagrams [9]
.23

i) Halting problem of TM ic-


16

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
Total No. of Questions : 8] SEAT No. :

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

3) Figures to the right indicates full marks.


4) Assume suitable data, if necessary.
E
81

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

b) i) What is Derivation in CFG?


5/2
GP
8/0
CE

ii) What is relation of parse tree for derivation in CFG?


81

8
23
.23

iii) What is leftmost derivation and Rightmost derivation?


ic-
16

tat
8.2

iv) Explain leftmost derivation and Rightmost derivation with parse


6s

tree. Derive the string a-b+c using leftmost derivation and Rightmost
.24

0:4
91

derivation for the CFG having production rule.


49

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
Bb 8/0 13
0
Xa}
5/2
.23 GP

b) i) What is ambiguity in CFG? What is relation of parse tree for finding


E

ambiguity in CFG.
81

8
C

23
ii) What is leftmost derivation and Rightmost derivation?

ic-
16

iii) Explain leftmost derivation and Rightmost derivation and ambiguity

tat
8.2

for the CFG having production rule.

6s
.24

0:4
G = { S = aSb | SS
91
49

9:4
S = }
30
40

[6]
01
02
5/2
GP

Q3) a) What is pushdown automata? Define PDA pictorially and mathematically


8/0

with respect to input tape, stack, finite control and Instanteous


CE
81

8
description.

23
.23

Design a PDA for accepting a language {anb2n|n>=1}


ic-[8]
16

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

qq
9:4
30
40

q q
01
02

qq
5/2
GP

qq
8/0

qq
CE
81

qq
.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
Sa|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

the following [6]


E
81

8
C

23
grammar :

ic-
16

SS+S|S*S|4|2

tat
8.2

6s
.24

Show the acceptance of the input string 2 + 2*4 by this PDA.


0:4
91
49

9:4
30
40
01
02

Q5) a) Elaborate the following terms with proper examples [4]


5/2
GP
8/0

i) Universal Turing Machine (UTM)


CE
81

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

simulation for the string 11*111. [7]


.24

0:4
91
49

c) Construct a TM for the language L = {0n1n2n} where n [6]


9:4
30
40

OR
01
02
5/2
GP

Q6) a) Construct a TM for substraction of two unary numbers f(a-b) = c where


8/0

a is always greater than b. [5]


CE
81

b) What is undecidability? How do we prove universal language is


.23

undecidable? What is the relation between undecidability and reducibility


16

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

Q8) a) Explain in brief the term “recursively enumerable”. [6]


E

b) Explain examples of problems in NP. [6]


81

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

You might also like