You are on page 1of 3

Name : Umar Ali

Roll Number : 522

Class # : BS (CS) – 6th Semester

Assignment # : 03

Submitted to : Sir Tawab

Subject : “CS-515-Theory of

Automate”
Q#1. a) Construct a regular expression defining each of the following languages over the
alphabet
Ʃ= {a, b}.

Construction (Regular expression):

1. All words that start with bb and end with aa

Ans: Regular expression:


bb (a + b)* aa

2. All words that start with bb and end in aa OR start with aa and end in bb

Ans: Regular expression:


bb (a + b)* aa + aa (a + b)* bb

3. All words containing at least one double a

Ans: Regular expression:


(a + b)*aa (a + b)*
b) Describe (in English phrases) the languages associated with the following regular
expressions.

Language description for Regular expressionsS:

1. bba (a + b)* b

Ans:
Language of all strings of words, starting with bba and ending with b or
the language of all strings that will always start with consective(double
b’s)and must end with b.

2. (a + b)* abb

Ans:
Language of all strings of words end with abb.

3. a ( a + b )* a + b ( a + b )* b
Ans:
Language of all strings of words, starting with a and ending with a or
starting with b and ending with b.

You might also like