4 Dfa
4 Dfa
Ziwen Pan
Email: [email protected]
Basic model for machines
State Diagram
Finite Automata -- informal
Example
Example
Example
Example
Example
Example
Example
Example
Example
Deterministic Finite Automata
A deterministic finite automaton 𝑀 can be viewed as a classifier that filters out all the
strings it accepts
-- The set 𝐴 of all the strings 𝑀 accepts is the language of machine 𝑀
-- Denote as 𝐿 𝑀 = 𝐴
-- 𝑀 recognizes/accepts 𝐴
Deterministic Finite Automata
A deterministic finite automaton 𝑀 can be viewed as a classifier that filters out all the
strings it accepts
-- The set 𝐴 of all the strings 𝑀 accepts is the language of machine 𝑀
-- Denote as 𝐿 𝑀 = 𝐴
-- 𝑀 recognizes/accepts 𝐴
0,1
𝑏 𝑏 𝑏 𝑎, 𝑏
• 𝑄 = {𝑞 0 , 𝑞1, 𝑞2, 𝑞 3 }
𝑎 𝑎 𝑎
• Σ = {𝑎, 𝑏 } 𝑞0 𝑞1 𝑞2 𝑞3
• 𝛿=
{((𝑞0 , 𝑎), 𝑞1), ((𝑞0, 𝑏), 𝑞0), ((𝑞1, 𝑎), 𝑞2), ((𝑞1, 𝑏), 𝑞1),
((𝑞2, 𝑎), 𝑞3), ((𝑞2, 𝑏), 𝑞2), ((𝑞3, 𝑎), 𝑞3), ((𝑞3, 𝑏), 𝑞 3 )}
• start state = 𝑞0
• 𝐹 = {𝑞 2 }
DFA Configurations
We use a binary relation ⊢ M to denote that DFA pass from one state to
another state as a result of a single move
⊢ M is a function from 𝐾 × Σ + to 𝐾 × Σ ∗ (L+ = 𝐿𝐿∗ )
1 1 1
𝑞0 𝑞1 𝑞2 𝑞3
0 0 0
1 1 1
𝑞0 𝑞1 𝑞2 𝑞3
0 0 0
𝑎, 𝑏 𝑎, 𝑏 𝑎, 𝑏 𝑎, 𝑏
𝑞0 𝑞1 𝑞2 𝑞3 𝑞4
DFA –> regular language
All strings over {𝑎, 𝑏} that does not contain three consecutive 𝑏’s
DFA Examples
𝑎
Regular language
Identify states
Regular language -> DFA
Identify transitions
Regular language -> DFA
𝑞 𝑞0 𝑞00 𝑞001
Regular language -> DFA
𝑞 𝑞0 𝑞00 𝑞001
Regular language -> DFA
Transitions
Regular operations