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

Rating
-
Sold
1
Pages
20
Grade
A+
Uploaded on
16-06-2025
Written in
2024/2025

COS3701 Assignment 2 2025 ; 100 % TRUSTED workings, Expert Solved, Explanations and Solutions. For assistance call or W.h.a.t.s.a.p.p us on ...(.+.2.5.4.7.7.9.5.4.0.1.3.2)........... Theoretical Computer Science III - COS3701










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

Document information

Uploaded on
June 16, 2025
Number of pages
20
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

COS3701
ASSIGNMENT 2 2025

UNIQUE NO.
DUE DATE: 2025

, Theoretical Computer Science III

Question 1 [10 marks]

Find CFGs for all words that do not have the substring "aba" over the alphabet ∑
= {a, b}.

To generate all strings not containing "aba", construct a CFG that keeps track of
recent characters and avoids transitions leading to "aba".

Let:

 S = start symbol
 A = last character was a
 AA = last two characters were aa (we're avoiding "aba")
 B = last character was b

CFG:

S → aA | bS | ε
A → aA | bB
B → aAA | bS | ε
AA → aAA | bB

Explanation:

 S begins the string and avoids directly producing "aba".
 A remembers a single a, AA remembers two as.
 B continues from a b, carefully checking that we don't reach "aba".

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.
LIBRARYpro University of South Africa (Unisa)
View profile
Follow You need to be logged in order to follow users or courses
Sold
10509
Member since
2 year
Number of followers
4904
Documents
4813
Last sold
1 week ago
LIBRARY

On this page, you find all documents, Package Deals, and Flashcards offered by seller LIBRARYpro (LIBRARY). Knowledge is Power. #You already got my attention!

3,7

1453 reviews

5
680
4
234
3
243
2
78
1
218

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