Automata Theory
Automata Theory
DFA (Deterministic Finite Automaton) NFA to DFA Conversion (cont) Regular Expressions
Automaton Repres‐ M=(Q,Σ,δ,q0,F) 3. Set every DFA state as accepting if it L(r1+r2) = L(r1) ∪ L(r2)
entation contains an accepting state from the NFA L(r1•r2) = L(r1)L(r2)
Q: Set of states {q0,q1,q2} The language for the NFA (M) and DFA (M') L(r1*) = (L(r1))*
Σ: input alphabet {a,b} & ε ∉ Σ are equivalent
L(a) = {a}
L(M)=L(M')
δ: transition δ(q,x)=q'
Precedence: * → + → • → +
function
Properties of Regex
q0: initial state NFA to Regular Language
L1 ∪ L2 Initial state has two ε transi‐
F: set of accepting {q2} 1. Transform each transition into regex (e.g.
tions, one to L1 and one to
states (a,b) is a+b
L2
Language of L(M)={ w∈Σ* : δ* 2. Remove each state one by one, until you
L1L2 L1 accept state tranitions
Automaton (q0,w)∈F} are left with the initial and accepting state
(ε) to L2 initial state
Languages are regular if a DFA exists for 3. Resulting regular expression: r = r1*
L1* New initial state transitions
that language. r2(r4+r3r1*r2)* where:
to L1 initial state. New
DFA: Each state has one transition for r1: initial → initial
accept state transitions (ε)
evrey alphabet r2: initial → accepting
from L1 accept state. Initial
to accept state transition r3: accepting → initial
NFA (Non-deterministic Finite r4: accepting → accepting
transitions (ε) and vice
Automaton)
versa.
Formal Definition M=(Q,Σ,Δ,S,F) Proving Regularity with Pumping
L1R Reverse all transitions.
Lemma
Q: Set of states {q0,q1,q2} (reverse) Make initial state accepting
Σ: input alphabet {a,b} state and vice versa. Prove than an infinite language L is not
regular:
Δ: transition Δ(q,x)={q1,q2,...} !(L1) Accepting states become
function (include ε) Complement non-accepting and vice 1. Assume L is regular
versa 2. The pumping lemma should hold for L
S: initial states {q0}
L1 ∩ L2 !( !(L1) ∪ !(L2) ) 3. Use the pumping lemma to obtain a
F: set of accepting {q2}
states P.S. To turn multiple states to one accept contradiction:
Language of L(M) = {w1,w2,...,wn} state in an NFA, just add a new accept a. Let m be the critical length for L
Automaton state, and add transition to the old accept b. Choose a particular string w∈L which
states with language ε. satisfies the length condition |w|≥m
NFA: Each state can have different
transition with the same language output c. Write w=xyz
Intersection DFA1 ∩ DFA2
d. Show that w'=xyi z∉L for some i≠1
NFA to DFA Conversion Transitions DFA M: (q1,p1)→a→‐
M1: (q2,p2)
1. Set initial state of NFA to initial state of
q1→a→q2
DFA
M2:
2. Take the states in the DFA, and compute
p1→a→p2
in the NFA what the union Δ of those states
Initial State DFA M: (q0,p0)
for each letter in the alphabet and add them
M1: q0
as new states in the DFA.
For example if (q0,a) takes you to {q1,q2} M2: p0
add a state {q1,q2}. If there isn't one, the Accept State DFA M: (qi,pj) , (qi,pk)
add state null M1: qi
M2: pj,pk