Lec02 FiniteAutomata
Lec02 FiniteAutomata
0 0,1
1 1
A B C
Start 0
Final states
starred Columns =
0 1 input symbols
* A A B
Arrow for * B A C
start state C C C
Rows = states
^
(q,) = q
^
(q,xa) = ( ^
(q,x), a)
L(A) = { w | ^
(q0,w) F }
0 0,1
1 1
A B C
Start 0
• This DFA accepts all strings of 0’s and 1’s without two consecutive
1’s.
• Formally,
L(A) = { w |w is in {0,1}* and w does not have two consecutive 1’s }
Start 0
BİL405 - Automata Theory and Formal Languages 10
Proof Part 1 : S⊆T
Important concept:
If the “if” part of “if..then” is false,
the statement is true.
• Since ^
(A, w) = A, ^
(A, x) must be A or B, and a must be 0 (look at
the DFA).
(A, w) = B, ^
• Since ^ (A, x) must be A, and a must be 1 (look at the
DFA).
Start 0
BİL405 - Automata Theory and Formal Languages 16
Nondeterministic Finite Automata (NFA)
• A NFA can be in several states at once, or, it can "guess" which state to
go to next.
• A NFA state can have more than one arc leaving from that state with a
same symbol.
• Example: An automaton that accepts all and only strings ending in 01.
• In fact, all missing arcs go to a death state, the death state goes to itself
for all symbols, and the death state is a non-accepting state.
NFA is
Basis: ^
(q,) = q
Induction: If ^
(q,x) = {p1,p2,...,pk} for a string x, then
^
(q,xa) = ⋃ ( , )
For the string w = xa, we compute ^ (q,x) first, then we follow any
transition from any of the states with the symbol a.
• i.e. a string w is accepted by a NFA A iff the states that are reachable
from the starting state by consuming w contain at least one final state.
NFA
DFA
Transition Table
Basis: qECLOSE(q)
ECLOSE(1) = {1,2,3,4,6}
ECLOSE(2) = {2,3,6}
ECLOSE(3) = {3,6}
ECLOSE(4) = {4}
ECLOSE(5) = {5,7}
ECLOSE(6) = {6}
ECLOSE(7) = {7}
BİL405 - Automata Theory and Formal Languages 40
Exdended Delta for -NFA
• Inductive definition ^
of for -NFA
Basis:
Induction: