Beruflich Dokumente
Kultur Dokumente
1
Overview
● Finite Automata
● Regular Language
● DFA
● NFA
● Finite Automata with Epsilon moves
● Start Start
● Accept State
● Transition
● Dead State
If A is the set of all strings that machine M accepts, we say that A is the
language of machine M and write L(M ) = A
6 : Chandan J, Dept of ISE, NIE - Mysuru
Finite Automata
Transition
0 1 Diagram
→ q1 q1 q2
* q2 q3 q2
Transition q3 q2 q2
Table
● δ`(q,𝝐) = q
● For all strings w and input symbol a,
δ`(q,wa) = δ(δ`(q,w),a)
● Consider L(M7) = {w| w is even length and begins with 01} , what will be the
state of the machine after the string 011101
○ δ`(q0,𝝐) = q0
…………….
L(A) = { w | 𝛅` (q0,w) is in F }
● When the machine is in a given state and reads the next input symbol, we
know what the next state will be—it is determined. We call this deterministic
computation.
● In a nondeterministic machine, several choices may exist for the next state
at any point.
● Example for NFA : guessing the words while typing ( many states after
getting a single input )
● Like DFA, NFA also has finite set of states, finite set of input symbols, one
start state and a set of accepting states.
● Difference lies in transition function ( 𝛅 ), it takes a state and an input
symbol and returns zero, one or more states ( DFA’s transition function
gives exactly one state)
● Any set accepted by NFA can also be accepted by DFA
● If a string w is accepted by DFA, then from q0 there is one and only one path
labeled w to any one of the final state
● In case of NFA there may be many paths labeled w, and all must be checked
to see whether one or more terminate at a final state.
20 : Chandan J, Dept of ISE, NIE - Mysuru
Computing in NFA
● If there are multiple transitions on a particular symbol, the machine splits into multiple
copies of itself and follows all the possibilities in parallel
● If a state with an ε symbol on an exiting arrow is encountered, something similar
happens. Without reading any input, the machine splits into multiple copies, one
following each of the exiting ε-labeled arrows and one staying at the current state.
● Nondeterminism may be viewed as a kind of parallel computation wherein multiple
independent “processes” or “threads” can be running concurrently.
● When the NFA splits to follow several choices, that corresponds to a process “forking”
into several children, each proceeding separately.
● If at least one of these processes accepts, then the entire computation accepts.
21 : Chandan J, Dept of ISE, NIE - Mysuru
22 : Chandan J, Dept of ISE, NIE - Mysuru
● Consider the following NFA and the input 010110
● From state q1, there are 2 transitions on 1
● From state q2, there is a transition labeled 𝝐
𝛅(q1,0) = q1
…...
L(A) = { w | 𝛅` (q0,w) ∩ F ≠ ∅ }
δD ( S, a ) = ⋃ p in S δN( p,a )
0,1
1 0,1
q0 q1 * q2
ჶ ჶ ჶ
𝛅 0 1
{q0} {q0} {q0, q1}
ჶ ჶ ჶ
{q1} {q2} {q2}
{q0} {q0} {q0, q1}
{q2} ჶ ჶ
{q0, q1} {q0, q2} {q0, q1, q2}
{q0, q1} {q0, q2} {q0, q1, q2}
{q0, q2} {q0} {q0, q1}
{q0, q2} {q0} {q0, q1}
{q0, q1, q2} {q0, q2} {q0, q1, q2}
{q1, q2} {q2} {q2}
● NFA = { Q, 𝝨, 𝞭, q0, F }, then NFA with its 𝜺 transition has all the components
same except 𝞭.
● 𝞭 = Q x ( 𝝨 ⋃ { 𝜺 } ) to 2Q . i.e, 𝞭 (q,a) will contain all states p s.t there is a
transition labeled a from q to p, where a is either 𝜺 or a symbol from 𝝨
● Epsilon close of a state q is set of all states which has transition from q
labeled epsilon