CS 24F Automata Mid2+Student Solution
CS 24F Automata Mid2+Student Solution
Theory
of
Automata
CS-3005
courseInstructor
(s):
Mehreen
Fahad, Dr.
Mehmood, and
ntLabiba
Ms. Tajwar
Ms. MaryamShahbaz
alam,
G,J,K
D,E,H, Roll No
ectionsA,B,C, Course Section Student
Sessional-1|Exam Signature
otal Time (Hrs): 1
otal Marks: 60
btalQuestions: 3
a. [10 Marks] Design cfg for the language L={a'n b'n a mb^t a^t b^m |n,m>=0 ,t0}
b. [10 Marks] Design cfg for equal number of a's and b's in string.
C. [10 Marks] Convert the following NFA to DFA? Show the complete working.
S1
Start So S
b. [10Marks] Let rl and r2 be regular expressions and FA1 and FA2 be finite
automata that
accept exactly the languages defined by rl and r2 respectively. By applying
kleene's theorem,
build another FA that accepts all the words of the
language defined by rl+r2. Show the
complete working.
FA;
a, b b /a, b
To
can be any nuabat
Let
The aa bhcccc
Lotk Akvide into
L
Lett
Questomtto
Ca)
L=iaban Sat
X aXb
2’ bztbt
CsSabSshas
S S a SS bs Sh SSasA
NEA to DEA
Transition table f iven
States
SSo
Sa S
So
SoSs.
/Part No.
Page No.06
Converted DEA
start
So55,S,
Ro
Page No,03
Qesto 03
olt
Stp 3i
o
Page No,04
Union ot
a,b
FA2
+
Page No. 02
QPart No.
FA,tFA, FA