Theory of Automata (CS402) Total marks = 20
Assignment # 02
Spring 2021 Deadline 04
June, 2021
Please carefully read the following instructions before attempting the
assignment.
RULES FOR MARKING
It should be clear that your assignment would not get any credit if:
The assignment is submitted after the due date.
The submitted assignment does not open or the file is corrupt.
Strict action will be taken if the submitted solution is copied from any
other student or the internet.
You should concern the recommended books to clarify your concepts as
handouts are not sufficient.
You are supposed to submit your assignment in Doc or Docxformat.
Any other formats like scan images, PDF, Zip, Rar, Ppt, and Bmp,etc will not be
accepted.
Topic Covered:
The objective of this assignment is to assess the understanding of students about:
The concept of languages
Regular Expressions
Transition Graphs
Generalized Transition Graph
Finite automata.
NOTE
No assignment will be accepted after the due date via email in any case
(whether it is the case of load shedding or internet malfunctioning etc.).
Hence refrain from uploading assignments in the last hour of the deadline.
It is recommended to upload the solution file at least two days before its
closing date.
If you people find any mistake or confusion in the assignment (Question
statement), please consult with your instructor before the deadline. After the
deadline, no queries will be entertained in this regard.
For any query, feel free to email at:
[email protected] Bc180405548
Ashir Rafiq
Question No 1: Marks: 10
Let FA1:
And FA2:
Construct an FA3 defining the UNION of FA1 and FA2. Also, write the regular
expression for FA3.
Sol:
Old state A b
-X,1=z1 Y,2=z2 X,1=z1
+Y,2=z2 Y,2=z2 X,3=z3
+X,3=z3 Y,3=z4 X,3=z3
+Y,3=z4 Y,3=z4 X,3=z3
Fa3 a
Diagram: b
Z1-
a +Z2
b b
a
+Z3 b
+Z4
R.E= a
b aa * b(b aa b)
* * *
Question No 2: Marks: 10
Construct a regular expression and Transition Graph (TG) defining the following
language over ∑={x,y}:
All strings of x’s and y’s having y, x, and y as a subsequence.
SOL:
R.E= ( x y) * y( x y )* x( x y ) y ( x y )
* *
T.G=
(x+y)
(x+y) (x+y)
(x+y)
-Z1 Y Z2 Z3 x +Z4
y