0% found this document useful (0 votes)
186 views

Be - Computer Engineering - Semester 5 - 2022 - November - Theory of Computation Toc Pattern 2019

This document contains questions for a theory of computation exam. It includes 8 questions ranging from converting grammars to different forms to designing Turing machines and pushdown automata. Some questions involve converting grammars to Chomsky normal form or Greibach normal form. Other questions involve designing PDAs and TMs for specific languages and demonstrating their operations on sample inputs. The document provides details on the number of marks allocated to each sub-question.

Uploaded by

Kshitij Pandey
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)
186 views

Be - Computer Engineering - Semester 5 - 2022 - November - Theory of Computation Toc Pattern 2019

This document contains questions for a theory of computation exam. It includes 8 questions ranging from converting grammars to different forms to designing Turing machines and pushdown automata. Some questions involve converting grammars to Chomsky normal form or Greibach normal form. Other questions involve designing PDAs and TMs for specific languages and demonstrating their operations on sample inputs. The document provides details on the number of marks allocated to each sub-question.

Uploaded by

Kshitij Pandey
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/ 3

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

You might also like