1. All six expressions in the document are regular expressions that generate regular languages. The document provides explanations for the languages generated by each regular expression.
2. The document then asks for regular expressions for eight new languages over the alphabet {a,b}. It provides the regular expression for each language, with explanations for some of the expressions.
1. All six expressions in the document are regular expressions that generate regular languages. The document provides explanations for the languages generated by each regular expression.
2. The document then asks for regular expressions for eight new languages over the alphabet {a,b}. It provides the regular expression for each language, with explanations for some of the expressions.
1. All six expressions in the document are regular expressions that generate regular languages. The document provides explanations for the languages generated by each regular expression.
2. The document then asks for regular expressions for eight new languages over the alphabet {a,b}. It provides the regular expression for each language, with explanations for some of the expressions.
1. All six expressions in the document are regular expressions that generate regular languages. The document provides explanations for the languages generated by each regular expression.
2. The document then asks for regular expressions for eight new languages over the alphabet {a,b}. It provides the regular expression for each language, with explanations for some of the expressions.
To: Sir Naveed Ahmed Khan. Due date: 13 November, Friday. Questions 1: Whether following are RE, if so what languages do they generate. 1. b(b+a)* = {a ,aa, ab , aaa, aab, aba, abb,….} A language starts with an ‘a’ and is followed by any number of ‘a’s or ‘b’s. 2. bb(a+b) = {bba, bbb} A language starts with double b’s and is followed by either only one a or only one b. 3. (a+b) (a+b) (a+b) = {aaa, aab, aba, abb, baa, bab, bba, bbb} A language starts with either an ‘a’ or a ‘b’ and is followed by either an ‘a’ or a ‘b’ and is followed by an ‘a’ or ‘b’ in the end. 4. (a+b)*ba = {ba, aba, bba, aaba, bbba, aaaba, bbbba,…….} A language starts with any number of ‘a’s or ‘b’s and always ends with an ‘ba’. 5. (a+b)*a(a+b)* = {a, aa, ba, ab, aaa, aab, baa, bab, aaaa, bbaa, aaab, bbab,… , abb, bba,…} A language starts with any number of ‘a’s or ‘b’s and is followed by an single ‘a’ and is followed by any number of ‘a’s or ‘b’s. 6. (a+b)*aa(a+b)* = {aa, aaa, baa, aab, aaaa, aaab, baaa, baab, aaaa, bbaa, aaab, bbaab,… , aabb, bbaabb,…} A language starts with any number of ‘a’s or ‘b’s and is followed by ‘aa’ and is followed by any number of ‘a’s or ‘b’s. Questions 2: Write RE for the following languages over the ={a,b}. 1) All words ending with b: R.E = (a+b)*b 2) All words that start with a: R.E = a(a+b)* 3) All words that start with a double letter: R.E = ((a+b) (a+b)) (a+b)* 4) All words that contain at least one double letter: R.E = (a+b)* ((a+b) (a+b)) (a+b)* 5) All words that start and end with a double letter: R.E = ((a+b) (a+b)) (a+b)* ((a+b) (a+b)) 6) All words of length >=3: R.E= (a+b) (a+b) (a+b) (a+b)* 7) All words that contain exactly one a or exactly one b: R.E = a*ba* + b*ab* 8) All words that don’t end at b: R.E = (a+b)*(a)