<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CS402 Assignment 1 Solution and Discussion]]></title><description><![CDATA[<pre><code>Assignment No. 01
</code></pre>
<p dir="auto">Semester: Fall 2019<br />
Theory of Automata – CS402	<br />
Total Marks: 20</p>
<p dir="auto">Due Date: November 15, 2019</p>
<p dir="auto">Objectives:<br />
Objective of this assignment is to assess the understanding of students about the concept of languages, regular expressions and finite automata.</p>
<p dir="auto">Instructions:<br />
Please read the following instructions carefully before submitting assignment:</p>
<ol>
<li>You should consult the recommended books, PowerPoint slides and audio lectures to clarify your concepts.</li>
<li>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.</li>
<li>It should be clear that your assignment will not get any credit if:<br />
•	The assignment is submitted after due date.<br />
•	The assignment is copied from Internet or from any other student.<br />
•	The submitted assignment does not open or file is corrupt.</li>
</ol>
<p dir="auto">Note: No assignment will be accepted after the due date through email in any case (load shedding, server down, internet malfunctioning etc.).<br />
It is recommended to upload solution file at least two days before its closing date.</p>
<p dir="auto">For any query about the assignment, <a href="CS402@vu.edu.pk">contact at</a></p>
<p dir="auto">Question:                                                                    				             Marks = 20<br />
Q1. Show that the following pairs of regular expressions define the same language over the alphabet</p>
<p dir="auto">L = {a, b}.</p>
<p dir="auto">(i) (ab)<em>a         and    a(ba)</em><br />
(ii) (a* + b)*    and    (a + b)*<br />
(iii) (a* + b*)* and    (a + b)*<br />
[9 marks = 3*3]<br />
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]</p>
<p dir="auto">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]<br />
BEST OF LUCK</p>
]]></description><link>https://community.secnto.com//topic/574/cs402-assignment-1-solution-and-discussion</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 19:59:52 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/574.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Nov 2019 11:08:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS402 Assignment 1 Solution and Discussion on Fri, 17 Jan 2020 13:17:53 GMT]]></title><description><![CDATA[<p dir="auto"><strong>Q1.</strong> Show that the following pairs of regular expressions define the same language over the alphabet L = {a, b}.</p>
<p dir="auto">(i) (ab)<em>a and (ii) (a</em> + b)* and (iii) (a* + b*)* and<br />
a(ba)* (a + b)* (a + b)*<br />
<strong>Solution:</strong><br />
(i) (ab)<em>a and a(ba)</em> represents same language.<br />
Both will never generate bb’s and both are starting and ending with a<br />
(ii) (a* +b)* (a+b)*<br />
[9 marks = 3<em>3]<br />
(a</em>)<em>+ b</em> a* + b*<br />
a* + b* a* + b*<br />
Both are all strings possible in L = {a,b}<br />
(iii) (a* +b*)* (a+b)* (a*)* + (b*)*<br />
a* + b*<br />
(a + b)* Language with all strings<br />
<strong>Q2.</strong> 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]<br />
<strong>Solution:</strong><br />
The required R.E will be (˄+b+bb) (a+ab+abb)*</p>
<p dir="auto"><strong>Q3.</strong> 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]<br />
<strong>Solution:</strong><br />
(a+ ba + bba)* (˄ + b + bb ) aaa ( a+ ba + bba)* (bb + b + ˄) + (b+ ab + aab)* (aa + a + ˄) bbb (b + ab + aab)* (aa+ a + ˄)</p>
]]></description><link>https://community.secnto.com//post/1551</link><guid isPermaLink="true">https://community.secnto.com//post/1551</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Fri, 17 Jan 2020 13:17:53 GMT</pubDate></item><item><title><![CDATA[Reply to CS402 Assignment 1 Solution and Discussion on Fri, 17 Jan 2020 13:16:26 GMT]]></title><description><![CDATA[<p dir="auto"><a href="/assets/uploads/files/1573730027938-cs402_assignment-01_solution_cyberian.pk.docx">CS402_Assignment#01_Solution_cyberian.pk.docx</a><br />
<img src="/assets/uploads/files/1573729827421-e9b034a6-5143-46d8-a96c-bfbeda3e1b82-image.png" alt="e9b034a6-5143-46d8-a96c-bfbeda3e1b82-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.secnto.com//post/1552</link><guid isPermaLink="true">https://community.secnto.com//post/1552</guid><dc:creator><![CDATA[zaasmi]]></dc:creator><pubDate>Fri, 17 Jan 2020 13:16:26 GMT</pubDate></item><item><title><![CDATA[Reply to CS402 Assignment 1 Solution and Discussion on Fri, 17 Jan 2020 13:17:53 GMT]]></title><description><![CDATA[<p dir="auto"><strong>Q1.</strong> Show that the following pairs of regular expressions define the same language over the alphabet L = {a, b}.</p>
<p dir="auto">(i) (ab)<em>a and (ii) (a</em> + b)* and (iii) (a* + b*)* and<br />
a(ba)* (a + b)* (a + b)*<br />
<strong>Solution:</strong><br />
(i) (ab)<em>a and a(ba)</em> represents same language.<br />
Both will never generate bb’s and both are starting and ending with a<br />
(ii) (a* +b)* (a+b)*<br />
[9 marks = 3<em>3]<br />
(a</em>)<em>+ b</em> a* + b*<br />
a* + b* a* + b*<br />
Both are all strings possible in L = {a,b}<br />
(iii) (a* +b*)* (a+b)* (a*)* + (b*)*<br />
a* + b*<br />
(a + b)* Language with all strings<br />
<strong>Q2.</strong> 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]<br />
<strong>Solution:</strong><br />
The required R.E will be (˄+b+bb) (a+ab+abb)*</p>
<p dir="auto"><strong>Q3.</strong> 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]<br />
<strong>Solution:</strong><br />
(a+ ba + bba)* (˄ + b + bb ) aaa ( a+ ba + bba)* (bb + b + ˄) + (b+ ab + aab)* (aa + a + ˄) bbb (b + ab + aab)* (aa+ a + ˄)</p>
]]></description><link>https://community.secnto.com//post/1551</link><guid isPermaLink="true">https://community.secnto.com//post/1551</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Fri, 17 Jan 2020 13:17:53 GMT</pubDate></item><item><title><![CDATA[Reply to CS402 Assignment 1 Solution and Discussion on Thu, 14 Nov 2019 11:09:46 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://youtu.be/5DILFaH57ok" target="_blank" rel="noopener noreferrer nofollow ugc">https://youtu.be/5DILFaH57ok</a></p>
]]></description><link>https://community.secnto.com//post/1550</link><guid isPermaLink="true">https://community.secnto.com//post/1550</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Thu, 14 Nov 2019 11:09:46 GMT</pubDate></item><item><title><![CDATA[Reply to CS402 Assignment 1 Solution and Discussion on Thu, 14 Nov 2019 11:09:29 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://youtu.be/ZGYwrpIqmYs" target="_blank" rel="noopener noreferrer nofollow ugc">https://youtu.be/ZGYwrpIqmYs</a></p>
]]></description><link>https://community.secnto.com//post/1549</link><guid isPermaLink="true">https://community.secnto.com//post/1549</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Thu, 14 Nov 2019 11:09:29 GMT</pubDate></item></channel></rss>