Recap Lecture 5: Different Notations of Transition Diagrams, Languages of Strings of Even Length, Odd
Recap Lecture 5: Different Notations of Transition Diagrams, Languages of Strings of Even Length, Odd
1
TASK
2
Solution continued …
a,b
1 – 2+
a,b
3
Task
Build an FA accepting the Language L of Strings,
defined over Σ = {a, b}, beginning with and
ending in same letters.
Solution:The language L may be expressed by
the following regular expression
(a+b)+a(a + b)*a + b(a + b)*b
This language L may be accepted by the
following FA
4
Solution continued …
a b a
a
b 6+
2+ 4
a b
1– b a b
b
b a
3+ 5 7+
a
5
Example
6
Example Continued …
a b b
2 4+
a a
1–
b a
a
b
3 5+
b
7
Example Continued …
a,b
(a + b)*
8
Example
a,b
1 2+
9
Example
a,b
a,b
– +
12
Equivalent FAs Continued …
a,b
FA1 a,b
– +
a,b
FA2 1 –
a,b 2
a,b a,b
a,b
FA3 1– 2 3
+
13
Note (Equivalent FAs)
14
Example
15
Example Continued …
b a,b
a
a
1- 2 3+
b
16
Example
Consider the language L of strings, defined over
Σ={0, 1}, having double 0’s or double 1’s,
The language L may be expressed by the
regular expression
(0+1)* (00 + 11) (0+1)*
This language may be accepted by the following
FA
17
Example Continued …
0
0
0,1
- 0 1 +
1
1
y
18
Example
19
Example Continued …
2 a
4
a
a
b a,b
1–– a b 6+
b a
b
3 b 5
20
Example
21
Example Continued …
1 3
b
a a a a
2 4
b
22
Summing Up
23