[go: up one dir, main page]

0% found this document useful (0 votes)
638 views2 pages

CS402 Assignment#01 Solution VU Ning

This document provides instructions for Assignment No. 01 for the course Theory of Automata – CS402. The objectives of the assignment are to assess students' understanding of languages, regular expressions, and finite automata. Students must submit their assignment in .doc format by November 15, 2019. No late submissions will be accepted. The assignment contains 3 questions worth a total of 20 marks. Question 1 involves showing that pairs of regular expressions define the same language. Question 2 requires developing a regular expression for a language where the letter b is never tripled. Question 3 requires developing a regular expression for a language where a is tripled or b is tripled, but not both.

Uploaded by

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

CS402 Assignment#01 Solution VU Ning

This document provides instructions for Assignment No. 01 for the course Theory of Automata – CS402. The objectives of the assignment are to assess students' understanding of languages, regular expressions, and finite automata. Students must submit their assignment in .doc format by November 15, 2019. No late submissions will be accepted. The assignment contains 3 questions worth a total of 20 marks. Question 1 involves showing that pairs of regular expressions define the same language. Question 2 requires developing a regular expression for a language where the letter b is never tripled. Question 3 requires developing a regular expression for a language where a is tripled or b is tripled, but not both.

Uploaded by

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

Assignment No.

01
Total Marks: 20
Semester: Fall 2019
Due Date: November 15,
Theory of Automata – CS402 2019

Objectives:
Objective of this assignment is to assess the understanding of students about the concept of
languages, regular expressions and finite automata.

Instructions:
Please read the following instructions carefully before submitting assignment:
• You should consult the recommended books, PowerPoint slides and audio lectures to
clarify your concepts.
• You are supposed to submit your assignment in .doc format. Any other formats like scan
images, PDF, zip, rar and bmp etc will not be accepted.
• It should be clear that your assignment will not get any credit if:
• The assignment is submitted after due date.
• The assignment is copied from Internet or from any other student.
• The submitted assignment does not open or file is corrupt.

Note: No assignment will be accepted after the due date through email in any case (load
shedding, server down, internet malfunctioning etc.).
It is recommended to upload solution file at least two days before its closing date.

For any query about the assignment, contact at CS402@vu.edu.pk

Question:
Marks = 20
Q1. Show that the following pairs of regular expressions define the same language over the
alphabet

L = {a, b}.

(i) (ab)*a and a(ba)*


(ii) (a* + b)* and (a + b)*
(iii) (a* + b*)* and (a + b)*

• 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.
[9 marks =
3*3]

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
the substring bbb.
[5 marks]

(Λ + b + bb)(a + ab + abb)*

Since we need to define RE for a language that have strings like {Λ, abb,abba, aabbaa,…}
Hence the RE for this language would be (a * + bb)*

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. [ 6 marks]

((Λ + b + bb)(a + ab + abb)*aaa(Λ + b + bb)(a + ab + abb)*)+ ((Λ + a + aa)(b + ba + baa)*bbb(Λ + a


+ aa)(b + ba + baa)*)

Since we need to develop a RE for a language that have strings like {aaab, bbbaa, aaabb}

Hence the required RE for this language would be (aaa+ + b) + (bbb+ + a)

BEST OF LUCK

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)


+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)
+ http://bit.ly/ningsearch (Click Here to Search Looking For something at ning Site.
+ http://bit.ly/fbvuning (Join also Our Facebook Group For Study Help)

You might also like