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 2 Solutions 2026

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

COS2601 Assignment 2 Solutions 2026 UNISA 0-7-9-3-2-2-6-4-2-7

Institution
Course

Content preview

COS2601 Assignment 2 Solutions 2026
UNISA
Theory of Computability — Full Worked Solutions

, QUESTION 1 [10]
(a) S = {ba, bb, baa, bab, aba}. Determine whether each string is a word in S*.
(i) baabababb
A string is a word in S* if it can be written as a concatenation of one or more elements of S. We
attempt to factorise the string using only elements of S:
baabababb = baa · ba · ba · bb
Check each factor is an element of S: baa ∈ S ✓, ba ∈ S ✓, ba ∈ S ✓, bb ∈ S ✓.
Verifying the concatenation reproduces the original string:
baa + ba + ba + bb = baabababb ✓
Conclusion: baabababb IS a word in S*, since it equals baa·ba·ba·bb, a concatenation of elements
of S.
(ii) babbaab
We attempt every possible factorisation of babbaab using elements of S = {ba, bb, baa, bab, aba}.
The string begins 'ba...', so the first factor can only be ba, baa or bab (the only elements of S starting
with 'ba'):
• First factor bab (positions 1–3) → remainder = baab. This remainder must itself factor into S*. Its
own first factor can only be ba or baa (bab does not match, since position 6 is 'a' not 'b'). ba (pos 4–5)
leaves remainder 'ab', which is not in S. baa (pos 4–6) leaves remainder 'b', which is not in S (single
letters are never elements of S). Dead end.
• First factor baa (positions 1–3) is impossible, since position 3 of the string is 'b', not 'a' — baa
requires the 3rd symbol to be 'a'.
• First factor ba (positions 1–2) → remainder = bbaab. Its first factor can only be bb (the only element
of S beginning 'bb'; ba/baa/bab are impossible since position 4 is 'b' not 'a'). bb (pos 3–4) leaves
remainder 'aab'. The only element of S starting with 'a' is aba, but aab ≠ aba (3rd symbol differs).
Dead end.
Every possible first factor leads to a dead end, so no factorisation of babbaab into elements of S
exists.
Conclusion: babbaab is NOT a word in S*.
(b) Example of two sets S, T on {a,b} such that S ⊄ T and S*∩T* = (S∩T)*.
Let S = {a, aa} and T = {a}.
Check S ⊄ T: aa ∈ S but aa ∉ T, so S is not a subset of T. ✓
Compute each side:
• S∩T = {a}, so (S∩T)* = a*
• S* : since S = {a, aa}, every string of a's can be built from a and aa, so S* = a*
• T* = a* (since T = {a})
• S*∩T* = a* ∩ a* = a*
Conclusion: S*∩T* = a* = (S∩T)*, while S ⊄ T, as required.
(c) S = {a, bb, bab}. List all words in S* of exactly 5 letters.
Every word of S* is a concatenation of copies of a (length 1), bb (length 2) and bab (length 3). We
need all combinations of these lengths that sum to 5, and for each combination, every ordering of the
pieces:
Case 1+1+1+1+1 (five a's):
aaaaa

Written for

Institution
Course

Document information

Uploaded on
July 10, 2026
Number of pages
10
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.
TsireT Teachme2-tutor
Follow You need to be logged in order to follow users or courses
Sold
62
Member since
1 year
Number of followers
1
Documents
50
Last sold
1 month ago
intell

4.8

9 reviews

5
7
4
2
3
0
2
0
1
0

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