CS-850: Advanced Theory of Computation: Adnan Rashid
CS-850: Advanced Theory of Computation: Adnan Rashid
Theory of Computation
(Spring 2020)
Lecture 3
Adnan Rashid
String
Output
“Accept”
or
“Reject”
Finite Automaton/
Finite State Machine
Adnan Rashid Advanced Theory of Computation 2
Deterministic Finite
Automaton (DFA)
a, b
q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4
initial final
state (accepting)
state transition state
Adnan Rashid Advanced Theory of Computation 3
Deterministic Finite
Automaton (DFA)
Alphabet = {a , b } a, b
q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4
To reject a string:
all the input string is scanned and the
last state is non-accepting
Adnan Rashid Advanced Theory of Computation 17
Activity
Write the language of the following DFA
L = ab, abba
Accept Accept
state state
Adnan Rashid Advanced Theory of Computation 18
DFA: Empty Tape
L = {a b : n 0 }
n
= a, b
:Q → Q
(q0 , a ) = q1
(q2 , b ) = q3
1
a b
1
0 0 0 0
1
c d
1
Adnan Rashid Advanced Theory of Computation 43
Activity
M = (Q, , , q0 , F )
Q = a, b, c, d
= 0,1
Initial state = a
F = d
b a d
c d a
d c b
Adnan Rashid Advanced Theory of Computation 45
Extended Transition
Function
:Q → Q
* *
(q ,w ) = q
*
(q0 , ab ) = q2
*
(q1, bba ) = q4
*
w = 1 2 k
L(M ) = w : (q0 ,w ) F
* *
= {a , b }
L(M ) = { }
Empty language
= {a , b }
L( M ) = *
All strings
= {a , b }
L(M ) = { }
Language of the empty string
Adnan Rashid Advanced Theory of Computation 56
Example 3
= {a , b }
L(M ) = awa : w a , b
*
Adnan Rashid Advanced Theory of Computation 60
Regular Languages
Definition:
▪ awa : w a ,b *
▪ { }
▪ { }
▪ {a , b } *
L= {a b : n 0}
n n
ADDITION = {x + y = z : x = 1 , y = 1 , z = 1 , n + m = k}
n m k