Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

COMP454: Theory of Automata Practice Questions

Q1(18 pnts.):
Find context-free grammars to generate the following languages:

i) { (ab)ncmd2n | n > = 0, m > = 1}

j) { anbm | n > = 0, m > = 3n}

k) L1L2 where L1 = { anbn | n > = 0} and L2 = { cndn | n > = 1}

Asst. Prof. Dr. Shahin Mehdipour Ataee Page 1 of 6


COMP454: Theory of Automata Practice Questions
Q2(10 pnts.):
Find a regular grammar that generates the language

{ w | w{0, 1}* , |w| >= 4; w starts with 1 and ends with 10 or 01}.

Asst. Prof. Dr. Shahin Mehdipour Ataee Page 2 of 6


COMP454: Theory of Automata Practice Questions
Q3(12 pnts.):
Find a regular expression that denotes the language accepted by the below finite automaton.

0
E
B
0,1 1 0
S 1
D

1 0
0
C
F

Asst. Prof. Dr. Shahin Mehdipour Ataee Page 3 of 6


COMP454: Theory of Automata Practice Questions
Q4(12 pnts.):
Find a finite automaton (with three states) that accepts the language generated by the grammar:

S → 0S | 1B | 1C | 1
C → 0B | 0
B → 1B | 1C | 0S | 1

Asst. Prof. Dr. Shahin Mehdipour Ataee Page 4 of 6


COMP454: Theory of Automata Practice Questions
Q5(12 pnts.):
Find a deterministic finite automaton (DFA) corresponding to the below NDFA.

0 1
A
0 B
S 0 1

Q6(12 pnts.):
Remove the λ moves from the following state diagram:

1 1

λ 0
S A C
0
λ
0 1
D 0
E
1

Asst. Prof. Dr. Shahin Mehdipour Ataee Page 5 of 6


COMP454: Theory of Automata Practice Questions
Q7(12 pnts.):
Find a minimal (minimum number of states possible) Deterministic Finite Automaton accepting the language
generated by the following grammar:

S → 0C | 1B | 0 | λ
A → 1B | 0C | 0
B → 0C | 1A | 0
C → 0C | 1C | 0 | 1

Q8(12 pnts.):
Find a Turing machine for the language anbnc2ndn:

Asst. Prof. Dr. Shahin Mehdipour Ataee Page 6 of 6

You might also like