Assignment No:
1
Course Title & Code
Theory of Automata
Submitted By:
Aqeela Tahir
Registration No:
2023f-mulbscs-032
Semester/Class/ Section:
3rd /BSCS/E
Mid
Student’s Signature:
Note: *Please avoid cutting/ overwriting in any of the above fields.
*Complete the task on standard A4 size papers/assignment pages.
*For Instructor’s use only.
Total Marks:
Obtained Marks:
Signatures:
Faculty of CS & IT
School of Software Engineering
Minhaj University Lahore
Final
Q1. DFA Description and State Diagram
Q 2: Consider the finite automaton in Figure below. Try the following types
of strings on the FA to see if it accepts them.abbaabbbabaa, abaabbaabba,
babbbaba, bbaabbaabb What language do you think the FA may be
accepting?
Test the Given Strings
1. abbaabbbabaa
Let’s trace it step by step:
•
Q0 → Q1 (b)
•
Q1 → Q1 (b)
•
Q1 → Q3 (a)
•
Q3 → Q0 (b) (No transition on b from Q3 in your image)
Oops! Actually, Q3 has a transition to Q2 on b. So, correcting:
•
Q1 → Q3 (a)
•
Q3 → Q2 (b)
•
Q2 → Q4 (a)
•
Q4 → Q4 (a)
•
Q4 → Q5 (b)
•
Q5 → Q5 (b)
•
Q5 → Q5 (a)
•
Q5 → Q5 (b)
•
Q5 → Q5 (a)
•
Q5 → Q5 (a)
Ends at Q5 → Accepted
2. abaabbaabba
•
Q0 → Q1 (b)
•
Q1 → Q3 (a)
•
Q3 → Q2 (b)
•
Q2 → Q4 (a)
•
Q4 → Q4 (a)
•
Q4 → Q5 (b)
•
Q5 → Q5 (b)
•
Q5 → Q5 (a)
•
Q5 → Q5 (b)
•
Q5 → Q5 (a)
Ends at Q5 → Accepted
3. babbbaba
•
Q0 → Q1 (b)
•
Q1 → Q1 (b)
•
Q1 → Q1 (b)
•
Q1 → Q3 (a)
•
Q3 → Q2 (b)
•
Q2 → Q4 (a)
•
Q4 → Q5 (b)
•
Q5 → Q5 (a)
Ends at Q5 → Accepted
4. bbaabbaabb
•
Q0 → Q1 (b)
•
Q1 → Q1 (b)
•
Q1 → Q3 (a)
•
Q3 → Q2 (b)
•
Q2 → Q4 (a)
•
Q4 → Q4 (a)
•
Q4 → Q5 (b)
•
Q5 → Q5 (a)
•
Q5 → Q5 (b)
•
Q5 → Q5 (b)
Ends at Q5 → Accepted
What Language Does This DFA Accept?
Observation:
All strings that:
1. Start from Q0
2. Follow a specific combination of a’s and b’s that eventually reaches Q5,
the final state
3. Once at Q5, any sequence of a’s and b’s is accepted (due to loops on
both a and b)
Key Pattern:
The DFA appears to be accepting strings that:
•
Have a specific structure (like b a b a a b or b a a b etc.)
•
Eventually lead to Q5
•
Once Q5 is reached, everything is accepted