Theory of Automata and Formal Languages
Theory of Automata and Formal Languages
Theory of Automata and Formal Languages
Formal Languages
LECTURE 05
Review
RE, Recursive definition of RE, defining languages by RE, { x}*, { x}+, {a+b}*,
Language of strings having exactly one aa, Language of strings of even length,
Language of strings of odd length, RE defines unique language (as Remark),
Language of strings having at least one a, Language of strings havgin at least
one a and one b, Language of strings starting with aa and ending in bb,
Language of strings starting with and ending in different letters.
Regular expression of EVEN-EVEN language, Difference between a* + b* and
(a+b)*, Equivalent regular expressions; sum, product and closure of regular
expressions; regular languages, finite languages are regular, introduction to
finite automaton, definition of FA, transition table, transition diagram.
Note
It may be noted that to indicate the initial state, an arrow
head can also be placed before that state and that the final
state with double circle, as shown below. It is also to be
noted that while expressing an FA by its transition diagram,
the labels of states are not necessary.
a, b
a, b
Example
Σ = {a,b}
States: x, y, where x is both initial and final state.
Transitions:
1.At state x reading a or b go to state y.
2.At state y reading a or b go to state x.
Example-
Continued…
These transitions can be expressed by
the following transition table
Example- Continued…
It may be noted that the previous transition table may be depicted
by the following transition diagram.
Example- Continued…
The previous transition diagram is an FA accepting the language of
strings, defined over Σ={a, b} of even length. It may be noted that
this language may be expressed by the regular expression
((a+ b) (a + b))*
Practice Problem
Build an FA for the language L of strings, defined over
Σ={a, b}, of odd length.
Solution
Practice Problems
1. Consider the language, defined over Σ={a, b} of words
beginning with a