AnswerAssignment1-Prop Logic
AnswerAssignment1-Prop Logic
Back in 2010, there were three types of new smartphones, namely smartphone A, B, and C.
Smartphone A has 256 MB RAM and 32 GB ROM, and the resolution of its camera is 8 MP.
Smartphone B has 288 MB RAM and 64 GB ROM, and the resolution of its camera is 4 MP.
Smartphone C has 128 MB RAM and 32 GB ROM, and the resolution of its camera is 5 MP.
Determine the truth value of each of these propositions and justify your answers! Provide clear and
relevant arguments!
a) Smartphone B has the most RAM of these three smartphones.
Jawaban
True, karena smartphone B memiliki 288 MB RAM sedangkan smartphone A memiliki
256 MB RAM, dan smartphone C 128 MB RAM
Jawaban
Smartphone C has more ROM than smartphone B = False
Smartphone C has higher resolution camera than smartphone B = True
False True bernilai True, sehingga preposisi bernilai True
c) Smartphone B has more RAM, more ROM, and higher resolution than smartphone A.
Jawaban
Smartphone B has more RAM, more ROM than smartphone A = True
Smartphone B has higher resolution than smartphone A = False
True False bernilai false, maka preposisi ini bernilai salah/false
d) If smartphone C has more RAM or more ROM than smartphone B, then it also has a higher
resolution camera.
Jawaban
Smartphone C has more RAM or more ROM than smartphone B = False
Smartphone C has higher resolution camera than smartphone B = True
False True bernilai true, maka preposisi ini bernilai benar/true
e) Smartphone A has more RAM than smartphone B if and only if smartphone B has more RAM
than smartphone C.
Jawaban
Smartphone A has more RAM than smartphone B = False
Smartphone B has more RAM than smartphone C = True
False True bernilai false, maka preposisi ini bernilai salah/false
Problem 2
Determine the value of z (the output) of the following programs in Python and justify your answer!
a) Program 1
Jawaban
akan menampilkan nilai z ke layar, nilai z = x – y = -3 (masuk else)
b) Program 2
Jawaban
akan menampilkan nilai z ke layar, nilai z = x * y = -2 (masuk if)
c) Program 3
Jawaban
akan menampilkan nilai z ke layar, nilai z = x * y = -2 (masuk else)
d) Program 4
Jawaban
akan menampilkan nilai z ke layar, nilai z = 2 * x * y = -4 (masuk else)
Problem 3
Express these system specifications using the logical connectives and the following atomic
propositions:
p : “the user enters a valid password”
q : “access is granted”
r : “the user has paid the subscription fee”.
a) “The user enters a valid password, but access is not granted.”
Jawaban
p q
b) “The user has paid the subscription fee, but does not enter a valid password”
Jawaban
i p
c) “Access is denied (not granted) if the user has not paid the subscription fee”
Jawaban
p q
d) “Access is granted whenever the user has paid the subscription fee and enters a valid
password”
Jawaban
prq
e) “If the user has not entered a valid password but has paid the subscription fee, then access is
granted”
Jawaban
p r q
Problem 4
For each of the following propositional formulas, construct its corresponding truth table and
determine whether the formula is (1) valid, (2) satisfiable, (3) contradictory/unsatisfiable, and (4) a
contingency. Provide relevant arguments for your answer.
a) (p ^ q) p q
Jawaban
p q (p ^ q) p q p q (p ^ q) p q
0 0 1 1 1 0 0
0 1 1 1 0 1 1
1 1 0 0 0 0 1
1 0 1 0 1 1 1
Karena terdapat suatu interpretasi yang mengakibatkan formula bernilai salah, maka
formula tidak bersifat absah/valid.
Karena formula bersifat terpenuhi/satisfiable maka formula tidak bersifat kontradiksi.
Karena formula adalah formula yang tidak absah dan bukan kontradiksi, maka formula
merupakan contingency.
b) (p q) (p q) (p q)
Jawaban
Problem 5
Jawab
p (q r) p q
(p (q r)) (p q)
p q r p (q r) pq (p (q r)) (p q)
0 0 0 1 1 1
0 0 1 1 1 1
0 1 0 1 1 1
0 1 1 1 1 1
1 0 0 0 0 1
1 0 1 0 0 1
1 1 0 0 1 1
1 1 1 1 1 1
Jawab
p (q r) p q
(p (q r)) (p q)
p q r p (q r) pq (p (q r)) (p q)
0 0 0 1 1 1
0 0 1 1 1 1
0 1 0 1 1 1
0 1 1 1 1 1
1 0 0 0 0 1
1 0 1 1 0 0
1 1 0 1 1 1
1 1 1 1 1 1
Problem 6
Jawab
(p q) (p r) p (q r)
Misal f(p, q, r) = (p q) (p r) p (q r)
Jawab
Misal f(p, q, r) = (p q) r p (q r)
p q r (p q) r p (q r) f(p, q, r)
0 0 0 0 1 1
0 0 1 1 1 1
0 1 0 0 0 1
0 1 1 1 1 1
1 0 0 1 1 1
1 0 1 1 1 1
1 1 0 0 0 0
1 1 1 1 1 1
Problem 7
Determine whether the following system specifications are consistent or not.
If the file system is not locked, then new messages will be queued.
If the file system is not locked, then the system is functioning normally, and conversely.
If new messages are not queued, then they will be sent to the message buffer.
If the file system is not locked, then new messages will be sent to the message buffer.
New messages will not be sent to the message buffer.
Use the following atomic propositions p, q, r, and s:
Problem 8
Determine whether the following system specifications are consistent or not.
The diagnostic message is stored in the buffer or it is retransmitted.
The diagnostic message is not stored in the buffer.
If the diagnostic message is stored in the buffer, then it is retransmitted.
The diagnostic message is not retransmitted.
For each of these sets of premises, what correct and relevant conclusion can be drawn? Explain the
rules of inference used to obtain each conclusion from the premises. Please explain your answer
clearly.
Jawab
ps
sw
w
Akan diperiksa apakah dari premis-premis di atas dapat diperoleh kesimpulan p (I did not
play hockey) melalui aturan-aturan inferensi yang absah (valid).
1. p s (premis)
2. s w (premis)
3. w (premis)
4. p w (Silogisme Hipotetik dari 1 dan 2)
5. p (modus tollens dari 3 dan 4)
b) “If Andrea is both bright and diligent, she always gets an A.”
“If Andrea always gets an A, then her GPA is 4.00.”
“Andrea is bright, but her GPA is not 4.00.”
Use the following atomic propositions: b := “Andrea is bright”, d := “Andrea is diligent”,
a := “Andrea always gets an A”, g := “Andrea’s GPA is 4.00”.
Choose one of the following conclusions:
(i) Andrea is diligent
(ii) Andrea is not diligent
Jawab
bda
ag
b g
Akan diperiksa apakah dari premis-premis di atas dapat diperoleh kesimpulan d (Andrea is
diligent) melalui aturan-aturan inferensi yang absah (valid).
1. b d a (premis)
2. a g (premis)
3. b g (premis)
4. b d g (Silogisme Hipotetik dari 1 dan 2)
5. g (Simplifikasi dari 3)
6. b d (modus tollens dari 4 dan 5)
7. d (Simplifikasi dari 6)
For each of these sets of premises, what correct and relevant conclusion can be drawn? Explain the
rules of inference used to obtain each conclusion from the premises. Please explain your answer
clearly.
Jawab
gm
mcp
c p
Akan diperiksa apakah dari premis-premis di atas dapat diperoleh kesimpulan g (the
government is not malevolent) melalui aturan-aturan inferensi yang absah (valid).
1. g m (premis)
2. m c p (premis)
3. c p (premis)
4. g c p (Silogisme Hipotetik dari 1 dan 2)
5. c (Simplifikasi dari 3)
6. g c (Simplifikasi dari 4)
7. g (modus tollens dari 5 dan 6)
Use the following atomic propositions: p := “Maria was drowsy”, q := “Maria was drunk”,
r :=
“Maria’s breath contained alcohol”, s := “Maria’s heartbeat was low”, t := “Maria’s driving
license
is temporarily revoked”, and u := “Maria’s driving license is permanently revoked”.
Choose one of the following conclusions:
(i) Maria’s driving license will be temporarily revoked
(ii) Maria’s driving license will be permanently revoked
Jawab
pq
ps
qr
pt
qu
r
Akan diperiksa apakah dari premis-premis di atas dapat diperoleh kesimpulan u (Maria’s
driving license will be permanently revoked) melalui aturan-aturan inferensi yang absah
(valid).
1. p q (premis)
2. p s (premis)
3. q r (premis)
4. p t (premis)
5. q u (premis)
6. r (premis)
7. q (Modus tollens 3 dan 6)
8. p (Disjunctive syllogism 1 dan 7)
9. p q (ekuivalen dari 1)
10. p u (Hypothetical syllogism 5 dan 9)
11. p u (ekuivalenlis dari 10)
12. q (r u) (Conjunction dari 3 dan 5)
13. q (r u) (conditional dari 12)
14. p (s t) (Conjunction dari 2 dan 4)
15. p (s t) (conditional dari 14)
16. (s t) u (Resolution 11 dan 15)
17. (s t) u (conditional dari 16)
18. (s t) (modus tollens dari 8 dan 14)