Lecture 2 - Theory of Automata and Formal Languages
Lecture 2 - Theory of Automata and Formal Languages
FORMAL LANGUAGES
Ahtiqa Tabassum
Lecture 2
Automata
Initial State
Final State
Transition
Deterministic Finite Automaton (DFA)
Transition Table
■ A DFA can also be represented by a transition table, where each row corresponds to
a state, and each column corresponds to an input symbol. The table shows the next
state for each state and input symbol.
Deterministic Finite Automaton (DFA)
Acceptance by DFA
To accept a string:
■ all the input string is scanned and the last state (q final) is accepting
qfinal F
To reject a string:
■ all the input string is scanned and the last state (q last) is non-accepting
qlast F qlast (Q − F )
Finite Automata
■ A finite automaton is a model that has a finite set of states (represented in the figure by
circles) and its control moves from one state to another state in response to external
inputs (represented by arrows).
Finite automata without output
■ Deterministic finite automata.
■ Non deterministic finite automata.
■ Non deterministic finite automata with E
Finite automata with output
■ Moore machine
■ Mealy machine
Activity
L(M ) = {a b : n 0}
n
a a, b
b a, b
q0 q1 q2
b a
L = L( M ) q4
a, b
Activity
a, b
L(M ) = { all strings with prefix ab }
q0 a q1 b q2
b a accept
q3 a, b
Activity
L (M ) = { all binary strings containing
substring 001 }
0,1
1 0
1
0 0 00 1 001
0
Activity
L (M ) = { all binary strings without
substring 001 }
1 0 0,1
1
0 1
0 00 001
0
Activity
= {a , b } a, b a, b
q0 q0
L(M ) = { } L(M ) = *
= {a , b } a, b
q0 a, b q0
L(M ) = { }
Language of the empty string
THANK YOU!