Académique Documents
Professionnel Documents
Culture Documents
Theory of Computation
Dr. Muzammil Khan
Assistant Professor
Department of Computer Science
Office E - 12
1
Chapter 4
Finite Automata
Theory of Computation
2
1
10/29/2018
It is called FA because
Finite, because
The number of states and the letters both are finite
Automata, because
The change of the state is totally govern by the input or
The determination of what state is next is automatic not
willful
Theory of Computation
3
Theory of Computation
4
2
10/29/2018
Theory of Computation
5
DFA (Cont...)
Formal definition of DFA
FA is a set of five tuple
That is
FA = {Q, ∑, σ, S, F}
Where
Q is set of states
∑ is an alphabet
σ is a transition
i.e. σ: Q x ZQ is a transition function
S is start/ initial state, usually q0 i.e. q0∈Q
F is set of final states F Q
Theory of Computation
6
3
10/29/2018
DFA Example
Where
Q = {q0, q1, q2, q3}
∑ = {a, b}
S = {q0}
F = {q1, q3}
Transitions (can use Transition table)
σ (q0, a)q1,
σ (q0, b)q2,
σ (q1, a,b)q3,
σ (q2, a)q2,
σ (q2, b)q3 and
σ (q3, a,b)q3
Theory of Computation
7
Pictorial Representation or
Transition Diagram of DFA
In pictorial representation
State is represented by small circle
Start / Initial state as , , , ,
Intermediate state , ,
Final state , ,
Also called halt state, terminal state, accepting state etc…
Theory of Computation
8
4
10/29/2018
Pictorial Representation or
Transition Diagram of DFA (Cont…)
In pictorial representation
Transition represented by arrow “ ”
Arrow head shows direction of transition
Labeled by input (symbol from the alphabet)
Transition Types
Incoming transition
Transition entering a state
Outgoing transition
Transition going away from a state
Loop transition
Transition start and end at the same state
Theory of Computation
9
Transition Table
Transition
Changing of state by reading / scanning an input
Transition Table
Summarize form of transitions
Provide all the information about FA
In table format, where
Each row represent a state of FA
Each column represent is letter
of input alphabet
Theory of Computation
10
5
10/29/2018
Theory of Computation
11
RE = a (a + b)*
Words starting with “a”
RE = (a + b)+ FA ?
Theory of Computation
12
6
10/29/2018
RE = (a + b)
Simply convert RE to FA first, then
Complete the FA
Theory of Computation
13
RE = a* RE = a+
Theory of Computation
14
7
10/29/2018
FA with 4 states
8
10/29/2018
Theory of Computation
18
9
10/29/2018
Theory of Computation
19
Theory of Computation
20
10
10/29/2018
Finite Languages
Examples: Convert RE to DFA
DFA that accept baa only i.e. L = {baa}
Theory of Computation
21
Theory of Computation
22
11
10/29/2018
Homework
Solve the Exercise
Questions 1.1 to 1.7
Page # 83,84
Theory of Computation
23
End of Chapter
Theory of Computation
24
12