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 20 pages
Exam (elaborations)

COS3701 Assignment 2 (COMPLETE ANSWERS) 2025

Document preview thumbnail
Preview 2 out of 20 pages

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

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
 image
Mario Coppo, Elena Lodi Theoretical Computer Science
Publisher: 2005 ISBN: 9783540291060 Edition: Unknown

Document information

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

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.
LIBRARYpro
3,8
(1504)
Sold
10767
Followers
4904
Items
5056
Last sold
5 days ago



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

Working on your references?

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

Working on your references?

Frequently asked questions