Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
45 views3 pages

Theory of Automata: Assignment#3

The document is an assignment submission for a theory of automata class. It contains the student's name, class, date, and their solutions to 6 questions about regular expressions and languages. The questions cover topics like describing languages from regular expressions, proving equality of regular expressions, eliminating substrings from languages, and specifying occurrences of characters.

Uploaded by

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

Theory of Automata: Assignment#3

The document is an assignment submission for a theory of automata class. It contains the student's name, class, date, and their solutions to 6 questions about regular expressions and languages. The questions cover topics like describing languages from regular expressions, proving equality of regular expressions, eliminating substrings from languages, and specifying occurrences of characters.

Uploaded by

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

Computer Science Department

THEORY OF AUTOMATA

Assignment#3

Name: Muhammad Nabeel Ahmad (181132)


Class: BSCS-F18 (C)
Submitted to: Sir Asif Jamal
Date: May 3rd ,2021
Q1: Describe the language denoted by following regular expression

R.E = (b* (aaa)* b*)*

Solution:

The language can be predicted from the regular expression by finding the
meaning of it. We will first split the regular expression as:

R.E. = (any combination of b's) (aaa)* (any combination of b's)

L = {The language consists of the string in which a's appear triples, there
is no restriction on the number of b's}

Q2: Prove that whether (ab)* is equal OR not equal to a*b*?


Solution:

(ab)* is not equal to a*b* such that:

a*b*!= * (ab)*.

As we know that the language defined by the expression on the right


contains the word abab, which the language defined by the expression on
the left does not. Similarly the expression on the left has ‘a’ and ‘b’ as
separate words but not on the right.

Q3: Let us reconsider the regular expression (a + b)*a(a + b)*b(a + b)*.


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

R.E=(a + b)*a(a + b)*b(a + b)* will generate L={ab, aab, abb, abab,
……….}
& R.E=(a + b)*ab(a + b)* will generate L={ab, aab, abb, abab,……….}

So, both Regular Expressions define same language.

Q4: Write the regular expression for the language L over ∑ = {0, 1} such
that all the string do not contain the substring 01.

Solution:

L = {ε, 0, 1, 00, 11, 10, 100, .....} 
R = (1* 0*)  
Q5: Write the regular expression for the language containing the string
over {0, 1} in which there are at least two occurrences of 1's between
any two occurrences of 1's between any two occurrences of 0's.

Solution:

At least two 1's between two occurrences of 0's can be denoted by


(0111*0)*.

Similarly, if there is no occurrence of 0's, then any number of 1's are also
allowed. Hence the R.E. for required language is:

R = (1 + (0111*0))*  

Q6: Write the regular expression for the language containing the string
in which every 0 is immediately followed by 11.
Solution:

The regular expectation will be:

R = (011 + 1)*  

You might also like