0% found this document useful (0 votes)
12 views

Lecture#08

The document discusses regular languages and finite automata. It defines regular languages as those generated by regular expressions and notes that operations like union, concatenation and Kleene star produce regular languages. It also states that all finite languages are regular and provides examples of regular expressions and finite automata.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Lecture#08

The document discusses regular languages and finite automata. It defines regular languages as those generated by regular expressions and notes that operations like union, concatenation and Kleene star produce regular languages. It also states that all finite languages are regular and provides examples of regular expressions and finite automata.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

THEORY OF AUTOMATA(CS-2208)

Introduction to computer theory, Daniel I. A. Cohen, 2nd Edition 1


Regular Languages
• Definition:
− The language generated by any regular
expression is called a regular language.
− It is to be noted that if r1, r2 are regular
expressions, corresponding to the languages
L1 and L2 then the languages generated by
− r1+ r2,
− r1r2( or r2r1)
&
− r1*( or r2*)
are also regular languages.
2
Example
• If r1=(aa+bb) and r2=(a+b) then the language of
strings generated by r1+r2, is also a regular language,
expressed by (aa+bb)+(a+b)

• If r1=(aa+bb) and r2=(a+b) then the language of


strings generated by r1r2, is also a regular language,
expressed by (aa+bb)(a+b)

• If r=(aa+bb) then the language of strings generated


by r*, is also a regular language, expressed by
(aa+bb)*

3
Note
• It is to be noted that if L1 and L2 are expressed by
r1and r2, respectively then the language expressed by
r1+ r2, is the language L1 + L2 or L1 U L2

• r1r2, , is the language L1L2, of strings obtained by


prefixing every string of L1 with every string of L2

• r1*, is the language L1*, of strings obtained by


concatenating the strings of L, including the null
string.

4
Note

• If r1 =(aa + bb) and r2=( a + b) then


− r1+r2 =(aa + bb) + (a + b)

− r1r2 =(aa + bb) (a + b)


=(aaa + aab + bba + bbb)

− (r1)* =(aa + bb)*

5
All Finite Languages Are
Regular.
Example:
Consider the language L, defined over
Σ={a,b}, of strings of length 2, starting with
a, then
L={aa, ab}, may be expressed by the regular
expression aa+ab. Hence L, by definition, is a
regular language.

6
Note
It may be noted that if a language contains
even thousand words, its RE may be
expressed, placing ‘ + ’ between all the
words.
Here the special structure of RE is not
important.
Consider the language L={aaa, aab, aba,
abb, baa, bab, bba, bbb}, that may be
expressed by a
RE: aaa+aab+aba+abb+baa+bab+bba+bbb,
which is equivalent to (a+b)(a+b)(a+b).
7
Defining Languages
(continued)…
Definition:
A Finite automaton (FA), is a collection of the
followings
1) Finite number of states, having one initial and
some (maybe none) final states.
2) Finite set of input letters (Σ) from which input
strings are formed.
3) Finite set of transitions i.e. for each state and for
each input letter there is a transition showing
how to move from one state to another.

8
Example

• Σ = {a,b}
• States: x, y, z where x is an initial state and z is
final state.
• Transitions:
1. At state x reading a go to state z,
2. At state x reading b go to state y,
3. At state y reading a, b go to state y
4. At state z reading a, b go to state z

9
Example Continued …

• These transitions can be expressed by the


following table called transition table

Old States New States

Reading a Reading b
x- z y
y y y
z+ z z

10
Note

• It may be noted that the information of an FA,


given in the previous table, can also be
depicted by the following diagram, called the
transition diagram, of the given FA
a,b

y
b

x–
a,b
a
Z+
11
Remark

• The previous transition diagram is an FA


accepting the language of strings, defined
over Σ={a, b}, starting with a. It may be
noted that this language may be expressed
by the regular expression
a (a + b)*

12

You might also like