Uploaded by josephng.298

example1 (1)

advertisement
HOMEWORK LECTURE 01
TRUNG TIN NGUYEN
January 24th, 2024
1
Show work
1.
a.
Converse: If I stay home, it will snow tonight.
Contrapositive: If I do not stay home, it will not snow tonight.
Inverse: If it does not snow tonight, then I will not stay home.
b.
Converse: If I sleep until noon, then I will stay up late.
Contrapositive: If I do not sleep until noon, then I will not stay up late.
Inverse: If I do not stay up late, I will not sleep until noon.
2.
a. To increment x by 1, the hypothesis must be true. x = 1 ⇒ 2×1+3 = 5(true)
and 3 × 1 + 4 = 7(true); therefore, the hypothesis is true, then x = 2 after the
statement is encountered.
b. x = 1 ⇒ 1 + 1 = 2(true) XOR 1 + 2 = 3(true), which make the exclusive
or of the opposition False. Therefore, the hypothesis is false, so the conditional
statement is True, and x = 2 after the statement is encountered.
c. x = 1 ⇒ x < 2(true); therefore, x = 2.
3.
a. 01011 ∨ 11011 = 11011 ⇒ 11000 ∧ 11011 = 11000
b. 01010 ⊕ 11011 = 10001 ⇒ 10001 ⊕ 01000 = 11001
4.
You can see the movie if and only if You are over 18 years old or You have
the permission of a parent.
⇒ m ↔ (e ∨ p)
5.
Start from the left gate, which is the inverter gate: the middle p becomes ¬p,
1
and then ¬p ∧ q, then (¬p ∧ q) ∨ p. The output is whatever is out from the last
inverter gate, which is the truth value of ¬[(¬p ∧ q) ∨ p].
p
T
T
F
F
q
T
F
T
F
¬p
F
F
T
T
¬p ∧ q
F
F
T
F
(¬p ∧ q) ∨ p
T
T
T
F
¬[(¬p ∧ q) ∨ p]
F
F
F
T
6. Let set P as ”A is the knight”, Q as ”B is the knight”, and R as ”C is
the knight”.
A’s statement is ”A is the knight”, which is translated to P.
B’s statement is ”A is not the knave”, which is translated to P ∨(A is the spy).
In this case, (A is the spy) is always False, so the statement is P ∨ F.
C’s statement is ”B is not the knave”, which is translated to Q ∨(B is the spy).
In this case, (B is the spy) is always False, so the statement is Q ∨ F. Below is
the truth table for the cases.
P
T
T
T
T
F
F
F
F
Q
T
T
F
F
T
T
F
F
R
T
F
T
F
T
F
T
F
P ∨F
T
T
T
T
F
F
F
F
P
T
T
T
T
F
F
F
F
Q∨F
T
T
F
F
T
T
F
F
Explanation:
• For the case of A
- If A is the knight, and A’s statement has a True value, then A is possibly the
knight.
- If A is not the knight and A’s statement has a False value, A could be the
knave or the spy.
• For the case of B
- If B is the knight, and B tells the truth, then B is possibly the knight. However,
if B’s statement has a False value, then it is impossible for the knight to say a
false statement.
- If B is not the knight, there are two cases. B’s statement has a True value, B
is possibly the spy. B’s statement has a False value, B could be the knave or
the spy.
• Similarly, I determined the possibilities for the case of C.
Given that one of the three is the knight, one is the knave, and one is the
spy. So it is impossible to have three knights for the first case and to have two
roles (knave and spy) for all three people in the last case.
Therefore, there is only one possible case, that tells us C could be the knave
or the spy, but the knight is A and the spy is B, so C is the knave.
2
P
T
T
T
T
F
F
F
F
Q
T
T
F
F
T
T
F
F
R
T
F
T
F
T
F
T
F
P
T-knight
T-knight
T-knight
T-knight
F-knave or spy
F-knave or spy
F-knave or spy
F-knave pr spy
P ∨F
T-knight
T-knight
T-spy
T-spy
F-impossible
F-impossible
F-knave or spy
F-knave or spy
3
Q∨F
T-knight
T-spy
F-impossible
F-knave or spy
T-knight
T-spy
F-impossible
F-knave or spy
status
impossible
impossible
impossible
possible
impossible
impossible
impossible
impossible
Download