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
Other

COS2601 Assignment 02 Solutions 2026

Rating
-
Sold
-
Pages
34
Uploaded on
10-07-2026
Written in
2025/2026

COS2601 Assignment 02 Solutions 2026

Institution
Course

Content preview

COS2601 Assignment 2 Solutions 2026
UNISA

,QUESTION 1

(a)

Let

𝑆 = {𝑏𝑎, 𝑏𝑏, 𝑏𝑎𝑎, 𝑏𝑎𝑏, 𝑎𝑏𝑎}


Determine whether each string belongs to 𝑆 ∗ .

Recall:

• 𝑆 ∗ is the set of all strings obtained by concatenating zero or more words
from 𝑆.
• Therefore, if the given string can be split completely into words from 𝑆, then it
belongs to 𝑆 ∗ .



(i) baabababb

Attempt to split the string into words from 𝑆:

𝑏𝑎𝑎 𝑏𝑎𝑏 𝑎𝑏𝑏


The remaining part is

𝑎𝑏𝑏


but

𝑎𝑏𝑏 ∉ 𝑆.


Try another decomposition.

Beginning with

𝑏𝑎 ∣ 𝑎𝑏𝑎𝑏𝑎𝑏𝑏


Since

𝑏𝑎 ∈ 𝑆

,the remaining part is

𝑎𝑏𝑎𝑏𝑎𝑏𝑏


Split again:

𝑎𝑏𝑎 𝑏𝑎𝑏 𝑏


The remaining symbol is

𝑏


and

𝑏 ∉ 𝑆.


Try another possibility:

𝑏𝑎 ∣ 𝑏𝑎𝑎 ∣ 𝑏𝑎𝑏 ∣ 𝑏


Again,

𝑏 ∉ 𝑆.


There is no way to partition the whole string into members of 𝑆.

Therefore

𝑏𝑎𝑎𝑏𝑎𝑏𝑎𝑏𝑏 ∉ 𝑆 ∗



(ii) babbaab

Split as follows:

𝑏𝑎𝑏 𝑏𝑎𝑎


This gives

𝑏𝑎𝑏 + 𝑏𝑎𝑎 = 𝑏𝑎𝑏𝑏𝑎𝑎

, leaving

𝑏


which is not in 𝑆.

Try another decomposition.

Start with

𝑏𝑎


Remaining:

𝑏𝑏𝑎𝑎𝑏


Now split

𝑏𝑏 𝑎𝑎𝑏


Since

𝑎𝑎𝑏 ∉ 𝑆,


this fails.

Try

𝑏𝑎 ∣ 𝑏𝑎𝑏 ∣?


Remaining

𝑎𝑏


which is not in 𝑆.

No valid decomposition exists.

Hence

𝑏𝑎𝑏𝑏𝑎𝑎𝑏 ∉ 𝑆 ∗

Written for

Institution
Course

Document information

Uploaded on
July 10, 2026
Number of pages
34
Written in
2025/2026
Type
OTHER
Person
Unknown

Subjects

$4.69
Get access to the full document:

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

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.
iQlevel Thakhani Trading enterprise
Follow You need to be logged in order to follow users or courses
Sold
694
Member since
2 year
Number of followers
30
Documents
333
Last sold
1 day ago
Upgrade your iQ scores

All Unisa Modules assignments and exam help.

4.1

89 reviews

5
52
4
15
3
11
2
5
1
6

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