100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 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

Institution
Course

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

Connected book

Written for

Institution
Course

Document information

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

Subjects

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)
Follow You need to be logged in order to follow users or courses
Sold
10659
Member since
3 year
Number of followers
4904
Documents
4981
Last sold
8 hours 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

1479 reviews

5
692
4
241
3
245
2
80
1
221

Trending documents

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