You are on page 1of 6

EECS 203: Discrete Mathematics

Fall 2015
Solutions to HW 1
September 14, 2015

Problem 1.1.14

p: You get an A on the final exam.


q: You do every exercise in this book.
r: You get an A in this class.
a) r ^ q
b) p ^ q ^ r
c) r ! p
e) (p ^ q) ! r
Note: Check the textbook for the dierence between necessary and sufficient.

Problem 1.1.28

Given that p ! q,
Converse: q ! p
Contrapositive: q ! p
Inverse: p ! q
a) Question: If it snows tonight, then I will stay at home.
Converse: If I stay at home, then it will snow tonight.
Contrapositive: If I do not stay at home, then it will not snow tonight.
Inverse: If it does not snow tonight, then I will not stay at home.

b) Question: I go to the beach whenever it is a sunny summer day.


Converse: It is a sunny summer day whenever I go to the beach.
Contrapositive: It is not a sunny summer day whenever I do not go to the beach.
Inverse: I do not go to the beach whenever it is not a sunny summer day.
c) Question: When I stay up late, it is necessary that I sleep until noon.
Converse: When I sleep until noon, it is necessary that I stay up late.
Contrapositive: When I do not sleep until noon, it is necessary that I do not stay up
late.
Inverse: When I do not stay up late, it is necessary that I do not sleep until noon.
Note: There are many other acceptable solutions as long as the logic is correct. However, we
do encourage answers in the original English form (for example, we prefer the answer It is
a sunny summer day whenever I go to the beach to the answer if I go to the beach, then
it is a sunny summer day ).

Problem 1.1.32(c,d)

Pro-tip: A truth table will need 2n rows if there are n variables (simple propositions).
So for this question, we need 22 = 4 rows.
(p _ q)
: Exclusive or.
p q is true when p and q have dierent truth values.

c) p

q
T
F
T
F

p_q
T
T
T
F

p_q
T
T
T
F

p^q
T
F
F
F

(p ^ q) ! (p _ q)
T
T
T
T

p
T
T
F
F

(p _ q)
F
F
T
F

d) (p ^ q) ! (p _ q)

p
T
T
F
F

q
T
F
T
F

Problem 1.1.36(e,f )

We have 3 simple propositions (namely p, q, r) in this question, so we need 23 = 8 rows.


e) (p _ q) ^ r
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

r
F
T
F
T
F
T
F
T

p_q
T
T
T
T
T
T
F
F

(p _ q) ^ r
F
T
F
T
F
T
F
F

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

r
F
T
F
T
F
T
F
T

p^q
T
T
F
F
F
F
F
F

(p ^ q) _ r
T
T
F
T
F
T
F
T

f) (p ^ q) _ r

Problem 1.2.12

According to the textbook, system specifications being consistent means that they should
not contain conflicting requirements that could be used to derive a contradiction. This might
sound very confusing. So, lets consider we have 3 system requirements (say X, Y, Z) that
are made up of 4 simple propositions L, Q, N, B. In order for the system specifications to be
consistent, we need to find a truth value assignment that will make X ^ Y ^ Z true.
To approach this problem, first, list down the required simple propositions:
L: The file system is locked.
Q: New messages will be queued.
3

N : The system is functioning normally.


B: New messages will be sent to the message buer.
Second, list down the specifications in terms of logic:
a) L ! Q
b) L $ N (Dont forget conversely!)
c) Q ! B
d) L ! B
e) B
Third, find a truth value assignment for L, Q, N, B that will make a ^ b ^ c ^ d ^ e true.
You can do it by constructing a truth table (though not recommended). However, we are
going to use logical reasoning to find such truth value assignment. If we want consistency,
then we had better have B false in order to make e) true. Since true cannot imply false, this
requires that both L and Q be true, as the two conditional statements, c) and d), have B as
their consequence. The first conditional statement a) therefore is of the form F ! T , which
is true. Finally, the statement b) L $ N can be satisfied by taking N to be false. Thus this
set of specifications is consistent. Note that there is just one satisfying truth assignment.

Problem 1.3.8 (a,b,c)

There are two forms of DeMorgans Law:


1. (p _ q) p ^ q
2. (p ^ q) p _ q
a) We need to use the first form for this question. So after applying DeMorgans Law, we
have
Kwame will not take a job in industry and will not go to graduate school.
b) We need to use the second form for this question. So after applying DeMorgans Law,
we have
Yoshiko does not know Java or does not know Calculus.
c) We need to use the second form for this question. So after applying DeMorgans Law,
we have
James is not young or he is not strong.

Note: Here we repeat part of the sentence in order to avoid any possible ambiguous interpretation. Take b) as an example. We have Yoshiko does not know Java or does not know
Calculus instead of Yoshiko does not know Java or Calculus, as people usually interpret
later as Yoshiko does not know either of them (Yoshiko does not know Java and does
not know Calculus). We will accept the later version in this homework, but for future
homework and exams please try to avoid answers with any ambiguous interpretation.

Problem 1.3.10 (a,c)


a) We need to construct a truth table of 4 rows.
p
T
T
F
F

q
T
F
T
F

p
F
F
T
T

p_q
T
T
T
F

p ^ (p _ q)
F
F
T
F

[p ^ (p _ q)] ! q
T
T
T
T

c) We need to construct a truth table of 4 rows.


p
T
T
F
F

q
T
F
T
F

p!q
T
F
T
T

p ^ (p ! q)
T
F
F
F

[p ^ (p ! q)] ! q
T
T
T
T

Problem 1.3.24

We present two ways to show the logical equivalence:


1. Logical reasoning
We determine exactly which rows of the truth table for (p ! q) _ (p ! r) and
p ! (q _ r) will have T as their entries. Notice that (p ! q) _ (p ! r) will be
true when either of the conditional statements is true. The conditional statements will
be true when
(a) p is false, or
(b) p is true and either q or r is true
5

The above truth assignments will also make p ! (q _ r) true and there is no other
truth assignment that can make p ! (q _ r) true. So, we can conclude that the two
propositions are true in exactly the same situations which means they are logically
equivalent.
Of course, you can approach this question by showing that both compound statements
are false for the same truth assignments. If you find this method confusing, writing
explicitly the truth table would be a helpful way to visualize our explanation.
2. Equivalence Proof
(p ! q) _ (p ! r) (p _ q) _ (p _ r)
(p _ q _ p) _ r
p _ q _ r
p _ (q _ r)
p ! (q _ r)

Use (p ! q p _ q)
Associative Law
Idempotent Law
Associative Law
Use (p ! q p _ q)

Note: The question specified in the book asks for the first way, logical reasoning, to solve
logical equivalence. We also accept the second approach (with partial credits), as it shows
good skills of using dierent laws.