Automata Theory: Lecture 5 & 6
Automata Theory: Lecture 5 & 6
Automata Theory: Lecture 5 & 6
Lecture 5 & 6
Lecture’s Objective:
To understand Finite Automata
Finite automata
• A simple theoretical model of a computer able to decide(yes/no) many
problems.
start off on
BATTERY
input: switch
bulb is on if and only if
output: light bulb there was an odd number of
actions: flip switch flips
states: on, off
Finite Automata - Idea 1
1 start off off
1
2 2 2 2
BATTERY
1
2
off on
1
State a b
q0 q1 q0
q1 q2 q0
F q2 q2 q0
• You have to construct a DFA accepting all possible combinations of notes summing to 4
rupees.
• Modify the FA you constructed in previous part assuming the customer is little bit
dishonest and accepts the change if the shopkeeper mistakenly returns more than 4
rupees.
• Hint: The alphabet set would be as ∑ = {1, 2, 5}
Exercise
Enter a regexp that matches all the items in the first column (positive examples) but none of those in
the second (negative examples).
Positive Negative
pit pt
spot Pot
spate peat
slap two part
respite