Swansea University CS-170J: Modelling Computing Systems Coursework 1
VerifiedAdded on 2022/12/23
|15
|2235
|100
Homework Assignment
AI Summary
This document presents a complete solution to the CS-170J Coursework 1 assignment on Modelling Computing Systems, completed at Swansea University. The assignment covers key concepts in theoretical computer science. Question 1 focuses on rewriting statements in "If..., then..." form, testing understanding of conditional statements. Question 2 delves into propositional logic, requiring translation of English statements, truth table construction, and analysis of logical consistency. Question 3 examines set theory, including Venn diagrams and set construction using set operations. Finally, Question 4 explores predicate logic, involving translation of English statements into predicate logic, negation of statements, and translation of predicate logic statements back into English, focusing on relationships between teams in a league. The solutions demonstrate a clear understanding of the concepts and provide detailed explanations.

Modelling computer
systems
systems
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Contents
Contents...........................................................................................................................................2
Question 1- Rewrite each of the following statements in English in the form “If . . . , then . . .”...1
(a) Swansea beach is full of people whenever the weather is sunny...........................................1
(b) I can go to a more beautiful beach, if I take the bus out of the city.......................................1
(c) Swansea’s cloudy weather implies that sunny days are precious..........................................1
(d) To practice kite-surfing, it is necessary to go to a beach.......................................................1
(e) To practice swimming, it is sufficient to go to a swimming pool..........................................1
(f) When I am rich, I will buy my own private beach.................................................................2
(g) I need to work hard if I want to become rich.........................................................................2
(h) I cannot enjoy the beach unless I take time off work.............................................................2
Question 2- Red, Green and Blue are players in a social deduction game in which you have to
identify the killer among them. Let Rsus, Gsus, Bdead and RB represent the following
statements:.......................................................................................................................................3
Rsus: Red is the killer..................................................................................................................3
Gsus: Green is the killer..............................................................................................................3
Bdead: Blue is dead.....................................................................................................................3
RB: Red and Blue are alone in a room........................................................................................3
a) Translate the following statements into propositional logic:...................................................3
P1: Either Red is the killer or Green is the killer.........................................................................3
P2: If Red is the killer, then Green is no killer............................................................................3
P3: If Red and Blue are alone in a room and Blue is dead, then Red is the killer.......................3
P4: If Green is the killer, then Red and Blue would not be alone in a room...............................3
P5: Red is no killer and Blue is dead...........................................................................................3
b) Construct a truth table with variables Rsus, Gsus and the statement P1∧P2.........................4
(c) CanP1, P2, P3, P4, P5be true at the same time? Justify your answer....................................5
Question 3-.......................................................................................................................................5
Contents...........................................................................................................................................2
Question 1- Rewrite each of the following statements in English in the form “If . . . , then . . .”...1
(a) Swansea beach is full of people whenever the weather is sunny...........................................1
(b) I can go to a more beautiful beach, if I take the bus out of the city.......................................1
(c) Swansea’s cloudy weather implies that sunny days are precious..........................................1
(d) To practice kite-surfing, it is necessary to go to a beach.......................................................1
(e) To practice swimming, it is sufficient to go to a swimming pool..........................................1
(f) When I am rich, I will buy my own private beach.................................................................2
(g) I need to work hard if I want to become rich.........................................................................2
(h) I cannot enjoy the beach unless I take time off work.............................................................2
Question 2- Red, Green and Blue are players in a social deduction game in which you have to
identify the killer among them. Let Rsus, Gsus, Bdead and RB represent the following
statements:.......................................................................................................................................3
Rsus: Red is the killer..................................................................................................................3
Gsus: Green is the killer..............................................................................................................3
Bdead: Blue is dead.....................................................................................................................3
RB: Red and Blue are alone in a room........................................................................................3
a) Translate the following statements into propositional logic:...................................................3
P1: Either Red is the killer or Green is the killer.........................................................................3
P2: If Red is the killer, then Green is no killer............................................................................3
P3: If Red and Blue are alone in a room and Blue is dead, then Red is the killer.......................3
P4: If Green is the killer, then Red and Blue would not be alone in a room...............................3
P5: Red is no killer and Blue is dead...........................................................................................3
b) Construct a truth table with variables Rsus, Gsus and the statement P1∧P2.........................4
(c) CanP1, P2, P3, P4, P5be true at the same time? Justify your answer....................................5
Question 3-.......................................................................................................................................5

(a) Let A, B, C be sets in a universe of discourse U. Draw Venn diagrams illustrating the
following sets:..................................................................................................................................5
i. (A\B)∪(B\(A∪C))....................................................................................................................5
ii. A\((B∪C)\(B∩C))...................................................................................................................6
iii. (A∪B∪C)∪(A∪B∪C)..........................................................................................................7
(b) Let..........................................................................................................................................9
A= {1,2,3,4,5},............................................................................................................................9
B= {4,5,6,7,8},.............................................................................................................................9
C= {1,3,4,5,7} and.......................................................................................................................9
U={1,2,3,4,5,6,7,8}.....................................................................................................................9
Use A, B, C and the operations ∪,∩,,(·) to construct the set {1,3,7}..........................................9
Question 4- Let T be a set of teams playing in a league. Three of the teams are Team Liquid, Evil
Geniuses and Mouses ports. The league is still ongoing, so not every team has finished their
matches yet. Let P(a, b) mean “a played against b” and W(a, b) mean “a won against b”...........10
(a) Translate the following English statements into predicate logic..........................................10
i. Team Liquid has played against every team..........................................................................10
ii. Evil Geniuses has won against every team it has played against..........................................10
iii. Mouses ports played and won against every team except Evil Geniuses............................10
iv. There is a team which has played no team yet.....................................................................11
v. A team cannot win against teams they haven’t played against yet........................................11
(b) Negate all statements in English..........................................................................................11
i. Team Liquid has played against every team..........................................................................11
ii. Evil Geniuses has won against every team it has played against..........................................11
iii. Mouses ports played and won against every team except Evil Geniuses............................11
iv. There is a team which has played no team yet.....................................................................12
v. A team cannot win against teams they haven’t played against yet........................................12
(c) Translate the following statement into English:...................................................................12
following sets:..................................................................................................................................5
i. (A\B)∪(B\(A∪C))....................................................................................................................5
ii. A\((B∪C)\(B∩C))...................................................................................................................6
iii. (A∪B∪C)∪(A∪B∪C)..........................................................................................................7
(b) Let..........................................................................................................................................9
A= {1,2,3,4,5},............................................................................................................................9
B= {4,5,6,7,8},.............................................................................................................................9
C= {1,3,4,5,7} and.......................................................................................................................9
U={1,2,3,4,5,6,7,8}.....................................................................................................................9
Use A, B, C and the operations ∪,∩,,(·) to construct the set {1,3,7}..........................................9
Question 4- Let T be a set of teams playing in a league. Three of the teams are Team Liquid, Evil
Geniuses and Mouses ports. The league is still ongoing, so not every team has finished their
matches yet. Let P(a, b) mean “a played against b” and W(a, b) mean “a won against b”...........10
(a) Translate the following English statements into predicate logic..........................................10
i. Team Liquid has played against every team..........................................................................10
ii. Evil Geniuses has won against every team it has played against..........................................10
iii. Mouses ports played and won against every team except Evil Geniuses............................10
iv. There is a team which has played no team yet.....................................................................11
v. A team cannot win against teams they haven’t played against yet........................................11
(b) Negate all statements in English..........................................................................................11
i. Team Liquid has played against every team..........................................................................11
ii. Evil Geniuses has won against every team it has played against..........................................11
iii. Mouses ports played and won against every team except Evil Geniuses............................11
iv. There is a team which has played no team yet.....................................................................12
v. A team cannot win against teams they haven’t played against yet........................................12
(c) Translate the following statement into English:...................................................................12
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Question 1- Rewrite each of the following statements in
English in the form “If . . . , then . . .”
(a) Swansea beach is full of people whenever the weather is sunny.
Solution: If the weather is sunny then Swansea beach will be full of
people.
(b) I can go to a more beautiful beach, if I take the bus out of the city.
Solution: If I will take the bus out of the city then I can surely go to a
more beautiful beach.
(c) Swansea’s cloudy weather implies that sunny days are precious.
Solution: If the weather near Swansea is cloudy then it implies that the
sunny days are precious.
(d) To practice kite-surfing, it is necessary to go to a beach.
Solution: If one wants to practise kite-surfing then it is necessary to go
to a beach.
(e) To practice swimming, it is sufficient to go to a swimming pool.
Solution: If someone wants to practice summing then it is sufficient to
go to a swimming pool.
English in the form “If . . . , then . . .”
(a) Swansea beach is full of people whenever the weather is sunny.
Solution: If the weather is sunny then Swansea beach will be full of
people.
(b) I can go to a more beautiful beach, if I take the bus out of the city.
Solution: If I will take the bus out of the city then I can surely go to a
more beautiful beach.
(c) Swansea’s cloudy weather implies that sunny days are precious.
Solution: If the weather near Swansea is cloudy then it implies that the
sunny days are precious.
(d) To practice kite-surfing, it is necessary to go to a beach.
Solution: If one wants to practise kite-surfing then it is necessary to go
to a beach.
(e) To practice swimming, it is sufficient to go to a swimming pool.
Solution: If someone wants to practice summing then it is sufficient to
go to a swimming pool.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

(f) When I am rich, I will buy my own private beach.
Solution: If I will become rich then I will buy my own private beach.
(g) I need to work hard if I want to become rich.
Solution: If I want to become rich then I need to work hard.
(h) I cannot enjoy the beach unless I take time off work.
Solution: If I want to enjoy on the beach then I have to take time off
from work.
Solution: If I will become rich then I will buy my own private beach.
(g) I need to work hard if I want to become rich.
Solution: If I want to become rich then I need to work hard.
(h) I cannot enjoy the beach unless I take time off work.
Solution: If I want to enjoy on the beach then I have to take time off
from work.

Question 2- Red, Green and Blue are players in a social
deduction game in which you have to identify the killer
among them. Let Rsus, Gsus, Bdead and RB represent the
following statements:
Rsus: Red is the killer
Gsus: Green is the killer
Bdead: Blue is dead
RB: Red and Blue are alone in a room
a) Translate the following statements into propositional logic:
P1: Either Red is the killer or Green is the killer.
P2: If Red is the killer, then Green is no killer.
P3: If Red and Blue are alone in a room and Blue is dead, then Red is
the killer.
P4: If Green is the killer, then Red and Blue would not be alone in a
room.
P5: Red is no killer and Blue is dead.
Solution: P1: The statement says that the killer is either red or green
P2: The statement says that if red is the killer then green would not be
the killer.
P3: This statement says that if both red and blue are in a same room and
blue is found dead then red is the killer.
deduction game in which you have to identify the killer
among them. Let Rsus, Gsus, Bdead and RB represent the
following statements:
Rsus: Red is the killer
Gsus: Green is the killer
Bdead: Blue is dead
RB: Red and Blue are alone in a room
a) Translate the following statements into propositional logic:
P1: Either Red is the killer or Green is the killer.
P2: If Red is the killer, then Green is no killer.
P3: If Red and Blue are alone in a room and Blue is dead, then Red is
the killer.
P4: If Green is the killer, then Red and Blue would not be alone in a
room.
P5: Red is no killer and Blue is dead.
Solution: P1: The statement says that the killer is either red or green
P2: The statement says that if red is the killer then green would not be
the killer.
P3: This statement says that if both red and blue are in a same room and
blue is found dead then red is the killer.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

P4: This statement says that if green is the killer then both red and blue
would not be alone in a room.
P5: This statement finally concludes that blue is found dead but red is
not the killer.
b) Construct a truth table with variables Rsus, Gsus and the statement
P1∧P2.
Solution: Truth table with variable Rsus
P1 P2 P1∧P2
True True True
False False False
True False True
False True True
Truth table with variable Gsus
P1 P2 P1∧P2
True True True
False False False
True False True
False True False
would not be alone in a room.
P5: This statement finally concludes that blue is found dead but red is
not the killer.
b) Construct a truth table with variables Rsus, Gsus and the statement
P1∧P2.
Solution: Truth table with variable Rsus
P1 P2 P1∧P2
True True True
False False False
True False True
False True True
Truth table with variable Gsus
P1 P2 P1∧P2
True True True
False False False
True False True
False True False
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

(c) CanP1, P2, P3, P4, P5be true at the same time? Justify your answer.
Solution: No all the P’s cannot be same because the first P is saying that
either red or green is the killer, while the second one is saying that if red
is not the killer then green is definitely the killer. Whereas P3 says that if
red and blue are in a single and blue is dead then red is definitely the
killer, and fourth P says that if green is the killer then both red and blue
are not in the same room. The fifth P says that blue is dead but red is not
the killer. So from the above it can be seen that P1, P2, P4, and P5 are
correct or partially correct but P3 is wrong so it is not possible that all
the P’s are correct at the same time.
Question 3-
(a) Let A, B, C be sets in a universe of discourse U. Draw
Venn diagrams illustrating the following sets:
i. (A\B)∪(B\(A∪C))
Solution:
Solution: No all the P’s cannot be same because the first P is saying that
either red or green is the killer, while the second one is saying that if red
is not the killer then green is definitely the killer. Whereas P3 says that if
red and blue are in a single and blue is dead then red is definitely the
killer, and fourth P says that if green is the killer then both red and blue
are not in the same room. The fifth P says that blue is dead but red is not
the killer. So from the above it can be seen that P1, P2, P4, and P5 are
correct or partially correct but P3 is wrong so it is not possible that all
the P’s are correct at the same time.
Question 3-
(a) Let A, B, C be sets in a universe of discourse U. Draw
Venn diagrams illustrating the following sets:
i. (A\B)∪(B\(A∪C))
Solution:

Green colour part is A\B
Red colour part is A∪C
Grey colour part is B\(A∪C)
And the rest is (A\B)∪(B\(A∪C))
ii. A\((B∪C)\(B∩C))
Solution:
Red colour part is A∪C
Grey colour part is B\(A∪C)
And the rest is (A\B)∪(B\(A∪C))
ii. A\((B∪C)\(B∩C))
Solution:
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Green colour part is B∪C
Orange colour part is B∩C
Grey colour part and the rest of the one is A\((B∪C)\(B∩C))
iii. (A∪B∪C)∪(A∪B∪C)
Solution:
Orange colour part is B∩C
Grey colour part and the rest of the one is A\((B∪C)\(B∩C))
iii. (A∪B∪C)∪(A∪B∪C)
Solution:
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Green colour part is A∪B∪C
Orange colour part is A∪B∪C
And the rest of the part is (A∪B∪C)∪(A∪B∪C)
Orange colour part is A∪B∪C
And the rest of the part is (A∪B∪C)∪(A∪B∪C)

(b) Let
A= {1,2,3,4,5},
B= {4,5,6,7,8},
C= {1,3,4,5,7} and
U={1,2,3,4,5,6,7,8}.
Use A, B, C and the operations ∪,∩,\,(·) to construct the set {1,3,7}.
A= {1,2,3,4,5},
B= {4,5,6,7,8},
C= {1,3,4,5,7} and
U={1,2,3,4,5,6,7,8}.
Use A, B, C and the operations ∪,∩,\,(·) to construct the set {1,3,7}.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 15
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2026 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.