AUTOMATA
AUTOMATA
AUTOMATA
Department of Mathematics
Lecture Notes
Dr. T. N. Kavitha
Unit I
Automata Theory – Unit I
Unit-I
(FINITE AUTOMATA)
Deterministic finite automata
An automaton has a mechanism to read input, which is string over a given alphabet.
This input is actually written on an input tape /file, which can be read by automaton
but cannot change it. Input file is divided into cells each of which can hold one
symbol. Automaton has a control unit which is said to be in one of finite number of
internal states. The automation can change states in a defined way.
Finite-state machine
Pushdown automata
Linear-bounded automata
Turing machine
The families of automata above can be interpreted in a hierarchical form, where the
finite- state machine is the simplest automata and the Turing machine is the most
complex.
An automaton in which the state set Q contains only a finite number of elements is
called a finite-state machine (FSM).
FSMs are abstract machines, consisting of
a set of states (set Q),
a set of input events (set I),
a set of output events (set Z) and a state transition function.
The state transition function takes the current state and an input event and returns the
new set of output events and the next state. Therefore, it can be seen as a function
which maps an ordered sequence of input events into a corresponding sequence, or set,
of output events.
In order to fully understand conceptually a finite-state machine, consider an analogy
to an elevator:
An elevator is a mechanism that does not remember all previous requests for service
but the current floor, the direction of motion (up or down) and the collection of not-
yet satisfied requests for services. Therefore, at any given moment in time, an elevator
in operated would be defined by the following mathematical terms:
States: finite set of states to reflect the past history of the customers’ requests.
Inputs: finite set of input, depending on the number of floors the elevator is able to
access. We can use the set I, whose size is the number of floors in the building.
Outputs: finite set of output, depending on the need for the elevator to go up or down,
according to customers‘ needs.
Traffic Lights
Video Games
Text Parsing
CPU Controllers
Protocol Analysis
Natural Language Processing
Speech Recognition
Automata Introduction
Symbol:
A symbol is a character or mark.
Alphabet:
A finite non-empty set of symbols is called alphabet. It is denoted by the symbol Σ.
String or Word:
A string or Word is a finite sequence of symbols from the alphabet Σ.
Ex: A string formed from the alphabet Σ = {0,1} is 01,0110, 0011, 010, 0100,
1011, .....etc.
Length of a string:
Length of a string is the number of symbols in a string. If w is the string then length of
the string is denoted as │w│.
Empty String:
A string with no symbols is usually denoted by ϵ.
│ϵ│= 0.
Substring:
Any string of consecutive characters from a string w is called as substring of w.
Reverse of a string:
Concatenation of Strings:
Concatenation of strings w and u is obtained by appending the symbols of string u to
the right end of string w.
Ex:
w = a1a2…..an
u = b1b2…..bn
Concatenation of w and u is
wu = a1a2…..an b1b2…..bn
Ex:
Σ = {0,1}
Σ* = {ϵ , 0, 1, 00, 01, 10, 11, 000, 010,….}
Ex:
Σ = {0,1}
Language:
Language can be defined as a set of strings obtained from Σ*, where Σ denotes
alphabets of that language.
ie, L ⊆ ∑*.
Ex:
Σ = {a, b}
Σ* = {ϵ, a, b, ab, ba, aaa, aab, …..}.
A language of strings consisting of equal number of a’s and b’s can be
L1 = {ab, aabb, abab, baba, …..}
0 1
q0 q1 q0
q1 q1 q2
q2 q1 q0
Problem-02:
Draw a DFA for the language accepting strings ending with ‘abb’ over input
alphabets Σ = {a, b}
Solution:
Regular expression for the given language = (a + b)*abb
Step-01:
All strings of the language ends with substring “abb”.
So, length of substring = 3.
Thus, Minimum number of states required in the DFA = 3 + 1 = 4.
It suggests that minimized DFA will have 4 states.
Step-02:MINIMUM STRING
We will construct DFA for the following strings-
abb
aabb
ababb
abb abb
L(M) = { W | w ends with substring “abb”}
Step-03:
The required DFA is-
Step 4: Transition table
a b
q0 q1 q0
q1 q1 q2
q2 q1 q3
q3 q1 q0
Problem-03:
Draw a DFA for the language accepting strings ending with ‘abba’ over input
alphabets Σ = {a, b}
Solution:
Regular expression for the given language = (a + b)*abba
Step-01:
All strings of the language ends with substring “abba”.
So, length of substring = 4.
Thus, Minimum number of states required in the DFA = 4 + 1 = 5.
It suggests that minimized DFA will have 5 states.
Step-02:
We will construct DFA for the following strings-
abba
aabba
ab abba
abb abba
abba abba
L(M) = { W | w ENDS WITH THE SUBSTRING abba }
Step-03:
The required DFA is
Step 4: Transition table
a b
q0 q1 q0
q1 q1 q2
q2 q1 q3
q3 q4 q0
q4 q1 q2
⊢ ( q4, ℇ )
Since, we reached the final state at the end of input, the string ab abba is accepted
by M.
(iI) DFA action for the input string ab abbab
Consider (q0, ab abbab ) ⊢ M( q1, b abbab )
⊢ M( q2, abbab )
⊢ M ( q1, bbab )
⊢ M ( q2, ba b )
⊢ M ( q3, ab )
⊢ ( q4, b )
⊢ ( q2, ℇ )
Since, we reached the end of input and not in the final state, the string ab abbab is
not accepted by M.
Problem-04:
Draw a DFA for the language accepting strings ending with ‘0011’ over input
alphabets Σ = {0, 1}
Solution:
Regular expression for the given language = (0 + 1)*0011
Step-01:
All strings of the language ends with substring “0011”.
So, length of substring = 4.
Thus, Minimum number of states required in the DFA = 4 + 1 = 5.
It suggests that minimized DFA will have 5 states.
Step-02:
We will construct DFA for the following strings-
0011
00011
000011
0010011
00110011
Step-03:
The required DFA is
Type-02 Problems:
In Type-02 problems, we will discuss the construction of DFA for languages
consisting of strings starting with a particular substring.
Steps To Construct DFA:
Following steps are followed to construct a DFA for Type-02 problems.
Step-01:
Determine the minimum number of states required in the DFA.
Draw those states.
Use the following rule to determine the minimum number of states.
RULE
Calculate the length of substring.
All strings starting with ‘n’ length substring will always require minimum (n+2) states
in the DFA.
Step-02:
Decide the strings for which DFA will be constructed.
Step-03:
Construct a DFA for the strings decided in Step-02.
Remember the following rule while constructing the DFA
RULE
While constructing a DFA,
Always prefer to use the existing path.
Create a new path only when there exists no path to go with.
Step-04:
Send all the left possible combinations to the dead state.
Do not send the left possible combinations over the starting state.
a b
Q0 QF D
QF QF QF
D D D
Problem-03:
Draw a DFA for the language accepting strings starting with ‘101’ over input
alphabets Σ = {0, 1}
Solution-
Regular expression for the given language = 101(0 + 1)*
Step-01:
All strings of the language starts with substring “101”.
So, length of substring = 3.
Thus, Minimum number of states required in the DFA = 3 + 2 = 5.
It suggests that minimized DFA will have 5 states.
Step-02:
We will construct DFA for the following strings
101
1010
1011
10110
101101
Step-03:
The required DFA is
Problem-04:
Draw a DFA that accepts a language L over input alphabets Σ = {0, 1} such that L is
the set of all strings starting with ’00’.
Solution:
Regular expression for the given language = 00(0 + 1)*
Step-01:
All strings of the language starts with substring “00”.
So, length of substring = 2.
Thus, Minimum number of states required in the DFA = 2 + 2 = 4.
It suggests that minimized DFA will have 4 states.
Step-02:
We will construct DFA for the following strings-
00
000
001
00000
Step-03:
The required DFA is
Formal Definition
Non-Deterministic Finite Automata is defined by the quintuple
M = (Q, Σ, δ, q0, F)
Where,
Q = finite set of states
Σ = non-empty finite set of symbols called as input alphabets
δ : Q x Σ → 2Q is a total function called as transition function
q0 ∈ Q is the initial state
Acceptance by NFA
A string ‘w’ is said to be accepted by a NFA if
there exists at least one transition path on which we start at initial state and ends at
final state. δ* (q0, w) = F
In other words,
The language accepted by NFA, M for a string x is defined as,
L(M) = { x | (q0, x) = p, where p contains atleast one member of F}
Or
L(M) = { x | (q0, x)∩ ≠ {φ}}.
This means that the NFA accepts the string x, iff it can reach an accepting state by
reading x starting at the initial state.
Example: ( Language accepted by NFA )
δ(q0, 0) = {q0,q1}
where-
{A, B, C, D, E, F} refers to the set of states
{a, b, c} refers to the set of input alphabets
δ refers to the transition function
A refers to the the initial state
{D, F} refers to the set of final states
States / Alphabets a b c
A {B, F} – –
B – C –
C – – D
D – – –
E – F –
F – – E
States / Alphabets 0 1 ∈
A – B C
B {A, C} C –
C – – –
Two finite accepters are said to be equal in power if they both accepts the same language.
DFA and NFA are both exactly equal in power.
Example-
Consider a language L(M) = { (10)n : n >= 0 }= { 10, 1010, 101010, ……….}
Equivalent NFA for the language L(M) is-
Important Points
Acceptance by NFA-
Example-
Example:
Design an NFA to accept set of all strings starting with ‘a’ followed by ‘a’ or ‘b’ and
ending with a or any number of b’s.
Solution:
It is required to design an NFA for the regular expression r = a*(ab+a+ba)(bb)*
Transition table:
Example:
Construct an NFA that accepts the set of all strings over {0,1} that start with 0 or 1
and end with 01 or 10.
Solution:
It is required to design an NFA for the regular expression r = (0+1)* (01+10).
ie, L(M) = {01, 10, 0010, 1110,011001,…..}
Consider,
Σ = {0, 1}, Q = {q0, q1, q2, q3},
q0 = initial state, F = q3 is the final state and is given by:
Transition diagram:
Problem-01:
Solution-
Transition table for the given Non-Deterministic Finite Automata (NFA) is-
State / Alphabet a b
→q0 q0 q0, q1
q1 – *q2
*q2 – –
Step-01:
Step-02:
State / Alphabet a b
Step-03:
State / Alphabet a b
→q0 q0 {q0, q1}
Step-04:
State / Alphabet a b
Step-05:
Since no new states are left to be added in the transition table T’, so we stop.
States containing q2 as its component are treated as final states of the DFA.
State / Alphabet a b
Problem-02:
Solution-
Transition table for the given Non-Deterministic Finite Automata (NFA) is-
State / Alphabet 0 1
*q2 q0, q1 q1
Step-01:
Step-02:
State / Alphabet 0 1
Step-03:
State / Alphabet 0 1
State / Alphabet 0 1
Step-05:
Since no new states are left to be added in the transition table T’, so we stop.
States containing q2 as its component are treated as final states of the DFA.
State / Alphabet 0 1
Problem-03:
Solution-
Transition table for the given Non-Deterministic Finite Automata (NFA) is-
State / Alphabet a b
→q0 *q1, q2 –
*q1 – –
q2 *q1, q2 q2
Step-01:
Step-02:
State / Alphabet a b
Step-03:
State / Alphabet a b
→q0 {q1, q2} Ø
Step-04:
State / Alphabet a b
q2 {q1, q2} q2
Step-05:
Add transitions for dead state {Ø} to the transition table T’.
State / Alphabet a b
q2 {q1, q2} q2
Ø Ø Ø
Step-06:
Since no new states are left to be added in the transition table T’, so we stop.
States containing q1 as its component are treated as final states of the DFA.
State / Alphabet a b
q2 *{q1, q2} q2
Ø Ø Ø
It is important to note the following points when converting a given NFA into a DFA-
Note-01:
After conversion, the number of states in the resulting DFA may or may not be
same as NFA.
The maximum number of states that may be present in the DFA are 2Number of
states in the NFA
.
Note-02:
In general, the following relationship exists between the number of states in the NFA
and DFA-
1 <= n <= 2m
Here,
n = Number of states in the DFA
m = Number of states in the NFA
Note-03:
In the resulting DFA, all those states that contain the final state(s) of NFA are
treated as final states.
-----------
Non-Deterministic Automata with ϵ-Moves
In some situations, it would be useful to enhance NFAs by allowing transitions that
are not
triggered by any input symbol; such transitions are called ϵ-transitions.
If in a state q, an ϵ-transition to a state q’ is possible, then whenever the automaton
reaches state q in a computation, it can immediately proceed to state q’ without taking
any further input.
This capacity does not expand the class of languages that can be accepted by finite
automata but gives us some programming convenience.
Formal Definition
Non-Deterministic Finite Automata with ϵ-moves is defined by the quintuple
M = (Q, Σ, δ, q0, F)
Where,
Q = finite set of states
Σ = non-empty finite set of symbols called as input alphabets
δ : Q x (Σ ∪ ϵ )→ 2Q is a total function called as transition function
This NFA with ϵ-transitions showing that, without any input symbol, the NFA can be
in the final
state.
Important Points
It is important to note the following points.
Both DFA and NFA are exactly same in power.
For any regular language, both DFA and NFA can be constructed.
There exists an equivalent DFA corresponding to every NFA.
Every NFA can be converted into its equivalent DFA.
There exists no NFA that can not be converted into its equivalent DFA.
Every DFA is a NFA but every NFA is not a DFA.
Example:
Design an NFA with ϵ-moves to accept all the strings with any number of a’s
followed by any
number of b’s followed by any number of c’s.
Solution:
It is required to design an NFA-ϵ for the regular expression r = a*b*c*
ie, L(M) = {ϵ, aa, bb, cc, abc, aabbcc,…..}
Consider,
Σ = {a, b, c}, Q = {q0, q1, q2},
q0 = initial state, F = q2 is the final state and is given by:
Transition diagram:
= {q1}
δ(ϵ-closure ({q0},abc) = δ(ϵ-closure ( δ(ϵ-closure ({q0},ab),c)
= δ(ϵ-closure ({q1},c)
=δ ({q1,q2}, c)
= δ(q1,c) ∪ δ(q2,c)
= {q2}.
⟹ϵ-closure ( δ(ϵ-closure ({q0},abc) = ϵ-closure ({q2}) = {q2}.
Since {q2} is an accepting state, the string abc is accepted.
Example:
Construct an NFA-ϵ to accept the set of all strings over Σ = {0,1} containing an even
number of
0’s or exactly two 1’s.
Solution:
Let M = (Q, Σ, q0, , F) be the NFA-ϵ , where
Q = {q0, q1, q2, q3, q4, q5 }
Σ = {0,1}
q0 = q0 and
F = {q1, q5}.
The transition of M to accept strings containing even number of 0’s or exactly two 1’s
is given below.
Advantages of Non-Deterministic Finite Automata
NFA can be smaller, easier to construct and understand than a DFA that accepts
the
same language.
It is useful for proving some theorems.
It gives a good introduction to non-determinism in more powerful computational
models, where non-determinism plays an important role.
Non-determinism is a kind of parallel computation where several processes can be
running concurrently.
Problem:1
Design an NFA-ϵ that accepts the set of all strings over Σ = {0,1}, which start and end
with 0.
Solution:
Problem:2(HW)
Design an NFA with ϵ-moves to accept the set of all strings over Σ = {a,b} that end in
a or b, followed by any number of a’s and b’s.
Solution:
Keep repeating Step-03 until no new state is present in the transition table T’.
Finally, the transition table T’ so obtained is the complete transition table of the
required DFA.
PRACTICE PROBLEMS BASED ON CONVERTING NFA TO DFA-
Problem-01:
Convert the following Non-Deterministic Finite Automata (NFA) to Deterministic
Finite
Automata (DFA)
Solution:
Transition table for the given Non-Deterministic Finite Automata (NFA) is
State / Alphabet a b
→q0 q0 q0, q1
q1 – *q2
*q2 – –
Step-01:
Let Q’ be a new set of states of the Deterministic Finite Automata (DFA).
Let T’ be a new transition table of the DFA.
Step-02:
Add transitions of start state q0 to the transition table T’.
State / Alphabet a b
Step-03:
New state present in state Q’ is {q0, q1}.
Add transitions for set of states {q0, q1} to the transition table T’.
State / Alphabet a b
Step-04:
New state present in state Q’ is {q0, q1, q2}.
Add transitions for set of states {q0, q1, q2} to the transition table T’.
State / Alphabet a b
Step-05:
Since no new states are left to be added in the transition table T’, so we stop.
States containing q2 as its component are treated as final states of the DFA.
Finally, Transition table for Deterministic Finite Automata (DFA) is
State / Alphabet a b
Problem-02:
Convert the following Non-Deterministic Finite Automata (NFA) to Deterministic
Finite
Automata (DFA)
Solution-
Transition table for the given Non-Deterministic Finite Automata (NFA) is-
State / Alphabet 0 1
Step-01:
State / Alphabet 0 1
Step-03:
State / Alphabet 0 1
Step-04:
Step-05:
Since no new states are left to be added in the transition table T’, so we stop.
States containing q2 as its component are treated as final states of the DFA.
State / Alphabet 0 1
Solution-
Transition table for the given Non-Deterministic Finite Automata (NFA) is-
State / Alphabet a b
→q0 *q1, q2 –
*q1 – –
q2 *q1, q2 q2
Step-01:
Step-02:
State / Alphabet a b
Step-03:
State / Alphabet a b
State / Alphabet a b
q2 {q1, q2} q2
Step-05:
Add transitions for dead state {Ø} to the transition table T’.
State / Alphabet a b
Ø Ø Ø
Step-06:
Since no new states are left to be added in the transition table T’, so we stop.
States containing q1 as its component are treated as final states of the DFA.
State / Alphabet a b
q2 *{q1, q2} q2
Ø Ø Ø
It is important to note the following points when converting a given NFA into a DFA-
Note-01:
After conversion, the number of states in the resulting DFA may or may not be
same as NFA.
The maximum number of states that may be present in the DFA are 2Number of
states in the NFA
.
Note-02:
In general, the following relationship exists between the number of states in the NFA
and DFA-
1 <= n <= 2m
Here,
n = Number of states in the DFA
m = Number of states in the NFA
Note-03:
In the resulting DFA, all those states that contain the final state(s) of NFA are
treated as final states.
-----------
Transitions of NFA-ϵ
With respect to an NFA-ϵ, there exist two transitions.
ϵ-transitions – transitions that take place without reading any input symbols are
called ϵ- transitions.
Non ϵ-transitions – transitions that take place with the reading of input symbols
are called non ϵ-transitions.
A string is said to be accepted by the NFA-ϵ, if atleast one path exists that starts at the
initial state and ends in one of the final states. The path formed contains states with
transitions from ϵ-transitions or non ϵ-transitions.
ϵ- closure:
ϵ- closure for a state is the set of states reachable from the state, without reading any
symbol.
ϵ- closure of a given state ‘q’ is defined as the set of all states of automata, that can be
reached from q on a path labeled by ϵ.
This NFA with ϵ-transitions showing that, without any input symbol, the NFA can be
in the final state.
Important Points
It is important to note the following points.
Both DFA and NFA are exactly same in power.
For any regular language, both DFA and NFA can be constructed.
There exists an equivalent DFA corresponding to every NFA.
Every NFA can be converted into its equivalent DFA.
There exists no NFA that can not be converted into its equivalent DFA.
Every DFA is a NFA but every NFA is not a DFA.
Example:
Design an NFA with ϵ-moves to accept all the strings with any number of a’s
followed by any number of b’s followed by any number of c’s.
Solution:
It is required to design an NFA-ϵ for the regular expression r = a*b*c*
ie, L(M) = {ϵ, aa, bb, cc, abc, aabbcc,…..}
Consider,
Σ = {a, b, c}, Q = {q0, q1, q2},
q0 = initial state, F = q2 is the final state and is given by:
Transition diagram:
To Compute ϵ-closure:
ϵ-closure ({q0}) = {q0, q1, q2}
ϵ-closure ({q1}) = {q1, q2}
ϵ-closure ({q2}) = {q2}.
To compute δ:
δ(ϵ-closure ({q0},a) = δ({q0, q1, q2},a)
= δ(q0,a) ∪ δ(q1,a) ∪ δ(q2, a)
= {q0}.
Solution:
Transition table for the given Non-Deterministic Finite Automata (NFA) is
Step01:
Let Q’ be a new set of states of the Deterministic Finite Automata (DFA).
Let T’ be a new transition table of the DFA.
Step02:
Add transitions of start state q0 to the transition table T’.
Step03:
New state present in state Q’ is {q0, q1}.
Add transitions for set of states {q0, q1} to the transition table T’.
Step-04:
New state present in state Q’ is {q0, q1, q2}.
Add transitions for set of states {q0, q1, q2} to the transition table T’.
Step-05:
Since no new states are left to be added in the transition table T’, so we stop.
States containing q2 as its component are treated as final states of the DFA.
Finally, Transition table for Deterministic Finite Automata (DFA) is
Now, Deterministic Finite Automata (DFA) may be drawn as
Problem-02:
Convert the following Non-Deterministic Finite Automata (NFA) to Deterministic
Finite Automata (DFA)
Solution:
Transition table for the given Non-Deterministic Finite Automata (NFA) is
Step-01:
Let Q’ be a new set of states of the Deterministic Finite Automata (DFA).
Let T’ be a new transition table of the DFA.
Step-02:
Add transitions of start state q0 to the transition table T’.
Step-03:
New state present in state Q’ is {q1, q2}.
Add transitions for set of states {q1, q2} to the transition table T’.
Step-04:
New state present in state Q’ is {q0, q1, q2}.
Add transitions for set of states {q0, q1, q2} to the transition table T’.
State/AlpHabet 0 1
->q0 q0 {q1, q2}
{q1,q2} {q0, q1, q2} {q1, q2}
{q0,q1,q2} {q0,q1,q2} {q1,q2}
Step-05:
Since no new states are left to be added in the transition table T’, so we stop.
States containing q2 as its component are treated as final states of the DFA.
Finally, Transition table for Deterministic Finite Automata (DFA) is
Problem-03:
Convert the following Non-Deterministic Finite Automata (NFA) to Deter
ministic Finite Automata (DFA)
Solution:
Transition table for the given Non-Deterministic Finite Automata (NFA) is
State/AlpHabet a b
->q0 *q1, q2 -
*q1 - -
q2 *q1,q2 q2
Step-01:
Let Q’ be a new set of states of the Deterministic Finite Automata (DFA).
Let T’ be a new transition table of the DFA.
Step-02:
Add transitions of start state q0 to the transition table T’.
Step-03:
New state present in state Q’ is {q1, q2}.
Add transitions for set of states {q1, q2} to the transition table T’.
Step-04:
New state present in state Q’ is q2.
Add transitions for state q2 to the transition table T’
Step-05:
Add transitions for dead state {Ø} to the transition table T’.
Step-06:
Since no new states are left to be added in the transition table T’, so we stop.
States containing q1 as its component are treated as final states of the DFA.Finally,
Transition table for Deterministic Finite Automata (DFA) is
References:
1. “A text book on Automata Theory” , Nasir S.F.B and P.K.Srimani, Combridge
University Press India Pvt.Ltd. ISBN 978-81-7596-545-4
2. www.tutorialspoint.com
3. www.gatevidyalay.com
4.Formal Languages and Automata By Peter Linz
5.Automata Theory, Languages & Computation By Ullman
6.Introduction to Theory of Computation By Michael Sipser
Answer Key
Unit I-Finite Automata
Part A
1. Define DFA.
6. Define string.
8. Define language.
The transition function δ : Q x ∑ → 2Q, specifies the state into which the machine
will move, on the basis of current state and the symbol it reads. Symbolic
representation is δ ( qi, a) = {qj,qk} which says that there is a transition from the state
qi to {qj, qk} when the machine reads the symbol “a”.
11. What do you mean by transition in a finite automaton?
At first input pointer points to the first cell of the tape pointing to the string to be
processed. After scanning the current input symbol, the machine may enter in to any
one of the states and the pointer moves one cell towards right. When the end of the
string is encountered, the string is accepted iff the automaton will be in one of the
final states.
DFA NFA
There can be zero or one There can be zero , one or more
transition from a state on an transition from a state on an
input symbol input symbol
More number of transitions Less number of transitions
Difficult to construct Easy to construct
Less powerful More powerful than DFA
A string is said to be accepted by NFA-∈, if at least one path exists that starts at the
initial state and ends in one of the final state. The path formed contains states with
transitions from ∈- transitions or non ∈-transitions.
Assignment 2 – unit 1 – Automata- 16 mark questions
1. Obtain a DFA to accept strings of a’s and b’s starting with the string ab.
2. Obtain a DFA to accept strings of a’s and b’s ending with the string abb.
3. Obtain a DFA to accept strings of a’s and b’s that do not end with the string abb.
4. Obtain a DFA to accept strings of a’s and b’s having a sub string aab.
5. Obtain a DFA to accept strings of 0’s and 1’s having 3 consecutive zeros.
6. Obtain a DFA to accept strings of a’s and b’s such that
L awa / w a b where n 0
n
7. Obtain a DFA to accept strings of a’s and b’s ending with ab or ba.
8. Obtain a DFA to accept a string of 0’s, 1’s and 2’s beginning with “0” followed by odd
number of 1’s and ending with a “2”.
9. Obtain a DFA to accept strings of a’s and b’s having even number of a’s and even
number of b’s.
10. Obtain a DFA to the language L={w: na(w) ≥ 1; nb(w) =2 }
11. Obtain a DFAto accept the language L= {w: w has odd number of 1’s followed by
even number of 0’s}.
12. Design a finite automaton that accepts sets of strings such that every string ends in 00
over alphabet ∑ = {0,1}.
13. Design a finite automaton that accepts sets of strings where the number of 0’s in every
string is a multiple of three over alphabet ∑= {0, 1}.
14. Design a finite automatonthat accepts sets of strings containing exactly four 1’s in
every string over ∑ = {0,1}.
15. Obtain an NFA to accept the following language
L {w / w abab n or aba n n 0}
16. Obtain an NFA to accept strings of a’s and b’s ending with ab or ba.
17. Obtain the DFA for the following NFA