Automata Chapter 3 Regular Expression PDF
Automata Chapter 3 Regular Expression PDF
1.Let r1, r2, and r3 be three regular expressions. Show that the language associated with (r1 + r2) r3
is the same, as the language associated with r1 r3 + r2r3. Show that r1 (r2 + r 3) is equivalent to r1r2
+ r1r3. This will be the same as "proving a distributive law" for regular expressions.
Construct a regular expression defining each of the following languages over the alphabet ∑ = {a, b}.
2. All words in which ‘a’ appears tripled, if at all. This means that every clump of a's contains 3 or 6
or 9 or 12... a's.
5. All words that contain exactly two b's or exactly three b's, not more.
(ii) All strings that have exactly one double letter in them.
7. All strings in which the letter b is never tripled. This means that no word contains the substring
bbb.
8. All words in which ‘a’ is tripled or b is tripled, but not both. This means each word contains the
substring aaa or the substring bbb but not both.
(ii) All strings that do not have both the substrings bba and abb.
10. All strings in which the total number of a's is divisible by three, such as aabaabbaba.
11. (i) All strings in which any b's that occur are found in clumps of an odd number at a time, such as
abaabbbab.
(ii) All strings that have an even number of a's and an odd number of b's. (iii) All strings that have an
odd number of a's and an odd number of b's.
REGULAR EXPRESSIONS 61
(i)Show that this is equivalent to (a + b)*ab(a + b)* in the sense that they define the same language.
(iii) Show that(a + b)* ab[(a + b)*ab(a + b)* + b*a*] + b*a* = (a + b)*
(iv) Is (iii) the last variation of this theme or are there more beasts left in this cave?
13. We have defined the product of two sets of strings in general. If we apply this to the case where
both factors are the same set, S = T, we obtain squares, S2. Similarly we can define S3, S4. Show that
(ii) S+ = S + S1 + S2 + S3 + S4 + ...
Show that the following pairs of regular expressions define the same language over the alphabet
∑ = {a, b}.
Describe (in English phrases) the languages associated with the following regular expressions.
(iii) (a(aa)*b(bb)*)*
(iv) (b(bb)*)*(a(aa)*b(bb)*)*
(v) (b(bb)*)*(a(aa)*b(bb)*)*(a(aa)*)*
19. (D.N. Arden) Let R, S, and T be three languages and assume that. A is not in S. Prove the following
statements.
(a*b)*a* = a*(ba*)*
(R*S)*R* = R*(SR*)*
which is true for all regular expressions R and S. In particular R = a + bb, S = ba* results in the
complicated identity
What is the deeper meaning of this transformation? What identity would result from using
R = (ba*)* S = (A + b)