Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 10 pages
Exam (elaborations)

COS3701 Assignment 3 (DETAILED ANSWERS) 2025 - DISTINCTION GUARANTEED

Document preview thumbnail
Preview 2 out of 10 pages

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}.

Content preview

COS3701
Assignment 3 2025
Unique #:

Due Date: 2025

Detailed solutions, explanations, workings
and references.

+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 | Ʌ




Varsity Cube 2025 +27 81 278 3372

Connected book
 image
Mario Coppo, Elena Lodi Theoretical Computer Science
Publisher: 2005 ISBN: 9783540291060 Edition: Unknown

Document information

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

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
VarsityC
4.1
(2905)
Sold
29158
Followers
13262
Items
3392
Last sold
14 hours ago

Reviews from verified buyers




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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions