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 4 out of 53 pages
Exam (elaborations)

COS2601 Assignment 03 Due August 2026

Document preview thumbnail
Preview 4 out of 53 pages

Comprehensive Study Material; Expert Verified & Exam-Ready This assignment package has been carefully developed to support serious academic preparation. Each solution is thoroughly researched, clearly explained, and backed by credible references giving you not just the answers, but a genuine understanding of the underlying concepts. The material is structured for clarity, making even complex topics approachable without sacrificing depth or accuracy. Whether you're consolidating your knowledge or preparing under time pressure, these resources are designed to help you walk into any exam with confidence.

Content preview

UNIVERSITY OF SOUTH AFRICA
Department of Computer Science


⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄⋄


COS2601: Theoretical Computer Science II

Assignment | Year Module

⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄⋄




COS2601
Module Code:
Theoretical Computer Science II
Module Name:
3
Assignment Number:




Submitted in partial fulfilment of the require-
ments for Theoretical Computer Science II, UNISA

,UNISA | COS2601 Theoretical Computer Science II



Question 1 [10 marks]


1(a) Let S be a set of strings on {a, b} with S = {ba, bb, baa, bab, aba}. For each of the follow-
ing strings, state whether or not it is a word in S ∗ . Justify your answer.


(i) baabababb


The set is:



S = {ba, bb, baa, bab, aba}


A word belongs to S ∗ if it can be formed by concatenating zero or more words from S.

Consider:



baabababb


We try to divide it into words from S:



baabababb = baa · bab · b


The first two parts are valid:



baa ∈ S




bab ∈ S


However:



b∈
/S


Therefore, this decomposition does not work.

Try another possible decomposition:


Page 2 of 53

,UNISA | COS2601 Theoretical Computer Science II




baabababb = ba · aba · babb


Although:



ba ∈ S


and



aba ∈ S


we have:



babb ∈
/S


No decomposition into complete words from S is possible.



/ S∗
baabababb ∈


(ii) babbaab


Consider:



babbaab


We can write:



babbaab = bab · baa · b


Although:



bab ∈ S



Page 3 of 53

, UNISA | COS2601 Theoretical Computer Science II


and



baa ∈ S


the remaining string is:



b∈
/S


Therefore:



/ S∗
babbaab ∈


Thus, neither of the two given strings is a word in S ∗ .


1(b) Provide an example of two sets of strings S and T on {a, b} such that:


S⊈T


and



S ∗ ∩ T ∗ = (S ∩ T )∗


Take:



S = {a}


and



T = {b}


Clearly:



S⊈T

Page 4 of 53

Connected book
 image
Publisher: 1996 ISBN: 9783540620341 Edition: Unknown

Document information

Uploaded on
July 27, 2026
Number of pages
53
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$7.52

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.
BeeNotes
4.1
(40)
Sold
331
Followers
0
Items
974
Last sold
16 hours ago



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

Working on your references?

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

Working on your references?

Frequently asked questions