You are on page 1of 2

CS301-Theory of Automata

Assignment Task # 1

Question no 1: Express the following in terms of regular expression over


{a,b}. Also draw the finite automata for the following?

1. All strings that end and start with a double letter.


2. All strings that do not have ab.
3. All strings that do not have abb.
4. All strings that start with aa or ends with bb.
5. All string where b is never tripled. This means words never contain bbb.
6. All words in which total number of a’s is divisible by three.
7. All strings where a is tripled or b is tripled, but not both. This means that
words should contain either substring aaa or substring bbb but not both.
8. All strings that do not contain aabb as substring.
9. All strings that have length divisible by 5.
10.All strings that never end on aa.
11.All strings that have number of a’s in multiples of 3.
12. All strings that do not have aa or bb at any place.
13. All strings that end with ba.
14. All strings that contain a’s and b’s in any order.
15. All strings that contain equal number of a’s and b’s.

Question no 2: Express the following in terms of regular expression over {a,b}


All strings having odd length. Also draw the finite automata for the
following?
1. All strings that start with the clump ‘ab’ and end at ‘bb’.
2. All strings with even number of a’s and odd number of b’s.
3. All strings with even number of a’s or even number of b’s.
4. All strings with odd number of a’s and even number of b’s.
5. All strings that begin with zero or more b’s followed by any odd clumps
of a’s and odd number of b’s.

Question no 3:
(a). Show that (a+b)* is equivalent to
1. (a*b*)*
2. (a+b*)*
3. b*(ab*)*
4. a*(ba*)*
(b). Show that

1. (a+b)*ab(a+b)* is equivalent to (a+b)*a(a+b)*b(a+b) in a sense they


define same language.
2. ((a+bb)*aa)*is equivalent to Λ + (a+bb)*aa in a sense they define same
language.
3. a(ba + a)*b is equivalent to aa*b(aa*b)* in a sense they define same
language.
4. (a+b)*ab(a+b)*+b*a* = (a+b)*
5. (a+b)*ab[(a+b)*ab(a+b)*+b*a*]+b*a* = (a+b)*

(c) Do you think writing (a+b)* ruins the complete sense of a RE that describes
language defined over {a,b} that restricts using all combinations of a’s and b’s?
Why?

Question no 4: Describe (in English) the languages associated with the


following regular expressions along with finite automata (FA).
1. b*a(b*ab*ab*)*
2. ((a+b)a)*
3. (b(bb)*)*(a(aa)*b(bb)*)*(a(aa)*)*
4. ((a+b)a)*
5. (aa+bb+ab+ba)*

You might also like