CS 2050 Discrete Mathematics
8/22/2025
Homework 1: Propositional Logic
Tyler Clarke
Due:8/29/2025 11:59PM
Submissions submitted at least 24 hours prior to the due date will receive 2.5 points of
extra credit. On-time submissions receive no penalty. You may turn it in one day late for a
10-point penalty or two days late for a 25-point penalty. Assignments more than two days
late will NOT be accepted. We will prioritize on-time submissions when grading before an
exam.
You should submit a typeset or neatly written PDF on Gradescope. The grading TA
should not have to struggle to read what you’ve written; if your handwriting is hard to
decipher, you will be required to typeset your future assignments. Illegible solutions will be
given 0 credit. A 5-point penalty will occur if pages are incorrectly assigned to questions
or not properly oriented when submitting. You may collaborate with other students, but
any written work should be your own. Write the names of the students you work with on
the top of your assignment.
Note: I’m also taking ECE2020, and it covers very similar material; I’m
fairly certain I’ve only used things taught so far in CS2050, but if there’s something in here not already covered in 2050, it’s probably from there.
1. For each of the following, demonstrate the equivalence using the laws of thought.
(Note: State the law used at each step. Do not skip steps. You can only use one
equivalence or definition per step even if the same one can be be repeatedly applied
in sequence. Please put your answers in a two-column table, with the left column for
the statement and the right column which law of thought has been applied, this format
will be required whenever you show logical equivalences. It is okay to have multiple
commutativity/associativity steps as a single one but no others.)
(a) (q =⇒ p) ∧ (¬p ∨ (¬(¬p =⇒ q))) ≡ ¬(¬q =⇒ p)
(q =⇒ p) ∧ (¬p ∨ (¬(¬p =⇒ q)))
(q =⇒ p) ∧ (¬p ∨ (¬(¬¬p ∨ q)))
(q =⇒ p) ∧ (¬p ∨ (¬(p ∨ q)))
(q =⇒ p) ∧ (¬p ∨ (¬p ∧ ¬q)))
(q =⇒ p) ∧ ¬p
(¬q ∨ p) ∧ ¬p
(¬q ∧ ¬p) ∨ (p ∧ ¬p)
(¬q ∧ ¬p) ∨ F
¬q ∧ ¬p
¬(q ∨ p)
¬(¬¬q ∨ p)
¬(¬q =⇒ p)
QED
premise
conditional-disjunctive equivalency
double negative
de Morgan
absorption
conditional-disjunctive equivalency
distributive
tautology (negation)
identity
de Morgan
double negative
conditional-disjunctive equivalency
end-of-proof marker
(b) (p =⇒ (q =⇒ r)) =⇒ ((p =⇒ q) =⇒ (p =⇒ r)) is a tautology.
1: Propositional Logic-1
(p =⇒ (q =⇒ r)) =⇒ ((p =⇒ q) =⇒ (p =⇒ r))
(p =⇒ (q =⇒ r)) =⇒ ((¬p ∨ q) =⇒ (p =⇒ r))
(p =⇒ (q =⇒ r)) =⇒ ((¬p ∨ q) =⇒ (¬p ∨ r))
(p =⇒ (q =⇒ r)) =⇒ (¬(¬p ∨ q) ∨ (¬p ∨ r))
(p =⇒ (q =⇒ r)) =⇒ ((¬¬p ∧ ¬q) ∨ (¬p ∨ r))
(p =⇒ (q =⇒ r)) =⇒ ((p ∧ ¬q) ∨ (¬p ∨ r))
(p =⇒ (q =⇒ r)) =⇒ (¬p ∨ (p ∧ ¬q) ∨ r)
(p =⇒ (q =⇒ r)) =⇒ (((¬p ∨ p) ∧ (¬p ∨ ¬q)) ∨ r)
(p =⇒ (q =⇒ r)) =⇒ ((T ∧ (¬p ∨ ¬q)) ∨ r)
(p =⇒ (q =⇒ r)) =⇒ (¬p ∨ ¬q ∨ r)
(p =⇒ (¬q ∨ r)) =⇒ (¬p ∨ ¬q ∨ r)
(¬p ∨ (¬q ∨ r)) =⇒ (¬p ∨ ¬q ∨ r)
(¬p ∨ ¬q ∨ r) =⇒ (¬p ∨ ¬q ∨ r)
QED (A =⇒ A is a tautology)
premise
conditional-disjunctive equivalency
conditional-disjunctive equivalency
conditional-disjunctive equivalency
de Morgan
double negative
associative + commutative shuffling
distributive
negation law
identity (and remove redundant parens)
conditional-disjunctive equivalency
conditional-disjunctive equivalency
remove parens
proof complete
2. Knights always tell the truth, and Knaves always lie. Everyone is either a Knight or
a Knave.
Three travelers approach you, A, B, C.
• A states: “All three of us are knaves”
• B states: “Exactly one of us is a knight”
• C says nothing
Given the following information, use a truth table to determine whether each person
is a knight or knave or if their status cannot be determined. Be sure to explain how
you arrived at your conclusion based on your truth table.
p = ”A is a knight”, ¬p = ”A is not a knight”
q = ”B is a knight”, ¬q = ”B is not a knight”
r = ”C is a knight”, ¬r = ”C is not a knight”
A (literally ”if A is a knight, then all three are not knights”): p ⇐⇒ (¬p)∧(¬q)∧(¬r)
B (literally ”if B is a knight, exactly one is a knight”): q ⇐⇒ (p ∧ ¬q ∧ ¬r) ∨ (q ∧
¬p ∧ ¬r) ∨ (r ∧ ¬q ∧ ¬p)
B reduces nicely, because q ⇐⇒ ¬(¬q), so q =⇒ ¬(r ∧ ¬q ∧ ¬p) ∧ ¬(p ∧ ¬q ∧ ¬r):
hence, we have q ⇐⇒ (q ∧ ¬p ∧ ¬r), which further simplifies to q ⇐⇒ (¬p ∧ ¬r)
Truth table for this situation:
1: Propositional Logic-2
p
0
0
0
0
1
1
1
1
q
0
0
1
1
0
0
1
1
r
0
1
0
1
0
1
0
1
¬p
1
1
1
1
0
0
0
0
¬q
1
1
0
0
1
1
0
0
¬r
1
0
1
0
1
0
1
0
¬p ∧ ¬q ∧ ¬r
1
0
0
0
0
0
0
0
p ⇐⇒ ¬p ∧ ¬q ∧ ¬r
0
1
1
1
0
0
0
0
¬p ∧ ¬r
1
0
1
0
0
0
0
0
q ⇐⇒ ¬p ∧ ¬r
0
1
1
0
1
1
0
0
The possible arrangements are situations in which both propositions are true. There
are two of these: one for the case where A and B are knaves and C is a knight, and
one for the case where A and C are knaves and B is a knight.
The status cannot be determined further.
3. Find sixteen propositions only consisting of two propositional variables p, q and only
consisting of the connectives ∧, ∨, ¬ such that each proposition is logically inequivalent
than the other fifteen.
Idea: use binary counting in 4 digits to get 16 unique descriptors of the outputs of
each function, based on the truth tables like so:
x
0
0
1
1
y
0
1
0
1
out
a
b
c
d
Each function can be described with a sequence of four binary digits corresponding
to a,b,c,d. For instance, a function described by 1010 would have truth table
x
0
0
1
1
y
0
1
0
1
out
1
0
1
0
Actually deriving the logical statements is fairly easy given a set of four ”tools” to be
logical-OR’d together:
(a) 1000 = ¬x ∧ ¬y
(b) 0100 = ¬x ∧ y
(c) 0010 = x ∧ ¬y
(d) 0001 = x ∧ y
1: Propositional Logic-3
This is the sum-of-products technique; it can be demonstrated to produce correctly
any possible binary function in two variables (and actually quite a lot more than that),
which I shall do by using it to complete the problem.
Conveniently, these ”tools” also occupy four possibility slots, meaning we only have
to derive 12. Also, there are two more easily found functions: 1111 and 0000. These
can be represented by 1111 = x ∨ ¬x and 0000 = x ∧ ¬x.
Note that these are determined simply by counting in binary, starting from 0000 and
ending at 1111. This has the useful property of finding every unique combination of
four binary digits, meaning I don’t have to do any guesswork to find the 16 functions.
(a) 0000 : f (x, y) = ¬x ∧ x
(b) 0001 : f (x, y) = x ∧ y
(c) 0010 : f (x, y) = x ∧ ¬y
(d) 0011 : f (x, y) = 0010 ∨ 0001 = (x ∧ ¬y) ∨ (x ∧ y)
(e) 0100 : f (x, y) = ¬x ∧ y
(f) 0101 : f (x, y) = 0100 ∨ 0001 = (¬x ∧ y) ∨ (x ∧ y)
(g) 0110 : f (x, y) = 0100 ∨ 0010 = (¬x ∧ y) ∨ (x ∧ ¬y)
(h) 0111 : f (x, y) = 0100 ∨ 0010 ∨ 0001 = (¬x ∧ y) ∨ (x ∧ ¬y) ∨ (x ∧ y)
(i) 1000 : f (x, y) = ¬x ∧ ¬y
(j) 1001 : f (x, y) = 1000 ∨ 0001 = (¬x ∧ ¬y) ∨ (x ∧ y)
(k) 1010 : f (x, y) = 1000 ∨ 0010 = (¬x ∧ ¬y) ∨ (x ∧ ¬y)
(l) 1011 : f (x, y) = 1000 ∨ 0010 ∨ 0001 = (¬x ∧ ¬y) ∨ (x ∧ ¬y) ∨ (x ∧ y)
(m) 1100 : f (x, y) = 1000 ∨ 0100 = (¬x ∧ ¬y) ∨ (¬x ∧ y)
(n) 1101 : f (x, y) = 1000 ∨ 0100 ∨ 0001 = (¬x ∧ ¬y) ∨ (¬x ∧ y) ∨ (x ∧ y)
(o) 1110 : f (x, y) = 1000 ∨ 0100 ∨ 0010 = (¬x ∧ ¬y) ∨ (¬x ∧ y) ∨ (x ∧ ¬y)
(p) 1111 : f (x, y) = ¬x ∨ x
1: Propositional Logic-4