You are on page 1of 2

Bangladesh University of Business & Technology (BUBT)

Department of Computer Science and Engineering


Semester Final Examination: Summer 2021
Course Code: CSE 213 │Course Title: Theory of Computing and Automata Theory
Intake: 45, Program: B.Sc. in CSE

Time–3 hours Marks – 40


[Answer all the questions]

[CO2] 1 a) Determine whether the grammar G with production rules 5

E→ E+E | ExE |E| a


is ambiguous or not for the following string:
"a+axa"
[CO2] b) Consider the following CFG 5
S  0 A0 | 1B1 | BB
AC
BS|A
C  S |

Define whether the following statements are true or false based on the given CFG.
If true then show the derivation.

i) 1001
ii) 0110
iii) 0000
iv) 1111
[CO3] 2 a) Consider the following CFG 5
E  E  T T
T  T  F F
F   E a
Draw the parse trees for the following expressions:

i) axa+a
ii) (a+a)x(axa)

Page 1 of 2
CO3 b) Construct the CFG for the following DFA: 5

[CO3] 3 a) Construct the Push down automata (PDA) for the following language. 5
L= {anbn | n ≥ 0}
Show all the stack conditions for each transition for the following
strings and verify if they are accepted or not:
i) aabb 
ii) {aabbab}
b) Design the PDA for the following CFG and show the stack status for the 5
input –aababb and verify if it is accepted or not.
S  ASB | 
A  aAS | a
B  SbS | A | bb
[CO4] 4 a) Convert the following CFG in to Chomsky Normal form 5
S  AAAB | B
A  aA | B
B b|

b) Design the state diagram of a Turing machine that recognizes the following 5
language:

{bn a 2n | n  1}

Page 2 of 2

You might also like