Beruflich Dokumente
Kultur Dokumente
03-0:
Regular expressions are one way to specify a formal language String Generator Generates strings in the language
03-1:
DFA Example
03-2:
DFA Example
03-3:
DFA Example
b 0 a b 1 a b 2 a a,b 3
03-4:
DFA Example
03-5:
DFA Example
03-6:
DFA Components
b 0 a
b 1 a
b 2 a
a,b 3
03-7:
DFA Components
b 0
States
b a 1 a
b 2 a
a,b 3
03-8:
DFA Components
b 0 a
b 1 a
b 2 a
a,b 3
03-9:
DFA Components
b 0
Transitions
b a 1 a
b 2 a
a,b 3
03-10:
DFA Components
b 0 a
b 1 a
b 2 a
a,b 3
Initial State
03-11:
DFA Components
b 0 a
b 1 a
b 2 a
a,b 3
03-12:
DFA Denition
A DFA is a 5-tuple M = (K, , , s, F ) K Set of states Alphabet : (K ) K is a Transition function s K Initial state F K Final states
03-13:
DFA Denition
b a 1 a b 2 a a,b 3
b 0
K = {q0 , q1 , q2 , q3 } = {a, b} = {((q0 , a), q1 ), ((q0 , b), q0 ), ((q1 , a), q2 ), ((q1 , b), q1 ), ((q2 , a), q3 ), ((q2 , b), q2 ), ((q3 , a), q3 ), ((q3 , b), q3 )} s = q0 F = {q2 }
03-14:
Create a DFA for: All strings over {0, 1} that contain the substring 1001
03-15:
Create a DFA for: All strings over {0, 1} that contain the substring 1001
0 0 1
1 1 0 2 1 0 0 3 1
0,1 4
03-16:
Create a DFA for: All strings over {0, 1} that end with 111
03-17:
Create a DFA for: All strings over {0, 1} that end with 111
0 0 1 1 0 1 2 0 1 0
1 3
03-18:
Create a DFA for: All strings over {0, 1} that begin with 111
03-19:
Create a DFA for: All strings over {0, 1} that begin with 111
0,1 4 0 0 1 0 1 1 0 2 1 0,1 3
03-20:
Create a DFA for: All strings over {0, 1} that begin or end with 111
03-21:
Create a DFA for: All strings over {0, 1} that begin or end with 111
0,1 0 0 0 4 1 0 1 1 1 1 0 1 0 2 1 3 1 6 0 7
5 0
03-22:
Create a DFA for: All strings over {0, 1} that begin and end with 111
03-23:
Create a DFA for: All strings over {0, 1} that begin and end with 111
0,1 8 0 0 1 0 1 1 0 0 4 1 5 0 1 6 0 1 0 0 2 1 1 3 1 7
03-24:
Create a DFA for: All strings over {0, 1} that contain 1001 or 0110
03-25:
Create a DFA for: All strings over {0, 1} that contain 1001 or 0110
1 1 1 0 0 4 0 1 5 0 1 1 6 0 0 1 2 0 3 0 7 0,1 1
03-26:
Create a DFA for: All strings over {a, b} that begin and end with the same letter
03-27:
Create a DFA for: All strings over {a, b} that begin and end with the same letter
a b 1 a 0 b 1 b b a 2 a a 2 b
03-28:
Why DFA?
Why are these machines called Deterministic Finite Automata Deterministic Each transition is completely determined by the current state and next input symbol. That is, for each state / symbol pair, there is exactly one state that is transitioned to Finite Every DFA has a nite number of states Automata (singular automaton) means machine
(From Merriam-Webster Online Dictionary, denition 2: A machine or control mechanism designed to follow automatically a predetermined sequence of operations or respond to encoded instructions)
03-29:
03-30:
K
Binary relation M : What machine M yields in one step
03-31:
((q0 , abba), (q2 , bba)) M can also be written (q0 , abba) M (q2 , bba)
03-32:
0 0 1 1 0 1 2 0 1 0
(q0 , 11101) M M M M M
03-33:
0 0 1 1 0 1 2 0 1 0
(q0 , 10111) M M M M M
03-34:
03-35:
Language accepted by a machine M = L[M ] {w : (sM , w) (f, ) for some f FM } M DFA Languages, LDF A Set of all languages that can be dened by a DFA