Tài liệu Bài giảng Theory Of Automata - Lecture 06: 1Recap lecture 5
Different notations of transition diagrams, 
languages of strings of even length, Odd 
length, starting with b, ending in a (with 
different FAs), beginning with a, not 
beginning with b, beginning with and 
ending in same letters
2TASK 
Build an FA for the language L of strings, 
defined over Σ={a, b}, of odd length. 
Solution:The language L may be 
expressed by RE 
(a+b)((a+b)(a+b))* or 
((a+b)(a+b))*(a+b)
This language may be accepted by the 
following FA
3Solution continued 
2 +
a,b
1 –
a,b
4Task 
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
5Solution continued 
a
b
b
6+
a
a
7+
b
b
a
1–
4
b
5
a
b
a
2+
3+
a
b
6Example
Consider the Language L of Strings , defined 
over Σ = {a, b}, ...
                
              
                                            
                                
            
 
            
                 23 trang
23 trang | 
Chia sẻ: honghanh66 | Lượt xem: 1419 | Lượt tải: 0 
              
            Bạn đang xem trước 20 trang mẫu tài liệu Bài giảng Theory Of Automata - Lecture 06, để tải tài liệu gốc về máy bạn click vào nút DOWNLOAD ở trên
1Recap lecture 5
Different notations of transition diagrams, 
languages of strings of even length, Odd 
length, starting with b, ending in a (with 
different FAs), beginning with a, not 
beginning with b, beginning with and 
ending in same letters
2TASK 
Build an FA for the language L of strings, 
defined over Σ={a, b}, of odd length. 
Solution:The language L may be 
expressed by RE 
(a+b)((a+b)(a+b))* or 
((a+b)(a+b))*(a+b)
This language may be accepted by the 
following FA
3Solution continued 
2 +
a,b
1 –
a,b
4Task 
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
5Solution continued 
a
b
b
6+
a
a
7+
b
b
a
1–
4
b
5
a
b
a
2+
3+
a
b
6Example
Consider the Language L of Strings , defined 
over Σ = {a, b}, beginning with and ending 
in different letters.
The language L may be expressed by the 
following regular expression
a (a + b)* b + b (a + b)* a
This language may be accepted by the following 
FA 
7Example Continued 
b
a
b
a
4+
b
2
a
a
b
5+
a
3
b1–
8Example
Consider the Language L , defined over 
Σ = {a, b} of all strings including Λ, The 
language L may be accepted by the following FA
The language L may also be accepted by the 
following FA 
a,b
2+1
a,b
9Example Continued 
The language L may be expressed by the 
following regular expression
(a + b)*
a,b
10
Example
Consider the Language L , defined over 
Σ = {a, b} of all non empty strings. The 
language L may be accepted by the following FA
The above language may be expressed by the 
following regular expression (a + b)+
a,b
+–
a,b
11
Example 
Consider the following FA, defined over
Σ = {a, b}
It is to be noted that the above FA does not 
accept any string. Even it does not accept the 
null string. As there is no path starting from 
initial state and ending in final state.
– +
a,b
a,b
12
Equivalent FAs
It is to be noted that two FAs are said to 
be equivalent, if they accept the same 
language, as shown in the following FAs.
13
Equivalent FAs Continued 
a,b
21–
a,b
a,b
21–
a,b
a,b
3
+
FA1
FA2
FA3
– +
a,b
a,b
14
Note (Equivalent FAs) 
FA1 has already been discussed, while in FA2, 
there is no final state and in FA3, there is a final 
state but FA3 is disconnected as the states 2 and 
3 are disconnected. 
It may also be noted that the language of 
strings accepted by FA1, FA2 and FA3 is denoted 
by the empty set i.e.
{ } OR Ø
15
Example
Consider the Language L of strings , 
defined over Σ = {a, b}, containing 
double a.
The language L may be expressed by the 
following regular expression
(a+b)* (aa) (a+b)*.
This language may be accepted by the 
following FA 
16
Example Continued 
a,b
2
ab
a
b
1- 3+
17
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
18
Example Continued 
0
1
0
1
10
0,1
- +
x
y
19
Example
Consider the language L of strings, defined over 
Σ={a, b}, having triple a’s or triple b’s. 
The language L may be expressed by RE 
(a+b)* (aaa + bbb) (a+b)*
This language may be accepted by the following 
FA
20
Example Continued 
2
a
1––
3
6+
4
5
a
a
a,b
b
b
b
a b
b
a
21
Example
Consider the EVEN-EVEN language, defined 
over Σ={a, b}. As discussed earlier that 
EVEN-EVEN language can be expressed by 
the regular expression 
(aa+bb+(ab+ba)(aa+bb)*(ab+ba))*
EVEN-EVEN language may be accepted by the 
following FA 
22
Example Continued 
b
b
b
b
a a a a
1
4
3
2
23
Summing Up
Language of strings beginning with and 
ending in different letters, Accepting all 
strings, accepting non-empty strings, 
accepting no string, containing double a’s, 
having double 0’s or double 1’s, containing 
triple a’s or triple b’s, EVEN-EVEN
            Các file đính kèm theo tài liệu này:
 theory_of_automata_cs402_power_point_slides_lecture_06_7758.pdf theory_of_automata_cs402_power_point_slides_lecture_06_7758.pdf