Professional Documents
Culture Documents
Lecture 6
Lecture 6
Transition Graphs
Transition Graphs
• Relaxing the Restriction on Inputs
• Looking at TGs
• Nondeterminism
2
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
4
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
5
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
6
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
– We also have problem even with the input baaa. The first three letters take us to
the accept state, but then the picture does not tell us where to go when the last a
is read. (Remember that according to the rules of FAs, one cannot stop reading
input letters until the input string completely runs out.)
7
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
• Definition: When an input string that has NOT been completely read
reaches a state (final or otherwise) that it cannot leave because there
is no outgoing edge that it may follow, we say that the input (or the
machine) crashes at that state. Execution then terminates and the
input must be rejected.
• Note that on an FA it is not possible for any input to crash because there are
always an outgoing a-edge and an outgoing b-edge from each state. As
long as there remains input letters unread, progress is possible.
• There are now two different ways that an input can be rejected: (i) It could
peacefully trace a path ending in a non-final state, or (ii) it
could crash while being processed.
8
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
9
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
• If we first read b, then read a, and then read a, we will loop back
and be stuck at the start state. Hence, the string is rejected in this
case.
• What shall we say? Is this input string a word in the language of this
machine or not?
10
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
11
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
13
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
Example
Consider the Language L , defined over Σ = {a, b} of all
strings including Λ. The language L may be accepted by the
following TG
14
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
Example
15
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
Example
• Consider the language L of strings, defined over Σ={a, b},
having double a or double b.
• The language L can be expressed by RE (a+b)* (aa + bb)
(a+b)*.
• The above language may also be expressed by the following
TGs.
16
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
Looking at TGs
Example
Example
19
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
Example
Example
• We can read all the input letters, one at a time, and stay in the left-
side state. When we read a b, if it is the very last letter of the input
string, we can use it to go to the final state. Note that this b must be
the very last letter, because once we are in the right-side state, if we
try to read another letter, we will crash.
Example
• In this TG, every edge is labeled with a pair of letters. Thus, for a
string to be accepted, it must have an even number of letters.
• Let’s call the left state the balanced state, and the right state the
unbalanced state.
• If the first pair of letters that we read is a double (aa or bb), then we
stay in the balanced state. While in the balanced state, we have
read an even number of a’s and an even number of b’s.
22
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011
EVEN-EVEN
• When a pair of unmatched letters is read (ab or ba), the machine
flips over to the unbalanced state, meaning that it has read an odd
number of a’s and an odd number of b’s.
23
University Institute of Information Technology, PMAS-AAUR