You are on page 1of 17

Lecture 07: Theory of Automata:2011

Generalized Transition Graphs


(GTG)

University Institute of Information Technology, PMAS-AAUR


Lecture 07: Theory of Automata:2011

Definition
A generalized transition graph (GTG) is a collection of
three things:
1. A finite set of states, of which at least one is a start
state and some (maybe none) are final states.

2. An alphabet ∑ of input letters.

3. Directed edges connecting some pair of states labeled


with regular expression.

4. Directed edges connecting some pairs of states, each


labeled with a regular expression.
2
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

Example
• Consider this GTG:

• This GTG accepts all strings without a double b.


• Note that the word containing the single letter b can take
the free ride along the Λ-edge from start to middle, and
then have letter b read to go to the final state.

3
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

• Note that there is no difference between the Kleene star


closure for regular expressions and a loop in transition
graphs, as illustrated in the following figure:

• In the first picture we may loop in the middle state or go


to the third state. To not loop corresponds to taking the Λ
choice from the b*-edge in the second picture.

4
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

Example
• Consider the language L of strings, defined over Σ =
{a,b}, containing double a or double b

• The language L can be expressed by the following


regular expression (a+b)* (aa + bb) (a+b)*
• The language L may be accepted by the following GTG.

5
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

• Consider the Language L of strings, defined over Σ =


{a, b}, beginning with and ending in same letters.
• The language L may be expressed by the following
regular expression (a+b)+ a(a + b)*a + b(a + b)*b.
• This language may be accepted by the following GTG

6
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

• Consider the language L of strings, defined over Σ =


{a, b}, having triple a or triple b.
• The language L may be expressed by RE (a+b)* (aaa +
bbb) (a+b)*
• This language may be accepted by the following GTG

7
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

TG vs GTG

8
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

FA vs GTG

University Institute of Information Technology, PMAS-AAUR 9


Lecture 07: Theory of Automata:2011

NonDeterminism
(NFA)

University Institute of Information Technology, PMAS-AAUR


Lecture 07: Theory of Automata:2011

NonDeterminism
• We have already seen that in a TG, a particular string of
input letters may trace through the machine on different
paths, depending on our choice of grouping.

• This figure shows part of some TG.

• The input string abb can go from state 3 to state 4, or to


state 5, depending on whether we read the letters two and
one, or all three at once.
11
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

NonDeterminism
• The ultimate path through the machine is NOT
determined by the input alone. Human choice becomes
a factor in selecting the path. The machine does not
make all its own determination.

• Therefore, we say that TGs are nondeterministic.

12
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

NonDeterminism

13
University Institute of Information Technology, PMAS-AAUR
Lecture 07: Theory of Automata:2011

Example

University Institute of Information Technology, PMAS-AAUR 14


Lecture 07: Theory of Automata:2011

University Institute of Information Technology, PMAS-AAUR 15


Lecture 07: Theory of Automata:2011

• Accept Language that contains substring aa

University Institute of Information Technology, PMAS-AAUR 16


Lecture 07: Theory of Automata:2011

DFA vs NFA

University Institute of Information Technology, PMAS-AAUR 17

You might also like