Professional Documents
Culture Documents
pkWhatsapp# 0331-5824043
Dr. Naseer Ahmad Sajid email id: Naseer@biit.edu.pkWhatsapp# 0346-5100010
FA Operations
o 𝑭𝑨𝟏 − 𝑭𝑨𝟐
o Complement
Text Book &Resources:Introduction to Computer Theory–2nd Edition - (I. O. Cohen)
L1-L2={a,ba,aba,bba,abba,.... }
1
Dr. Muhammad Zeeshan Muzaffar email id: Zeeshan@biit.edu.pkWhatsapp# 0331-5824043
Dr. Naseer Ahmad Sajid email id: Naseer@biit.edu.pkWhatsapp# 0346-5100010
𝑏 𝑎 𝑏 𝑎, 𝑏
𝑎 𝑎
−𝒙𝟏 +𝒙𝟐 −𝒚𝟏 𝒚𝟐 𝑎 +𝒚𝟑
𝑏 𝑏
𝑭𝑨𝟏 𝑭𝑨𝟐
Old States 𝒂 𝒃
−𝒛𝟏 = {𝒙𝟏 , 𝒚𝟏 } 𝒛𝟐 = {𝒙𝟐 , 𝒚𝟐 } 𝒛𝟏 = {𝒙𝟏 , 𝒚𝟏 }
+𝒛𝟐 = {𝒙𝟐 , 𝒚𝟐 } 𝒛 𝟑 = 𝒙 𝟐 , 𝒚𝟑 𝒛𝟏 = {𝒙𝟏 , 𝒚𝟏 }
𝒛𝟑 = {𝒙𝟐 , 𝒚𝟑 } 𝒛 𝟑 = 𝒙 𝟐 , 𝒚𝟑 𝒛𝟒 = {𝒙𝟏 , 𝒚𝟑 }
𝒛𝟒 = {𝒙𝟏 , 𝒚𝟑 } 𝒛 𝟑 = 𝒙 𝟐 , 𝒚𝟑 𝒛𝟒 = {𝒙𝟏 , 𝒚𝟑 }
𝑏 𝑎 𝑏
𝑎 𝑏
−𝒛𝟏 +𝒛𝟐 𝑎 𝒛𝟑 𝒛𝟒
𝑏 𝑎
2
Dr. Muhammad Zeeshan Muzaffar email id: Zeeshan@biit.edu.pkWhatsapp# 0331-5824043
Dr. Naseer Ahmad Sajid email id: Naseer@biit.edu.pkWhatsapp# 0346-5100010
𝑏 𝑎 𝑏 𝑎, 𝑏
𝑎 𝑎
−𝒙𝟏 +𝒙𝟐 −𝒚𝟏 𝒚𝟐
𝑎 +𝒚𝟑
𝑏 𝑏
𝑭𝑨𝟏 𝑭𝑨𝟐
Old States 𝒂 𝒃
−𝒛𝟏 = {𝒙𝟏 , 𝒚𝟏 } 𝒛𝟐 = {𝒙𝟐 , 𝒚𝟐 } 𝒛𝟏 = {𝒙𝟏 , 𝒚𝟏 }
𝒛𝟐 = {𝒙𝟐 , 𝒚𝟐 } 𝒛 𝟑 = 𝒙 𝟐 , 𝒚𝟑 𝒛𝟏 = {𝒙𝟏 , 𝒚𝟏 }
𝒛𝟑 = {𝒙𝟐 , 𝒚𝟑 } 𝒛 𝟑 = 𝒙 𝟐 , 𝒚𝟑 𝒛𝟒 = {𝒙𝟏 , 𝒚𝟑 }
+𝒛𝟒 = {𝒙𝟏 , 𝒚𝟑 } 𝒛 𝟑 = 𝒙 𝟐 , 𝒚𝟑 𝒛𝟒 = {𝒙𝟏 , 𝒚𝟑 }
𝑏 𝑎 𝑏
𝑎 𝑏
−𝒛𝟏 𝒛𝟐 𝑎 𝒛𝟑 +𝒛𝟒
𝑏 𝑎
3
Dr. Muhammad Zeeshan Muzaffar email id: Zeeshan@biit.edu.pkWhatsapp# 0331-5824043
Dr. Naseer Ahmad Sajid email id: Naseer@biit.edu.pkWhatsapp# 0346-5100010
−𝒙𝟏 𝒙𝟐
0 +𝒙𝟑 −𝒚𝟏 𝒚𝟐
1 +𝒚𝟑
1 0
𝑭𝑨𝟏 𝑭𝑨𝟐
Old States 𝟎 𝟏
−𝒛𝟏 = {𝒙𝟏 , 𝒚𝟏 } 𝒛𝟐 = {𝒙𝟐 , 𝒚𝟏 } 𝒛𝟑 = {𝒙𝟏 , 𝒚𝟐 }
𝒛𝟐 = {𝒙𝟐 , 𝒚𝟏 } 𝒛𝟒 = {𝒙𝟑 , 𝒚𝟏 } 𝒛𝟑 = {𝒙𝟏 , 𝒚𝟐 }
𝒛𝟑 = {𝒙𝟏 , 𝒚𝟐 } 𝒛𝟐 = {𝒙𝟐 , 𝒚𝟏 } 𝒛𝟓 = {𝒙𝟏 , 𝒚𝟑 }
+𝒛𝟒 = {𝒙𝟑 , 𝒚𝟏 } 𝒛𝟒 = {𝒙𝟑 , 𝒚𝟏 } 𝒛𝟔 = {𝒙𝟑 , 𝒚𝟐 }
𝒛𝟓 = {𝒙𝟏 , 𝒚𝟑 } 𝒛𝟕 = {𝒙𝟐 , 𝒚𝟑 } 𝒛𝟓 = {𝒙𝟏 , 𝒚𝟑 }
+𝒛𝟔 = {𝒙𝟑 , 𝒚𝟐 } 𝒛𝟒 = {𝒙𝟑 , 𝒚𝟏 } 𝒛𝟖 = {𝒙𝟑 , 𝒚𝟑 }
𝒛𝟕 = {𝒙𝟐 , 𝒚𝟑 } 𝒛𝟖 = {𝒙𝟑 , 𝒚𝟑 } 𝒛𝟓 = {𝒙𝟏 , 𝒚𝟑 }
𝒛𝟖 = {𝒙𝟑 , 𝒚𝟑 } 𝒛𝟖 = {𝒙𝟑 , 𝒚𝟑 } 𝒛𝟖 = {𝒙𝟑 , 𝒚𝟑 }
−𝒛𝟏
1 𝒛𝟑
1 𝒛𝟓 1
0 1 1 0
0
𝒛𝟐 𝒛𝟕
0 0
1 1
0 +𝒛𝟒 +𝒛𝟔 𝒛𝟖 0,1
0
4
Dr. Muhammad Zeeshan Muzaffar email id: Zeeshan@biit.edu.pkWhatsapp# 0331-5824043
Dr. Naseer Ahmad Sajid email id: Naseer@biit.edu.pkWhatsapp# 0346-5100010
−𝒙𝟏
𝑎 𝒙𝟐 𝑏 +𝒙𝟑 −𝒚𝟏 𝑏 𝒚𝟐 𝑎 +𝒚𝟑
𝑏 𝑎 𝑏
𝑎
𝒙𝟒
𝑭𝑨𝟏 𝑭𝑨𝟐
𝑎, 𝑏
Old States 𝒂 𝒃
−𝒛𝟏 = {𝒙𝟏 , 𝒚𝟏 } 𝒛𝟐 = {𝒙𝟐 , 𝒚𝟏 } 𝒛𝟑 = {𝒙𝟒 , 𝒚𝟐 }
𝒛𝟐 = {𝒙𝟐 , 𝒚𝟏 } 𝒛𝟒 = {𝒙𝟒 , 𝒚𝟏 } 𝒛𝟓 = {𝒙𝟑 , 𝒚𝟐 }
𝒛𝟑 = {𝒙𝟒 , 𝒚𝟐 } 𝒛𝟔 = {𝒙𝟒 , 𝒚𝟑 } 𝒛𝟑 = {𝒙𝟒 , 𝒚𝟐 }
𝒛𝟒 = {𝒙𝟒 , 𝒚𝟏 } 𝒛𝟒 = {𝒙𝟒 , 𝒚𝟏 } 𝒛𝟑 = {𝒙𝟒 , 𝒚𝟐 }
+𝒛𝟓 = {𝒙𝟑 , 𝒚𝟐 } 𝒛𝟕 = {𝒙𝟑 , 𝒚𝟑 } 𝒛𝟓 = {𝒙𝟑 , 𝒚𝟐 }
𝒛𝟔 = {𝒙𝟒 , 𝒚𝟑 } 𝒛𝟒 = {𝒙𝟒 , 𝒚𝟏 } 𝒛𝟑 = {𝒙𝟒 , 𝒚𝟐 }
𝑧7 = {𝑥3 , 𝑦3 } 𝒛𝟖 = {𝒙𝟑 , 𝒚𝟏 } 𝒛𝟓 = {𝒙𝟑 , 𝒚𝟐 }
+𝑧8 = {𝑥3 , 𝑦1 } 𝒛𝟖 = {𝒙𝟑 , 𝒚𝟏 } 𝒛𝟓 = {𝒙𝟑 , 𝒚𝟐 }
𝑎 𝑏
−𝒛𝟏 𝑎 𝒛𝟐 𝑎 𝒛𝟒 +𝒛𝟓
𝑎 𝒛𝟕
𝑏
𝑏 𝑎 𝑎
𝑏 𝑏
𝒛𝟑
𝑏 𝒛𝟔 +𝒛𝟖
𝑎
𝑏
𝑎
L1={ab,aba,abb,abaa,abbb,abab,abba,......}
L2={ba,aba,bba,baba,abba,aaba,bbba,.....}
5
Dr. Muhammad Zeeshan Muzaffar email id: Zeeshan@biit.edu.pkWhatsapp# 0331-5824043
Dr. Naseer Ahmad Sajid email id: Naseer@biit.edu.pkWhatsapp# 0346-5100010
Complementof FA’s
The complement of an 𝐹𝐴 accept words not in 𝐹𝐴. For this purpose, take complement of
each state w.r.t its final status. If the state is final, then make it as non-final state, andif the
state is non-final, then make it as final state.
Example 5: Provide complement of the given 𝐹𝐴.
language havingEven number of 𝑎′𝑠 and Even number of 𝑏′𝑠defined over set of
alphabets Σ = {𝑎, 𝑏}.
𝑎
∓𝒙𝟏 𝒙𝟐
𝑎
𝑏 𝑏 𝑏 𝑏
𝑎
𝒙𝟑 𝒙𝟒
𝑎
Solution:The complement of an 𝐹𝐴 accept words not in 𝐹𝐴. So, the complement of the given
𝐹𝐴 as shown below.
𝑎
−𝒚𝟏 +𝒚𝟐
𝑎
𝑏 𝑏 𝑏 𝑏
𝑎
+𝒚𝟑 +𝒚𝟒
𝑎
6
Dr. Muhammad Zeeshan Muzaffar email id: Zeeshan@biit.edu.pkWhatsapp# 0331-5824043
Dr. Naseer Ahmad Sajid email id: Naseer@biit.edu.pkWhatsapp# 0346-5100010
Example 6: Provide complement of the given 𝐹𝐴 that acceptlanguage start with 𝑎𝑏defined
over set of alphabets Σ = {𝑎, 𝑏}.
𝑎, 𝑏
−𝒙𝟏
𝑎 𝒙𝟐 𝑏 +𝒙𝟑
𝑏 𝑎
𝒙𝟒
𝑎, 𝑏
𝑎, 𝑏
∓𝒙𝟏 𝑎 +𝒙𝟐 𝑏 𝒙𝟑
𝑏 𝑎
+𝒙𝟒
𝑎, 𝑏
7
Dr. Muhammad Zeeshan Muzaffar email id: Zeeshan@biit.edu.pkWhatsapp# 0331-5824043
Dr. Naseer Ahmad Sajid email id: Naseer@biit.edu.pkWhatsapp# 0346-5100010
Assignment No. 8
FA’s are given for the questions
FA1: The languagestarts with‘𝒂𝒃’ defined over ∑={𝒂, 𝒃}.
𝑎, 𝑏
−𝒙𝟏 𝑎 𝒙𝟐 𝑏 +𝒙𝟑
𝑏 𝑎
𝒙𝟒
𝑎, 𝑏
FA2: The language containsubstring ‘𝒂𝒃’ or ‘𝒃𝒂’ defined over ∑={𝒂, 𝒃}.
𝑎
𝒙𝟐 𝑎, 𝑏
𝑎 𝑏
−𝒙𝟏 +𝒙𝟒
𝑏 𝒙𝟑 𝑎
𝑏
FA3: Language of all words having even number of 𝑎′𝑠 and even number of
𝑎
∓𝒚𝟏 𝒚𝟐
𝑎
𝑏 𝑏 𝑏 𝑏
𝑎
𝒚𝟑 𝒚𝟒
𝑎
𝑏′𝑠.