Professional Documents
Culture Documents
Theory of Computation
5
What does a DFA do?
Input: a word w in ∑*
Question: Is w acceptable by the DFA?
Steps:
Start at the “start state” q0
For every input symbol in the sequence w do
Compute the next state from the current state, given the current input
symbol in w and the transition function
If after all symbols in w are consumed, the current state is
one of the accepting states (F) then accept w;
Otherwise, reject w.
6
q0 0,1
L(M) = {0,1}*
0 0
1
q0 q1
1
0,1
1 0
0 0 1
q q0 q00 q001
1
:Example
a a a/b/c
c c
q0 q1 q2
b b
a c c c b accepted
a a c rejected
• Q = {q0,q1,q2}
• ∑ = {0,1}
• start state = q0
1 0 0,1
• F = {q2}
start 0 1
q0 q1 q2 • Transition table
symbols
0 1
Accepting
q0 q1 q0
state
states q1 q1 q2
*q2 q2 q2
11
State Diagram and Table a
a
b
b
q0 q1 q2
a
b
d a b
q0 q0 q1
q1 q0 q2
q2 q2 q2
:Example
Let M be the following DFA.
0 0,1
1 1
A B C
Start 0
Start
q0 q1
0 0 0 0
q2 q3
21
Extended transition function
For example: given the transition table below
˄
Compute the δ(q, w) , w = 110101
22
Extended transition function