100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

COS3701 Assignment 3 (COMPLETE ANSWERS) 2025 – DUE August 2025; 100% correct solutions and explanations.

Rating
-
Sold
-
Pages
14
Grade
A+
Uploaded on
29-07-2025
Written in
2024/2025

COS3701 Assignment 3 (COMPLETE ANSWERS) 2025 – DUE August 2025; 100% correct solutions and explanations. Question 1 [10] Given that L1 = (aa)* and L2 = (a + b)*ab(a + b)*. Find grammars for L1 and L2. Then use Theorem 37 to find L1L2. Question 3 [10] Using theorem 42 algorithm to determine whether the following grammar generate any words. S AB A BC C DA B CD D a A b Look at the reformulated version of Theorem 42 in your online study units Question 4 [15] Build a Turing Machine (TM) that • accepts all words in {an bn am | n ≥ 0; m > n} • loops forever on all words starting with b, and • rejects all other words. Assume that the alphabet is Σ = {a, b} Question 5 [15] Build a 2PDA that accepts the language {a2nbnanb2n | n > 0}.

Show more Read less









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
July 29, 2025
Number of pages
14
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

, COS3701 Assignment 3 (COMPLETE ANSWERS)
2025 – DUE August 2025; 100% correct solutions and
explanations.
QUESTION 1

🔹 Step 1: Understand the Languages

 L1 = (aa)*
This language consists of any number (including zero) of repetitions of
"aa". Examples: ε, aa, aaaa, aaaaaa, etc.
 L2 = (a + b)*ab(a + b)*
This language consists of all strings over {a, b} that contain the
substring "ab" at least once.



🔹 Step 2: Find Grammars for L1 and L2

✅ Grammar for L1 = (aa)*

We want a grammar that generates even-length strings made of only a's, in
pairs.

Let’s define the grammar 𝐺1 = (𝑉1, 𝛴, 𝑅1, 𝑆1)𝐺_1 = (𝑉_1,\
𝑆𝑖𝑔𝑚𝑎, 𝑅_1, 𝑆_1)𝐺1 = (𝑉1, 𝛴, 𝑅1, 𝑆1) 𝑤ℎ𝑒𝑟𝑒:

 𝑉1 = {𝑆1}𝑉_1 = \{𝑆_1\}𝑉1 = {𝑆1}
 𝛴 = {𝑎}\𝑆𝑖𝑔𝑚𝑎 = \{𝑎\}𝛴 = {𝑎}
 𝑅1𝑅_1𝑅1 𝑐𝑜𝑛𝑡𝑎𝑖𝑛𝑠:
o 𝑆1 → 𝑎𝑎𝑆1 ∣ 𝜀𝑆_1 \𝑟𝑖𝑔ℎ𝑡𝑎𝑟𝑟𝑜𝑤 𝑎𝑎𝑆_1 \𝑚𝑖𝑑 \𝑣𝑎𝑟𝑒𝑝𝑠𝑖𝑙𝑜𝑛𝑆1 →
𝑎𝑎𝑆1 ∣ 𝜀

𝑇ℎ𝑖𝑠 𝑔𝑟𝑎𝑚𝑚𝑎𝑟 𝑔𝑒𝑛𝑒𝑟𝑎𝑡𝑒𝑠 𝑠𝑡𝑟𝑖𝑛𝑔𝑠 𝑙𝑖𝑘𝑒: 𝜀, 𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑒𝑡𝑐.

✅ 𝑮𝒓𝒂𝒎𝒎𝒂𝒓 𝒇𝒐𝒓 𝑳𝟐 = (𝒂 + 𝒃) ∗ 𝒂𝒃(𝒂 + 𝒃) ∗
𝑊𝑒 𝑤𝑎𝑛𝑡 𝑡𝑜 𝑔𝑒𝑛𝑒𝑟𝑎𝑡𝑒 𝑎𝑛𝑦 𝑠𝑡𝑟𝑖𝑛𝑔 𝑡ℎ𝑎𝑡 𝑐𝑜𝑛𝑡𝑎𝑖𝑛𝑠 𝑎𝑡 𝑙𝑒𝑎𝑠𝑡 𝑜𝑛𝑒 "𝒂𝒃" 𝑠𝑜𝑚𝑒𝑤ℎ𝑒𝑟𝑒 𝑖𝑛

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
MasterVincent University of South Africa (Unisa)
View profile
Follow You need to be logged in order to follow users or courses
Sold
2561
Member since
2 year
Number of followers
452
Documents
1529
Last sold
4 days ago
MasterVincent

On this page, you find all documents, package deals, and flashcards offered by seller MasterVincent.

4,1

375 reviews

5
205
4
68
3
50
2
24
1
28

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions