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

COS1501 Assignment 3 2021

Rating
4.0
(3)
Sold
8
Pages
34
Uploaded on
27-06-2021
Written in
2021/2022

UNISA COS1501 Theoretical Computer Science Assignment THREE of 2021 solutions. Definitions are given then it is shown how they relate with the particular question.

Institution
Course

Content preview

COS1501 Assignment 3 2021



Question 1



𝑈 = {1, 2, 3, 4, 5, 𝑎, 𝑏, 𝑐} 𝑎𝑛𝑑 𝐴 = {𝑎, 𝑏, 𝑐, 1, 2, 3, 4}



𝑅: 𝐴 → 𝐴
𝐴 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛𝑎𝑙 𝑖𝑓 𝑒𝑣𝑒𝑟𝑦 𝑒𝑙𝑒𝑚𝑒𝑛𝑡 𝑖𝑛 𝑡ℎ𝑒 𝑑𝑜𝑚𝑎𝑖𝑛 𝑖𝑠 𝑟𝑒𝑙𝑎𝑡𝑒𝑑 𝑡𝑜 𝑒𝑥𝑎𝑐𝑡𝑙𝑦 𝑜𝑛𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡 𝑖𝑛 𝑡ℎ𝑒
𝑐𝑜𝑑𝑜𝑚𝑎𝑖𝑛.



1. {(1, 3), (𝑏, 3), (1,4), (𝑏, 2), (𝑐, 2)}

1 𝑖𝑠 𝑟𝑒𝑙𝑎𝑡𝑒𝑑 𝑡𝑜 3 𝑎𝑛𝑑 1 𝑖𝑠 𝑎𝑙𝑠𝑜 𝑟𝑒𝑙𝑎𝑡𝑒𝑑 𝑡𝑜 4.
1 𝑖𝑠 𝑟𝑒𝑙𝑎𝑡𝑒𝑑 𝑡𝑜 𝑚𝑜𝑟𝑒 𝑡ℎ𝑎𝑡 𝑜𝑛𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡.
𝑇ℎ𝑒 𝑎𝑏𝑜𝑣𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑛𝑜𝑡 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛𝑎𝑙.

2. {(𝑎, 𝑐), (𝑏, 𝑐), (𝑐, 𝑏), (1, 3), (2, 3), (3, 𝑎)}

𝑎, 𝑏, 𝑐, 1, 2 𝑎𝑛𝑑 3 𝑎𝑟𝑒 𝑒𝑎𝑐ℎ 𝑟𝑒𝑙𝑎𝑡𝑒𝑑 𝑡𝑜 𝑒𝑥𝑎𝑐𝑡𝑙𝑦 𝑜𝑛𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡.
𝑇ℎ𝑒 𝑎𝑏𝑜𝑣𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛𝑎𝑙.

3. {(𝑎, 𝑎), (𝑐, 𝑐), (2, 2), (3, 3), (4, 4)}

𝑎, 𝑐, 2, 3 𝑎𝑛𝑑 4 𝑎𝑟𝑒 𝑒𝑎𝑐ℎ 𝑟𝑒𝑙𝑎𝑡𝑒𝑑 𝑡𝑜 𝑒𝑥𝑎𝑐𝑡𝑙𝑦 𝑜𝑛𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡.
𝑇ℎ𝑒 𝑎𝑏𝑜𝑣𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛𝑎𝑙.

4. {(𝑎, 𝑐), (𝑏, 𝑐), (1, 3), (3, 3)}

𝑎, 𝑏, 1 𝑎𝑛𝑑 3 𝑎𝑟𝑒 𝑒𝑎𝑐ℎ 𝑟𝑒𝑙𝑎𝑡𝑒𝑑 𝑡𝑜 𝑒𝑥𝑎𝑐𝑡𝑙𝑦 𝑜𝑛𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡.
𝑇ℎ𝑒 𝑎𝑏𝑜𝑣𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛𝑎𝑙.



Question 1 ONE

,Question 2



𝑈 = {1, 2, 3, 4, 5, 𝑎, 𝑏, 𝑐} 𝑎𝑛𝑑 𝐴 = {𝑎, 𝑏, 𝑐, 1, 2, 3, 4}



𝑅: 𝑈 → 𝐴 𝑈 𝑖𝑠 𝑡ℎ𝑒 𝑑𝑜𝑚𝑎𝑖𝑛 𝑎𝑛𝑑 𝐴 𝑖𝑠 𝑡ℎ𝑒 𝑐𝑜𝑑𝑜𝑚𝑎𝑖𝑛.
𝑇ℎ𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑜𝑓 𝑈 𝑎𝑟𝑒 𝑐𝑎𝑙𝑙𝑒𝑑 𝑡ℎ𝑒 𝑝𝑟𝑒 − 𝑖𝑚𝑎𝑔𝑒𝑠 𝑎𝑛𝑑 𝑡ℎ𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝐴 𝑎𝑟𝑒 𝑐𝑎𝑙𝑙𝑒𝑑 𝑖𝑚𝑎𝑔𝑒𝑠.



𝐴 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑎 𝑠𝑢𝑟𝑗𝑒𝑐𝑡𝑖𝑣𝑒 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝑖𝑓 𝑖𝑡 𝑖𝑠 𝑎 𝒇𝒖𝒏𝒄𝒕𝒊𝒐𝒏 𝑎𝑛𝑑 𝒇𝒐𝒓 𝒆𝒗𝒆𝒓𝒚 𝒆𝒍𝒆𝒎𝒆𝒏𝒕 𝒊𝒏 𝒕𝒉𝒆 𝒄𝒐𝒅𝒐𝒎𝒂𝒊𝒏, 𝒕𝒉𝒆𝒓𝒆
𝒊𝒔 𝒂𝒏 𝒆𝒍𝒆𝒎𝒆𝒏𝒕 𝒊𝒏 𝒕𝒉𝒆 𝒅𝒐𝒎𝒂𝒊𝒏 𝒕𝒉𝒂𝒕 𝒊𝒔 𝒓𝒆𝒍𝒂𝒕𝒆𝒅 𝒕𝒐 𝒊𝒕.
𝑇ℎ𝑎𝑡 𝑖𝑠, 𝑓𝑜𝑟 𝑒𝑣𝑒𝑟𝑦 𝑦 ∈ 𝐴, 𝑡ℎ𝑒𝑟𝑒 𝑒𝑥𝑖𝑠𝑡𝑠 𝑥 ∈ 𝑈 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 (𝑥, 𝑦) ∈ 𝑅.
𝐸𝑣𝑒𝑟𝑦 𝑒𝑙𝑒𝑚𝑒𝑛𝑡 𝑖𝑛 𝐴 𝑚𝑢𝑠𝑡 ℎ𝑎𝑣𝑒 𝑎 𝑝𝑟𝑒 − 𝑖𝑚𝑎𝑔𝑒 𝑓𝑜𝑢𝑛𝑑 𝑖𝑛 𝑈.



1. {(1, 4), (2, 𝑏), (3, 3), (4, 3), (5, 𝑎), (𝑎, 𝑐), (𝑏, 1), (𝑐, 𝑏)}

𝐴𝑙𝑙 𝑡ℎ𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑜𝑓 𝑈, 𝑡ℎ𝑎𝑡 𝑖𝑠, 1, 2, 3, 4, 5, 𝑎, 𝑏 𝑎𝑛𝑑 𝑐 𝑎𝑟𝑒 𝑒𝑎𝑐ℎ 𝑟𝑒𝑙𝑎𝑡𝑒𝑑 𝑡𝑜 𝑒𝑥𝑎𝑐𝑡𝑙𝑦 𝑜𝑛𝑒
𝑒𝑙𝑒𝑚𝑒𝑛𝑡 𝑖𝑛 𝐴. 𝑆𝑜, 𝑡ℎ𝑒 𝑎𝑏𝑜𝑣𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑎 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛.

𝐴𝑙𝑠𝑜,
2 ∈ 𝐴 𝑏𝑢𝑡 𝑡ℎ𝑒𝑟𝑒 𝑖𝑠 𝑛𝑜 (? , 2) 𝑝𝑎𝑖𝑟
2 ℎ𝑎𝑠 𝑛𝑜 𝑝𝑟𝑒 − 𝑖𝑚𝑎𝑔𝑒.
𝑇ℎ𝑒 𝑎𝑏𝑜𝑣𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑁𝑂𝑇 𝑎 𝑠𝑢𝑟𝑗𝑒𝑐𝑡𝑖𝑣𝑒 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛.

2. {(𝑎, 1), (𝑏, 2), (𝑐, 𝑎), (1, 4), (2, 𝑏), (3, 3), (4, 𝑐)}

𝑇ℎ𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡 5 𝑖𝑠 𝑖𝑛 𝑈, ℎ𝑜𝑤𝑒𝑣𝑒𝑟, 5 𝑖𝑠 𝑛𝑜𝑡 𝑟𝑒𝑙𝑎𝑡𝑒𝑑 𝑡𝑜 𝑎𝑛𝑦 𝑒𝑙𝑒𝑚𝑒𝑛𝑡 𝑖𝑛 𝐴.
𝑇ℎ𝑒 𝑎𝑏𝑜𝑣𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑛𝑜𝑡 𝑎 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛.

𝑇ℎ𝑒 𝑎𝑏𝑜𝑣𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑁𝑂𝑇 𝑎 𝑠𝑢𝑟𝑗𝑒𝑐𝑡𝑖𝑣𝑒 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛.

3. {(1, 𝑎), (2, 𝑐), (3, 𝑏), (4, 1), (𝑎, 𝑐), (𝑏, 2), (𝑐, 3)}

𝑇ℎ𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡 5 𝑖𝑠 𝑖𝑛 𝑈, ℎ𝑜𝑤𝑒𝑣𝑒𝑟, 5 𝑖𝑠 𝑛𝑜𝑡 𝑟𝑒𝑙𝑎𝑡𝑒𝑑 𝑡𝑜 𝑎𝑛𝑦 𝑒𝑙𝑒𝑚𝑒𝑛𝑡 𝑖𝑛 𝐴.
𝑇ℎ𝑒 𝑎𝑏𝑜𝑣𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑛𝑜𝑡 𝑎 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛.

𝑇ℎ𝑒 𝑎𝑏𝑜𝑣𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑁𝑂𝑇 𝑎 𝑠𝑢𝑟𝑗𝑒𝑐𝑡𝑖𝑣𝑒 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛.

4. {(1, 𝑎), (2, 𝑏), (3, 4), (4, 3), (5, 𝑐), (𝑎, 𝑎), (𝑏, 1), (𝑐, 2)}

𝐴𝑙𝑙 𝑡ℎ𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑜𝑓 𝑈, 𝑡ℎ𝑎𝑡 𝑖𝑠, 1, 2, 3, 4, 5, 𝑎, 𝑏 𝑎𝑛𝑑 𝑐 𝑎𝑟𝑒 𝑒𝑎𝑐ℎ 𝑟𝑒𝑙𝑎𝑡𝑒𝑑 𝑡𝑜 𝑒𝑥𝑎𝑐𝑡𝑙𝑦 𝑜𝑛𝑒
𝑒𝑙𝑒𝑚𝑒𝑛𝑡 𝑖𝑛 𝐴. 𝑆𝑜, 𝑡ℎ𝑒 𝑎𝑏𝑜𝑣𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑎 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛.

𝐴𝑙𝑙 𝑡ℎ𝑒 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑜𝑓 𝐴, 𝑡ℎ𝑎𝑡 𝑖𝑠, 1, 2, 3, 4, 𝑎, 𝑏 𝑎𝑛𝑑 𝑐 ℎ𝑎𝑣𝑒 𝑝𝑟𝑒 − 𝑖𝑚𝑎𝑔𝑒𝑠 𝑖𝑛 𝑈.

𝑇ℎ𝑒 𝑎𝑏𝑜𝑣𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑎 𝑠𝑢𝑟𝑗𝑒𝑐𝑡𝑖𝑣𝑒 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛.


Question 2 FOUR

, Question 3



𝐴 = {1, 2, 3, 4}
𝐺: 𝐴 → 𝐴 𝑎𝑛𝑑 𝐿: 𝐴 → 𝐴



𝐺 = {(1, 2), (2, 3), (4, 3)}
(1, 2) ⇒ 𝐺(1) = 2
(2, 3) ⇒ 𝐺(2) = 3
(4, 3) ⇒ 𝐺(4) = 3



𝐿 = {(2, 2), (1, 3), (3, 4)}
(2, 2) ⇒ 𝐿(2) = 2
(1, 3) ⇒ 𝐿(1) = 3
(3, 4) ⇒ 𝐿(3) = 4



𝐿(𝐺(1)) = 𝐿(2) = 2 ⇒ (1, 2) ∈ 𝐿 ∘ 𝐺

𝐿(𝐺(2)) = 𝐿(3) = 4 ⇒ (2, 4) ∈ 𝐿 ∘ 𝐺

𝐿(𝐺(3)) =? 𝐺(3) 𝑖𝑠 𝑛𝑜𝑡 𝑑𝑒𝑓𝑖𝑛𝑒𝑑. 𝑆𝑜, 𝐿(𝐺(3)) 𝑖𝑠 𝑛𝑜𝑡 𝑑𝑒𝑓𝑖𝑛𝑒𝑑.

𝐿(𝐺(4)) = 𝐿(3) = 4 ⇒ (4, 4) ∈ 𝐿 ∘ 𝐺



𝐿 ∘ 𝐺 = {(1, 2), (2, 4), (4, 4)}



Question 3 TWO

Written for

Institution
Course

Document information

Uploaded on
June 27, 2021
File latest updated on
July 1, 2021
Number of pages
34
Written in
2021/2022
Type
OTHER
Person
Unknown

Subjects

$12.55
Get access to the full document:
Purchased by 8 students

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

Reviews from verified buyers

Showing all 3 reviews
4 year ago

4 year ago

4 year ago

4.0

3 reviews

5
0
4
3
3
0
2
0
1
0
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

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.
lyzo2005 University of South Africa (Unisa)
Follow You need to be logged in order to follow users or courses
Sold
733
Member since
8 year
Number of followers
372
Documents
98
Last sold
7 months ago

4.2

145 reviews

5
73
4
45
3
20
2
3
1
4

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

Working on your references?

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

Working on your references?

Frequently asked questions