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

COS3701 Assignment 3 (DETAILED ANSWERS) 2025 - DISTINCTION GUARANTEED

Rating
-
Sold
-
Pages
10
Grade
A+
Uploaded on
01-07-2025
Written in
2024/2025

COS3701 Assignment 3 (DETAILED ANSWERS) 2025 - DISTINCTION GUARANTEED - DISTINCTION GUARANTEED - DISTINCTION GUARANTEED Answers, guidelines, workings and references ,.... 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
Institution
Course









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

Connected book

Written for

Institution
Course

Document information

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

Subjects

Content preview

COS3701 Assignment 3 2025
Unique Number:
Due date: 2025
QUESTION 1

CFG for L₁ = (aa)*

S1 → aaS1 | Ʌ

This can generate zero occurrences of aa or one or more occurrences of aa as required.




CFG for L₂ = (a + b)ab(a + b)

S2 → XabY

X → aX | bX | Ʌ

Y → aY | bY | Ʌ




DISCLAIMER & TERMS OF USE
 Educational Aid: These study notes are intended to be used as educational resources and should not be seen as a
replacement for individual research, critical analysis, or professional consultation. Students are encouraged to perform
their own research and seek advice from their instructors or academic advisors for specific assignment guidelines.
 Personal Responsibility: While every effort has been made to ensure the accuracy and reliability of the information in
these study notes, the seller does not guarantee the completeness or correctness of all content. The buyer is
responsible for verifying the accuracy of the information and exercising their own judgment when applying it to their
assignments.
 Academic Integrity: It is essential for students to maintain academic integrity and follow their institution's policies
regarding plagiarism, citation, and referencing. These study notes should be used as learning tools and sources of
inspiration. Any direct reproduction of the content without proper citation and acknowledgment may be considered
academic misconduct.
 Limited Liability: The seller shall not be liable for any direct or indirect damages, losses, or consequences arising from
the use of these notes. This includes, but is not limited to, poor academic performance, penalties, or any other negative
consequences resulting from the application or misuse of the information provided.

, For additional support +27 81 278 3372

QUESTION 1

CFG for L₁ = (aa)*

S1 → aaS1 | Ʌ

This can generate zero occurrences of aa or one or more occurrences of aa as
required.



CFG for L₂ = (a + b)ab(a + b)

S2 → XabY

X → aX | bX | Ʌ

Y → aY | bY | Ʌ




By Theorem 37, CFG for L₁L₂:

S → S1 S2

S1 → aaS1 | Ʌ

S2 → XabY

X → aX | bX | Ʌ

Y → aY | bY | Ʌ



QUESTION 2

Given CFG:

S → AB

A → BC | b

B → CD

C → DA

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.
Edge
Follow You need to be logged in order to follow users or courses
Sold
9850
Member since
2 year
Number of followers
4253
Documents
2745
Last sold
5 hours ago

4.2

1206 reviews

5
674
4
244
3
187
2
28
1
73

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 tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card 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