0% found this document useful (1 vote)
589 views3 pages

Automata Chapter 3 Regular Expression PDF

The document presents a series of problems involving regular expressions and the languages they define. It asks the reader to construct regular expressions for specific languages over the alphabet {a,b}, prove equivalences between regular expressions, and describe languages in English. It also presents proofs about properties of regular expressions and languages.

Uploaded by

Nabeel Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
589 views3 pages

Automata Chapter 3 Regular Expression PDF

The document presents a series of problems involving regular expressions and the languages they define. It asks the reader to construct regular expressions for specific languages over the alphabet {a,b}, prove equivalences between regular expressions, and describe languages in English. It also presents proofs about properties of regular expressions and languages.

Uploaded by

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

Automata Chapter 3 regular expression

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.

3. All words that contain at least one of the strings s, s2 s3 or s4.

4. All words that contain exactly three b's in total.

5. All words that contain exactly two b's or exactly three b's, not more.

6. (i) All strings that end in a double letter.

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

9. (i) All strings that do not have the substring ab.

(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

12. Let us reconsider the regular expression

(a + b)*a(a + b)*b(a + b)*

(i)Show that this is equivalent to (a + b)*ab(a + b)* in the sense that they define the same language.

(ii) Show that (a + b)*ab(a +b)* + b*a* = (a + b)*

(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

(i) S* = A + S + S' + S2 + S3 + S4 + ...

(ii) S+ = S + S1 + S2 + S3 + S4 + ...

Show that the following pairs of regular expressions define the same language over the alphabet

∑ = {a, b}.

14. (i) (ab)*a and a(ba)*

(ii) (a* + b)* and (a + b)*

(iii) (a* + b*)* and (a + b)*

15. (i) A* and A

(ii) (a*b)*a* and a*(ba*)*

(iii) (a*bbb)*a* and a*(bbba*)*

16. (i) ((a + bb)*aa)* and A + (a + bb)*aa

(ii) (aa)*(A + a) and a*

(iii) a(aa)*(A + a)b + b and a*b

17. (i) a(ba + a)*b and aa*b(aa*b)*

(ii) A + a(a + b)* + (a + b)* aa(a + b)* and ((b*a)*ab*)*

Describe (in English phrases) the languages associated with the following regular expressions.

18. (i) (a + b)* a(A + bbbb)

(ii) (a(a + bb)*)*

(iii) (a(aa)*b(bb)*)*

(iv) (b(bb)*)*(a(aa)*b(bb)*)*

(v) (b(bb)*)*(a(aa)*b(bb)*)*(a(aa)*)*

(vi) ((a + b)a)*

19. (D.N. Arden) Let R, S, and T be three languages and assume that. A is not in S. Prove the following
statements.

(i) From the premise that R = SR + T, we can conclude that R = S*T.

(ii) From the premise that R = S*T, we can conclude that R = SR + T.


20. Explain why we can take any pair of equivalent regular expressions and replace the letter a in
both with any regular expression R and the letter b with any regular expression S and the resulting
regular expressions will have the same language.

For example, 15.(ii)

(a*b)*a* = a*(ba*)*

becomes the identity

(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

((a + bb)*(ba*))*(a + bb)* = (a + bb)* ((ba*)(a + bb)*)*

What is the deeper meaning of this transformation? What identity would result from using

R = (ba*)* S = (A + b)

You might also like