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

COS3701 Assignment 2 (COMPLETE ANSWERS) 2025 - DUE 2025; 100% TRUSTED Complete, trusted solutions and explanations. Ensure your success with us..

Rating
-
Sold
-
Pages
13
Grade
A+
Uploaded on
02-07-2025
Written in
2024/2025

COS3701 Assignment 2 (COMPLETE ANSWERS) 2025 - DUE 2025; 100% TRUSTED Complete, trusted solutions and explanations. Ensure your success with us..

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 2, 2025
Number of pages
13
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COS3701
Assignment 2
(COMPLETE
ANSWERS) 2025
NO PLAGIARISM
[Pick the date]
[Type the company name]


, Exam (elaborations)
COS3701 Assignment 2 (COMPLETE
ANSWERS) 2025
Course

 Theoretical Computer Science III (COS3701)
 Institution
 University Of South Africa (Unisa)
 Book
 Theoretical Computer Science

COS3701 Assignment 2 (COMPLETE ANSWERS) 2025 - DUE 2025; 100%
TRUSTED Complete, trusted solutions and explanations. Ensure your success
with us..



Question 1 10 Find CFGs for all words that do not have the substring aba
over the alphabet Σ = {a b}.

To define a Context-Free Grammar (CFG) that generates all words over the alphabet Σ = {a,
b} that do NOT contain the substring "aba", we need to carefully avoid introducing this
specific sequence.



✅ Step-by-step plan:

We define a grammar that ensures “aba” never appears. We do this by keeping track of what
has come so far — especially if an "a" has appeared and might be followed by "b", which might
then be followed by "a" (and thus form “aba”).



✅ Variables (non-terminals):

Let’s define the states (non-terminals) as follows:

 S: Start symbol, represents strings that have not yet started forming "aba".
 A: Represents strings that have just seen an "a".
 AB: Represents strings that have just seen "ab" — we must not allow another "a" after
this.

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.
ivymwendwa47820 University of South Africa (Unisa)
Follow You need to be logged in order to follow users or courses
Sold
357
Member since
1 year
Number of followers
156
Documents
883
Last sold
1 month ago

3.6

71 reviews

5
29
4
13
3
13
2
5
1
11

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