CS402 Assignment 1 Solution Fall 2019
CS402 Assignment 1 Solution Fall 2019
Q1. Show that the following pairs of regular expressions define the same language over the
alphabet
L = {a, b}.
Solution:
• Since the strings generated by language (ab)*a and a(ba)* define the same strings ending
in a hence both RE define the same language.
• Both RE define the same language of all string containing any number of a’s and b’s
• Since (a* + b*)* and (a + b)* generate all string containing any number of a’s and b’s
hence both RE define the same language.
Q2. Develop a regular expression for the following language over the alphabet P = {a, b} such
that it accepts all strings in which the letter b is never tripled. This means that no word contains
Answer: since we need to define RE for a language that have strings like {Λ, abb,abba, aabbaa,…}
Q3. Develop a regular expression for the following language over the alphabet P = {a, b} such
that it accepts all strings 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.
Answer: since we need to develop a RE for a language that have strings like {aaab, bbbaa, aaabb}
+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)