A DFA can be defined by a 5-tuple (Q, Σ, δ, q0, F) where Q is a finite set of states, Σ is a finite set of alphabets, δ is the transition function, q0 is the initial state, and F is a finite set of final states. The document provides examples of constructing DFAs to accept strings based on various conditions such as length, number of specific characters, and relationships between characters. It also discusses the minimum number of states needed for DFAs based on the acceptance conditions.
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...parmeet834
CS 162 Fall 2015
Homework 1 Problems
September 29, 2015 Timothy Johnson
1. Exercise 2.2.4 on page 53 of Hopcroft et al. Give DFA’s accepting the following languages over the alphabet {0,1}. (a) The set of all strings ending in 0
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...parmeet834
CS 162 Fall 2015
Homework 1 Problems
September 29, 2015 Timothy Johnson
1. Exercise 2.2.4 on page 53 of Hopcroft et al. Give DFA’s accepting the following languages over the alphabet {0,1}. (a) The set of all strings ending in 0
Automata theory - describes to derives string from Context free grammar - derivation and parse tree
normal forms - Chomsky normal form and Griebah normal form
Theory of automata and formal languageRabia Khalid
KleenE Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, languages of strings, cursive definition of RE, defining languages by RE,Examples
Automata theory - describes to derives string from Context free grammar - derivation and parse tree
normal forms - Chomsky normal form and Griebah normal form
Theory of automata and formal languageRabia Khalid
KleenE Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, languages of strings, cursive definition of RE, defining languages by RE,Examples
Water scarcity is the lack of fresh water resources to meet the standard water demand. There are two type of water scarcity. One is physical. The other is economic water scarcity.
Courier management system project report.pdfKamal Acharya
It is now-a-days very important for the people to send or receive articles like imported furniture, electronic items, gifts, business goods and the like. People depend vastly on different transport systems which mostly use the manual way of receiving and delivering the articles. There is no way to track the articles till they are received and there is no way to let the customer know what happened in transit, once he booked some articles. In such a situation, we need a system which completely computerizes the cargo activities including time to time tracking of the articles sent. This need is fulfilled by Courier Management System software which is online software for the cargo management people that enables them to receive the goods from a source and send them to a required destination and track their status from time to time.
Democratizing Fuzzing at Scale by Abhishek Aryaabh.arya
Presented at NUS: Fuzzing and Software Security Summer School 2024
This keynote talks about the democratization of fuzzing at scale, highlighting the collaboration between open source communities, academia, and industry to advance the field of fuzzing. It delves into the history of fuzzing, the development of scalable fuzzing platforms, and the empowerment of community-driven research. The talk will further discuss recent advancements leveraging AI/ML and offer insights into the future evolution of the fuzzing landscape.
Quality defects in TMT Bars, Possible causes and Potential Solutions.PrashantGoswami42
Maintaining high-quality standards in the production of TMT bars is crucial for ensuring structural integrity in construction. Addressing common defects through careful monitoring, standardized processes, and advanced technology can significantly improve the quality of TMT bars. Continuous training and adherence to quality control measures will also play a pivotal role in minimizing these defects.
Vaccine management system project report documentation..pdfKamal Acharya
The Division of Vaccine and Immunization is facing increasing difficulty monitoring vaccines and other commodities distribution once they have been distributed from the national stores. With the introduction of new vaccines, more challenges have been anticipated with this additions posing serious threat to the already over strained vaccine supply chain system in Kenya.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSEDuvanRamosGarzon1
AIRCRAFT GENERAL
The Single Aisle is the most advanced family aircraft in service today, with fly-by-wire flight controls.
The A318, A319, A320 and A321 are twin-engine subsonic medium range aircraft.
The family offers a choice of engines
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxR&R Consult
CFD analysis is incredibly effective at solving mysteries and improving the performance of complex systems!
Here's a great example: At a large natural gas-fired power plant, where they use waste heat to generate steam and energy, they were puzzled that their boiler wasn't producing as much steam as expected.
R&R and Tetra Engineering Group Inc. were asked to solve the issue with reduced steam production.
An inspection had shown that a significant amount of hot flue gas was bypassing the boiler tubes, where the heat was supposed to be transferred.
R&R Consult conducted a CFD analysis, which revealed that 6.3% of the flue gas was bypassing the boiler tubes without transferring heat. The analysis also showed that the flue gas was instead being directed along the sides of the boiler and between the modules that were supposed to capture the heat. This was the cause of the reduced performance.
Based on our results, Tetra Engineering installed covering plates to reduce the bypass flow. This improved the boiler's performance and increased electricity production.
It is always satisfying when we can help solve complex challenges like this. Do your systems also need a check-up or optimization? Give us a call!
Work done in cooperation with James Malloy and David Moelling from Tetra Engineering.
More examples of our work https://www.r-r-consult.dk/en/cases-en/
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfKamal Acharya
The College Bus Management system is completely developed by Visual Basic .NET Version. The application is connect with most secured database language MS SQL Server. The application is develop by using best combination of front-end and back-end languages. The application is totally design like flat user interface. This flat user interface is more attractive user interface in 2017. The application is gives more important to the system functionality. The application is to manage the student’s details, driver’s details, bus details, bus route details, bus fees details and more. The application has only one unit for admin. The admin can manage the entire application. The admin can login into the application by using username and password of the admin. The application is develop for big and small colleges. It is more user friendly for non-computer person. Even they can easily learn how to manage the application within hours. The application is more secure by the admin. The system will give an effective output for the VB.Net and SQL Server given as input to the system. The compiled java program given as input to the system, after scanning the program will generate different reports. The application generates the report for users. The admin can view and download the report of the data. The application deliver the excel format reports. Because, excel formatted reports is very easy to understand the income and expense of the college bus. This application is mainly develop for windows operating system users. In 2017, 73% of people enterprises are using windows operating system. So the application will easily install for all the windows operating system users. The application-developed size is very low. The application consumes very low space in disk. Therefore, the user can allocate very minimum local disk space for this application.
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
1. Dete rministic Finite
Autom ata (DFA)
• DFA can be defined by quintuples
( 𝑄 , Σ , 𝛿 , 𝑞 0 , 𝐹 )
– 𝑄 is finite set of states
– Σ is finite set of alphabets
– 𝛿 is transition function
– 𝑞 0 is initial state
– 𝐹 finite set of final states
1
3. Transition Function
𝛿: 𝑄 Χ Σ → 𝑄
{A, B, C} X {a, b} {A, B, C}
(A, a)
(A, b)
(B, a)
(B, b)
(C, a)
(C, b)
A
B
C
For every input on a
state there is
exactly one
transition.
3
A
B
C
4. Question
• Why this FA is called Deterministic Finite
Automata?
– Every state on seeing any input it is always going
to go to only one state.
4
5. DFA
• Construct a DFA, that accepts set of all strings
over {a, b} of length 2.
• Ans:
– Σ = 𝑎, 𝑏
– 𝐿 = {𝑎𝑎, 𝑎𝑏, 𝑏𝑎, 𝑏𝑏}
B C
A
a a
5
6. DFA
• Is this a complete DFA?
• No
• Now is this a complete DFA?
• No
• After reaching sate ‘D’ we can’t go back to the final state, that is
why this state is called dead state/trap state.
B C
A
a a
B C
A
B C
A
a, b a, b
a, b a, b
D
a, b
a, b
6
7. Acceptance
• Acceptance of a string by a FA:
– Scan the entire string and if we reach a final state
from initial state.
• Acceptance of a language by a FA:
– If all the strings in the language are accepted by
the FA and all the strings those are not in the
language must reject by the FA.
7
8. DFA
• Construct a DFA that accept all strings over the
alphabets {a, b} where the string length is at least 2.
– 𝝎 ∈ 𝒂, 𝒃 and 𝝎 ≥ 𝟐
– 𝜮 = 𝒂, 𝒃
– 𝑳 = {𝒂𝒂, 𝒂𝒃, 𝒃𝒂, 𝒃𝒃, 𝒂𝒂𝒂, … … 𝒃𝒃𝒃, … … … }
– Up to this is a DFA of string length 2. This is not the
required DFA.
– Now this is required DFA.
A B
a,b
C
a,b
a, b
8
9. DFA
• Construct a DFA that accept all strings over the
alphabets {a, b} where the string length is at most
two.
– 𝝎 ∈ 𝒂, 𝒃 and 𝝎 ≤ 𝟐
– 𝜮 = 𝒂, 𝒃
– 𝑳 = {𝝐, 𝒂, 𝒃, 𝒂𝒂, 𝒂𝒃, 𝒃𝒂, 𝒃𝒃}
– To accept null string (𝝐) the only way to make initial
state to both initial state and final state.
A B
a,b
C
a,b
D
a, b
a, b
9
10. Minimum numbe r of state s
𝝎 = 𝟐 𝝎 ≥ 𝟐 𝝎 ≤ 𝟐
𝝎 = 𝒏
n + 2
𝝎 ≥ 𝒏
n + 1
𝝎 ≤ 𝒏
n + 2
10
11. DFA
• Construct a DFA that accept all strings over
the alphabets {a, b} where the string length is
divisible by two.
• 𝑳 = {𝜖, 𝑎𝑎, 𝑎𝑏, 𝑏𝑎, 𝑏𝑏, 𝑎𝑎𝑎𝑎 … 𝑏𝑏𝑏𝑏 … … … }
• This is not a finite automata
A B
a, b
C
a, b
D
a, b
E
a, b
Length 0 Length 1 Length 2 Length 3 Length 4
11
12. DFA
• Construct a DFA that accept all strings over
the alphabets {a, b} where the string length is
divisible by two.
• This is not minimal
A B
a, b
C
a, b
Length 0 Length 1 Length 2
A B
a, b
Length
Even
Length
Odd
a, b
a, b
12
13. DFA
• Construct a DFA that accept all strings over the
alphabets {a, b} where the string length is not
divisible by two.
• We will get 0 or 1 after diving the length of a string
by two. That is why we need two state.
• If string length is 3 then we will get 0 or 1 or 2 as
remainder after dividing any length by 3. So we will
be requiring three state in that case.
A B
a, b
Length
Even
Length
Odd
a, b
13
14. DFA
• Construct a DFA that accept all strings over
the alphabets {a, b} where the string length is
divisible by three.
– 𝜔 𝑚𝑜𝑑 3 = 0
– 𝐿 = {𝜖, 𝑎𝑎𝑎, … … … , 𝑏𝑏𝑏, 𝑎𝑎𝑎𝑎𝑎𝑎, … … … , 𝑏𝑏𝑏𝑏𝑏𝑏, … … … … … … }
A B
a, b
C
a, b
Length
0,3,6,…
Length
1,4,7,…
Length
2,5,8,…
a, b
14
15. DFA
• Construct a DFA where 𝜔 ≅ 1 𝑚𝑜𝑑 3
• 𝜔 ≅ 1 𝑚𝑜𝑑 3 means 𝜔 𝑚𝑜𝑑 3 = 1
• For 𝜔 𝑚𝑜𝑑 𝑛 = 0 𝑜𝑟 𝜔 ≅ 𝑚 𝑚𝑜𝑑 n (m is any number)
in general for minimal DFA we need 𝑛 number of states.
A
a, b
C
a, b
Length
0,3,6,…
Length
1,4,7,…
Length
2,5,8,…
a, b
B
15
16. DFA
• Construct a DFA that accept all strings over
the alphabets {a, b} where number of ‘a’ in
the string is two.
– 𝑛𝑎 𝜔 = 2
– 𝐿 = 𝑎𝑎, 𝑏𝑎𝑎, 𝑎𝑏𝑎, 𝑎𝑎𝑏, 𝑏𝑏𝑎𝑎, … … …
B
a
C
a
0 ‘a’s 1 ‘a’s 2 ‘a’s
A D
b b b
a
3 ‘a’s
a,b
16
17. DFA
• Construct a DFA that accept all strings over
the alphabets {a, b} where number of ‘a’ in
the string at least two.
– 𝑛𝑎 𝜔 ≥ 2
B
a
C
a
0 ‘a’s 1 ‘a’s 2 ‘a’s
A
b b a, b
17
18. DFA
• Construct a DFA that accept all strings over
the alphabets {a, b} where number of ‘a’ in
the string at most two.
– 𝑛𝑎 𝜔 ≤ 2
b
B
a
C
a
0 ‘a’s 1 ‘a’s 2 ‘a’s
A
b b
D
3 ‘a’s
a,b
a
18
19. DFA
• Construct a DFA that accept all strings over
the alphabets {a, b} where number of ‘a’ in
the string is even.
– 𝑛𝑎 𝜔 𝑚𝑜𝑑 2 = 0
– 𝑛𝑎 𝜔 ≅ 0 𝑚𝑜𝑑 2
A B
a
Length
Even
Length
Odd
a
b
b
19
20. DFA
• Construct a DFA that accept all strings over
the alphabets {a, b} where number of ‘a’ in
the string is odd.
– 𝑛𝑎 𝜔 𝑚𝑜𝑑 2 = 1
– 𝑛𝑎 𝜔 ≅ 1 𝑚𝑜𝑑 2
b
A B
a
Length
Even
Length
Odd
a
b
20
21. DFA
• Construct a DFA that accept all strings over
the alphabets {a, b} where number of ‘a’ in
the string is divisible by 3.
– 𝑛𝑎 𝜔 𝑚𝑜𝑑 3 = 0
– 𝑛𝑎 𝜔 ≅ 0 𝑚𝑜𝑑 3
A B
a
a
b
b
C
a
b
21
22. DFA
• 𝑖𝑓𝑛𝑎 𝜔 ≅ 𝑘 𝑚𝑜𝑑 n , how to draw DFA??
– 𝑛 number of states will be there
• If k=0 𝑞0 will be final state
• If k=1 𝑞1 will be final state
• If k=2 𝑞2 will be final state
• If k=3 𝑞3 will be final state
• So on
22
23. Assignment
1. Construct a DFA that accept all strings over the
alphabets {a, b} where number of ‘b’ in the string is
divisible by 5.
2. Construct a DFA that accept all strings over the
alphabets {a, b} such that 𝑛𝑎 𝜔 ≅ 2 𝑚𝑜𝑑 5
3. Construct a DFA that accept all strings over the
alphabets {a, b} such that 𝑛𝑏 𝜔 ≅ 1 𝑚𝑜𝑑 3
23
24. DFA
• Construct a DFA that accept all strings over
the alphabets {a, b} where number of ‘a’ and
number of ‘b’ in the string is even.
– 𝑛𝑎 𝜔 𝑚𝑜𝑑 2 = 0 & 𝑛𝑏 𝜔 𝑚𝑜𝑑 2 = 0
– 𝑛𝑎 𝜔 ≅ 0 𝑚𝑜𝑑 2 & 𝑛𝑏 𝜔 ≅ 0 𝑚𝑜𝑑 2
𝑛𝑎 𝜔 𝑛𝑏 𝜔
E E
O E
E O
O O
Four possible
states
representing this
situation
24
25. DFA
ee eo
oe oo
1. String 𝜖 state ee
2. String ‘a’ state oe
3. String ‘b’ state eo
4. String ‘aa’ state ee
5. String ‘ab’ state oo
6. String ‘ba’ state oo
7. String ‘bb’ state ee
8. String ‘aba’ or ‘baa’ state eo
9. String ‘bab’ or ‘abb’ state oe
a
b
a
b
a
b
a
b
25
26. Cross Product Method
• 𝑛𝑎 𝜔 𝑚𝑜𝑑 2 = 0 & 𝑛𝑏 𝜔 𝑚𝑜𝑑 2 = 0
𝐴, 𝐵 × 𝐶, 𝐷 = 𝐴𝐶, 𝐴𝐷, 𝐵𝐶, 𝐵𝐷
A B
a
a
b
b
C D
b
b
a
a
b
a
b
a
b
a
b
a
A B
C C
a
a
b
b
A A
C D
AC BC
AD BD
ee oe
oo
eo
Observation: ‘a’s are counting
in horizontal way and ‘b’s are
counting in vertical way. 26
27. Cross Product Method
• Construct a DFA that accept all strings over the
alphabets {a, b} where number of ‘a’ is divisible by 3
and number of ‘b’ in the string is divisible by 2.
b
a
a
b
00 10
01 11
20
b
21
a
a
a
a
b
b
b
27
28. Cross Product Method
• Construct a DFA that accept all strings over the alphabets {a,
b} where number of ‘a’ and number of ‘b’ in the string is
divisible by 3.
– 𝑛𝑎 𝜔 𝑚𝑜𝑑 3 = 0 & 𝑛𝑏 𝜔 𝑚𝑜𝑑 3 = 0
– 𝑛𝑎 𝜔 ≅ 0 𝑚𝑜𝑑 3 & 𝑛𝑏 𝜔 ≅ 0 𝑚𝑜𝑑 3
b
a
a
b
A B
D E
C
b
F
a
a
a
a
b
a
b
G H
b
I
a
a
b
b
b
28
29. DFA
• Construct a DFA that accept all strings over the alphabets {a,
b} such that 𝑛𝑎 𝜔 𝑚𝑜𝑑 3 ≥ 𝑛𝑏 𝜔 𝑚𝑜𝑑 2
b
a
a
b
00 10
01 11
20
b
21
a
a
a
a
b
b
b
No. of ‘a’s mod 3 >
no. of ‘b’s mod 2
this will be a final
state
No. of ‘a’s mod 3 >
no. of ‘b’s mod 2
this will be a final
state
No. of ‘a’s mod 3 =
no. of ‘b’s mod 2
this will be a final
state
No. of ‘a’s mod 3 >
no. of ‘b’s mod 2
this will be a final
state
No. of ‘a’s mod 3 =
no. of ‘b’s mod 2
So this will be a
final state
No. of ‘a’s mod 3 <
no. of ‘b’s mod 2
this will not be a
final state
29
30. DFA
• Construct a minimal DFA which accepts all
strings over {0,1}, which when interpreted as
binary number is divisible by 2.
– Two remainders are possible, so two states
𝒒𝟎 𝒒𝟏
1
0
1
0
30
31. DFA
• Construct a minimal DFA which accepts all
strings over {0,1}, which when interpreted as
binary number is divisible by 3.
– Three remainders are possible, so three states
𝒒𝟎 𝒒𝟏
1
1
0
0
𝒒𝟐
0
1
If the question is divisible by ‘n’ then number of state is n.
31
33. Transition Table
• Construct a minimal DFA which accepts all
strings over {0,1}, which when interpreted as
binary number is divisible by 4
0 1
𝑞0 𝑞0 𝑞1
𝑞1 𝑞2 𝑞3
𝑞2 𝑞0 𝑞1
𝑞3 𝑞2 𝑞3
33
34. DFA
• Construct a minimal DFA which accepts all
strings over {0,1}, which when interpreted as
binary number is ≅ 1 𝑚𝑜𝑑 3.
𝒒𝟎 𝒒𝟏
1
1
0
0
𝒒𝟏
0
1
34
35. DFA
• Construct a minimal DFA which accepts all
strings over {0,1}, which when interpreted as
binary number is ≅ 2 𝑚𝑜𝑑 3.
𝒒𝟎 𝒒𝟏
1
1
0
0
𝒒𝟏
0
1
35
36. Transition Table
• Construct a minimal DFA which accepts all
strings over {0,1,2}, which when interpreted as
ternary number is divisible by 4
0 1 2
𝑞0 𝑞0 𝑞1 𝑞2
𝑞1 𝑞3 𝑞0 𝑞1
𝑞2 𝑞2 𝑞3 𝑞0
𝑞3 𝑞1 𝑞2 𝑞3
36
37. DFA
• Construct a minimal DFA which accepts set of
all strings over {a, b} where each string starts
with an ‘a’.
• Construct a minimal DFA which accepts set of
all strings over {a, b} where each string
contains an ‘a’.
• Construct a minimal DFA which accepts set of
all strings over {a, b} where each string ends
with an ‘a’.
37
38. Assignment
1. Construct a DFA that accept all strings over the alphabets {a, b} where number of
‘a’ and number of ‘b’ is odd in the string.
2. Construct a DFA that accept all strings over the alphabets {a, b} where number of
‘a’ is even and number of ‘b’ is odd in the string .
3. Construct a DFA that accept all strings over the alphabets {a, b} where number of
‘a’ is odd and number of ‘b’ is even in the string .
4. Construct a DFA that accept all strings over the alphabets {a, b} where number of
‘a’ is multiple of three and number of ‘b’ is multiple of two in the string.
5. Construct a DFA that accept all strings over the alphabets {a, b} such that
𝑛𝑎 𝜔 𝑚𝑜𝑑 3 = 𝑛𝑏 𝜔 𝑚𝑜𝑑 2
6. Construct a DFA that accept all strings over the alphabets {a, b} such that
𝑛𝑎 𝜔 𝑚𝑜𝑑 3 ≤ 𝑛𝑏 𝜔 𝑚𝑜𝑑 2
7. Construct a DFA that accept all strings over the alphabets {a, b} such that
𝑛𝑎 𝜔 𝑚𝑜𝑑 3 = 1 and 𝑛𝑏 𝜔 𝑚𝑜𝑑 3 = 2
8. Construct a DFA that accept all strings over the alphabets {a, b} such that
𝑛𝑎 𝜔 𝑚𝑜𝑑 3 > 𝑛𝑏 𝜔 𝑚𝑜𝑑 3
9. Construct a minimal DFA which accepts all strings over Octal number system,
which when interpreted as binary number ≅ 1 𝑚𝑜𝑑 5
38
39. DFA
• Construct a minimal DFA which accepts set of
all strings over {a, b} where each string start
with “ab”
– L= {ab, aba, abb, ………}
B C
A
a b
D
a, b
a
a, b
39
b
40. DFA
• Construct a minimal DFA which accepts set of
all strings over {a, b} where each string
contains “ab” as a sub string.
– L= {ab, aab, aba, bab, abb ………}
B C
A
a b
b a a,b
40
41. DFA
• Construct a minimal DFA which accepts set of
all strings over {a, b} where each string end
with “ab”
– L= {ab, aab, bab, abab ………}
B C
A
a b
b a
a
b
41
42. DFA
• Construct a minimal DFA which accepts set of all
strings over {a, b} where each string starts with ‘a’
and ends with ‘b’ or vice versa.
– L ={ab, ba, aab, abb, baa, bba. ……}
B C
A
a b
b
a b
a
D
a
E
b
b
42
a
43. DFA
• Construct a minimal DFA which accepts set of all
strings over {a, b} where each string starts and ends
with same symbol.
– L={𝜖, a, b, aa, bb, aba, bab,…………}
C
B
A
a b
b
a
b
a
E
a
D b
b
a
This DFA is complement of
previous DFA and language also.
We will get complement of a
language by removing one
language from 𝚺∗. 𝑳𝟐 = 𝚺∗ − 𝑳𝟏
L2 is complement of L1
43
44. Complement of DFA
A B
a
Length
Even
Length
Odd
a
b
b
A B
a
Length
Even
Length
Odd
a
b
L1 = Even number of ‘a’ L2 = Odd number of ‘a’
L3 = Starts with ‘a’ L4 = Not starts with ‘a’
A B
C
a
b
a,b
a,b
A B
C
a
b
a,b
a,b
44
45. Complement of DFA
• DFA can be defined by quintuples
– ( 𝑄 , Σ , 𝛿 , 𝑞 0 , 𝐹 )
• Complement of DFA can be defined by
quintuples
– ( 𝑄 , Σ , 𝛿 , 𝑞 0 , 𝑄 − 𝐹 )
45
46. DFA
• Construct a minimal DFA which accepts set of
all strings over {a, b} which accepts strings in
which every 'a' is followed by 'b'.
– L={𝜖, b, ab, bb, aba, bab, …………}
46
C
B
A a b
a
b
a
b
D
a,b
47. DFA
• Construct a minimal DFA which accepts set of
all strings over {a, b} which accepts strings in
which every 'a' never followed by 'b'.
– This is not complement of previous
– L={𝜖, a, aa,…..,b, bb,……, ba, bba…………}
47
C
B
A
a b
a
a,b
b
48. DFA
• Construct a minimal DFA which accepts set of
all strings over {a, b} which accepts strings in
which every 'a' is followed by ‘bb'.
48
D
B
A a b
a
b
a
b
E
a,b
C
b
a
49. DFA
• Construct a minimal DFA which accepts set of
all strings over {a, b} which accepts strings in
which every 'a' never followed by ‘bb'.
49
D
B
A a b
a, b
a
b
C
b
a
50. DFA
• 𝐿 = 𝑎𝑛
𝑏𝑚
|𝑛, 𝑚 ≥ 1
– 𝐿 = {𝑎𝑏, 𝑎𝑎𝑏𝑏, 𝑎𝑎𝑎𝑏, 𝑎𝑏𝑏𝑏, … … … }
50
C
B
A a
b
b
a
D
a, b
b
a
51. DFA
• 𝐿 = 𝑎𝑛
𝑏𝑚
|𝑛, 𝑚 ≥ 0
– 𝐿 = {𝜖, 𝑎, 𝑎𝑎, … , 𝑎𝑎𝑏, 𝑎𝑏𝑏, … 𝑏, 𝑏𝑏, 𝑏𝑏𝑏 … … … }
51
C
B
A
b a
b a,b
a
52. DFA
• 𝐿 = 𝑎𝑛
𝑏𝑚
𝑐𝑙
|𝑛, 𝑚, 𝑙 ≥ 1
– 𝐿 = {𝑎𝑏𝑐, 𝑎𝑎𝑏𝑐, 𝑎𝑏𝑏𝑐, 𝑎𝑏𝑐𝑐, … … … }
52
D
B
A a
b, c
c
c
D
a, b, c
b
a
C
c
a
b
a, b
53. DFA
• 𝐿 = 𝑎𝑛
𝑏𝑚
𝑐𝑙
|𝑛, 𝑚, 𝑙 ≥ 0
– 𝐿 = {𝜖, 𝑎, 𝑏, 𝑐, 𝑎𝑏, 𝑎𝑐, 𝑏𝑐, 𝑎𝑏𝑐, 𝑎𝑎, 𝑏𝑏, 𝑐𝑐, … }
53
B
A b c
c
b
a
C
c
a
D
a, b, c
a, b
54. DFA
• 𝐿 = {𝑎3
𝑏𝑤𝑎3
|𝑤 ∈ {𝑎, 𝑏}∗
}
– 𝐿 = {𝑎3𝑏𝜖𝑎3, 𝑎3𝑏𝑎𝑎3, 𝑎3𝑏𝑏𝑎3, 𝑎3𝑏𝑎𝑎𝑎3, … … }
54
H
B
A a a
C D E F G
a b a a a
I
b
a, b
b b a
b
b
b
b
a
55. Operations of DFA
Different operations that we can apply on DFAs
are -
1. Union
2. Concatenation
3. Cross Product
4. Complement
5. Reversal
55
56. Union
• Union of two Regular language is also Regular
– L1 = starts with ‘a’ and ends with ‘b’
– L2 = starts with ‘b’ and ends with ‘a’
– 𝐿 = 𝐿1 ∪ 𝐿2 = starts with different symbol
• Let,
𝑴𝟏 = 𝑄1, Σ1, 𝛿1, 𝑞0
1, 𝐹1 DFA for L1 , 𝑴𝟐 = 𝑄2, Σ2, 𝛿2, 𝑞0
2, 𝐹2 DFA for L2
We want to construct M for 𝑳 = 𝐿1 ∪ 𝐿2
𝑴 = 𝑄, Σ, 𝛿, 𝑞0, 𝐹 DFA for L
Where,
𝑸 = 𝑄1 × 𝑄2
𝜮 = Σ1 ∪ Σ2
𝜹 𝑟1, 𝑟2 , 𝑎 = 𝛿1 𝑟1, 𝑎 , 𝛿2 𝑟2, 𝑎
𝒒𝟎= 𝑞0
1, 𝑞0
2
𝑭 = 𝑟1, 𝑟2 | 𝑟1 ∈ 𝐹1 𝑜𝑟 𝑟2 ∈ 𝐹2
56
𝑟1 ∈ 𝑄1 𝑎𝑛𝑑 𝑟2 ∈ 𝑄2
60. Reversal
• L1= starts with ‘a’
– 𝐿1 = {a, aa, ab, aaa, aab, aba,……}
– 𝐿1𝑅 = {a, aa, ba, aaa, baa, aba,……}
• Steps:
– States are same as original
– Convert initial state to final state
– Convert final state to initial state
60
A a
a, b
B
b
C
a, b
A
a
a, b
B
b
C
a, b
This is not DFA it is NFA
If we reverse a DFA of a
language we will get a
reverse language, but we
may or may not get
reverse DFA. Reverse FA is
either DFA or NFA.
Editor's Notes
≅ congruent to
E = Even, O = Odd
Lecture 8: {0,1,2} ternary number where base is 3.
This rule is only for DFA’s not for NFA’s
Final state of 1st DFA is initial state of 2nd DFA
If we reverse a DFA of a language we will get a reverse language, but we may or may not get reverse DFA. Reverse FA is either DFA or NFA.