0% found this document useful (0 votes)
25 views18 pages

Lesson 05

The document discusses the construction of finite automata (FA) for various languages defined over the alphabet Σ = {a, b}. It provides examples of transition diagrams and tables for languages of even and odd lengths, as well as those starting or ending with specific letters. Additionally, it notes that multiple FAs can correspond to a single language, but each FA uniquely accepts a language.

Uploaded by

kashafbutt72
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views18 pages

Lesson 05

The document discusses the construction of finite automata (FA) for various languages defined over the alphabet Σ = {a, b}. It provides examples of transition diagrams and tables for languages of even and odd lengths, as well as those starting or ending with specific letters. Additionally, it notes that multiple FAs can correspond to a single language, but each FA uniquely accepts a language.

Uploaded by

kashafbutt72
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 18

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

1
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.

2
Example Continued …

 These transitions can be expressed by the


following transition table

Old States New States


Reading Reading
a b
x± y y

y x x

3
Example Continued …

 It may be noted that the previous


transition table may be depicted by the
following transition diagram.

a, b

x y

a, b

4
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))*

5
TASK

Build an FA for the language L of


strings, defined over Σ={a, b}, of
odd length.

6
Solution of Task

a,b

– +

a,b

7
Example: Consider the language L of
strings, defined over Σ={a, b}, starting
with b. The language L may be expressed
by RE b(a + b)* , may be accepted by the
a,b
following FA
––
b +

a,b
a

1
8
 Example:
Consider the language L of strings,
defined over Σ={a, b}, ending in a.
The language L may be expressed by
RE
(a+b)*a
This language may be accepted by the
following FA

9
Example Continued …

b a a

– +

There may be another FA corresponding to


the given language.
10
Example continued …

a
a
–– +

a b
b

11
Note

 It may be noted that corresponding to a


given language there may be more than
one FA accepting that language, but for a
given FA there is a unique language
accepted by that FA.

12
Note

 It is to be noted that given the languages L1


and L2 ,where
L1 = The language of strings, defined over
Σ={a, b}, beginning with a
L2 = The language of strings, defined over
Σ={a, b}, not beginning with b
The  does not belong to L1 while it does belong
to L2 . This fact may be depicted by the
corresponding transition diagrams of L1 and L2.

13
FA1 Corresponding to L1

a,b

––
a +

b a,b

 The language L may be expressed by the


1
regular expression a(a + b)*
14
FA2 Corresponding to L2
a,b

a
 +

a,b
b

 The language L2 may be expressed by the


regular expression a (a + b)* + Λ
15
Example
 Consider the Language L of Strings of length two
or more, defined over Σ = {a, b}, beginning with
and ending in same letters.
The language L may be expressed by the following
regular expression
a (a + b)* a + b (a + b)* b
It is to be noted that if the condition on the length of
string is not imposed in the above language then
the strings a and b will then belong to the
language.
This language L may be accepted by the following FA

16
Example Continued …

b a a

+
a b

a b b
b
+
a

17
Task

 Build an FA accepting the Language L of


Strings, defined over Σ = {a, b},
beginning with and ending in same
letters.

18

You might also like