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 (DETAILED ANSWERS) 2025 - DISTINCTION GUARANTEED

Rating
5,0
(1)
Sold
16
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









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

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 #:

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

Reviews from verified buyers

Showing all reviews
3 months ago

5,0

1 reviews

5
1
4
0
3
0
2
0
1
0
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

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.
VarsityC AAA School of Advertising
View profile
Follow You need to be logged in order to follow users or courses
Sold
28681
Member since
8 year
Number of followers
13258
Documents
3117
Last sold
1 week ago

4,1

2819 reviews

5
1490
4
581
3
392
2
117
1
239

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