Problem Set 1 Solutions
Problem Set 1 Solutions
(a) [6 pts] There are people who have taken 6.042 and have gotten A’s in 6.042
Solution. ∃x ∈ X : S(x) ∧ A(x)
Addendum: It was noted by a sharp student that in the wording of the problem, we used
the word “people” rather than “at least person” - meaning that there must be at least two
people who have gotten A’s. So, the correct answer for this problem would be
Because even we missed this, though, both answers are acceptable for this problem.
(b) [6 pts] All people who are 6.042 TA’s and have taken 6.042 got A’s in 6.042
Solution. ∀x ∈ X : T (x) ∧ S(x) ⇒ A(x)
(c) [6 pts] There are no people who are 6.042 TA’s who did not get A’s in 6.042.
Solution. ¬∃x ∈ X : T (x) ∧ (¬A(x))
(d) [6 pts] There are at least three people who are TA’s in 6.042 and have not taken 6.042
Solution.
∃x, y, z ∈ X : (¬E(x, y) ∧ ¬E(y, z) ∧ ¬E(x, z)) ∧ T (x) ∧ ¬S(x) ∧ T (y) ∧ ¬S(y) ∧ T (z) ∧ ¬S(z)
Solution. We write out the truth table and check that the statements on the left and right
always have the same outputs. Define F (P, Q, R) to be the formula representing the left
side of the equation above, and G(P, Q, R) to be the right side.
P Q R F (P, Q, R) G(P, Q, R)
true true true false false
true true false false false
true false true false false
true false false false false
false true true false false
false true false true true
false false true true true
false false false true true
Solution. Once again, write out the truth table for each side of the equation, letting
F (P, Q, R) be the left side and G(P, Q, R) be the right side.
P Q R F (P, Q, R) G(P, Q, R)
true true true false false
true true false false true
true false true false true
true false false true true
false true true true true
false true false true true
false false true true true
false false false true true
The entries for F and G do not agree for the same inputs of P , Q, and R, so they are not
equal.
considerably easier to construct these out of another operation, nand, which is simpler to
represent in a circuit. Here is the truth table for nand:
P Q P nand Q
true true false
true false true
false true true
false false true
(a) [12 pts] For each of the following expressions, find an equivalent expression using only
nand and ¬ (not), as well as grouping parentheses to specify the order in which the operations
apply. You may use A, B, and the operators any number of times.
(i) A ∧ B
Solution. Observe from the truth table that (A nand B) is equivalent to ¬(A ∧ B).
We negate both expressions to produce
(ii) A ∨ B
Solution. The negation of the negation of a statement is equivalent to the original
statement. We derive the desired expression as follows, applying the identity ¬(P ∨
Q) = (¬P ) ∧ (¬Q):
(A ∨ B) = ¬(¬(A ∨ B))
= ¬((¬A) ∧ (¬B))
= (¬A) nand (¬B).
(iii) A ⇒ B
Solution. An implication is true whenever the antecedent is false or the consequent
is true:
(A ⇒ B) = ((¬A) ∨ B)
= ¬(A ∧ (¬B))
= A nand (¬B).
(b) [4 pts] It is actually possible to express each of the above using only nand, without
needing to use ¬. Find an equivalent expression for (¬A) using only nand and grouping
parentheses.
4 Problem Set 1
Solution. Observe from the truth table for nand that when P and Q are both true,
(P nand Q) is false, and when P and Q are both false, (P nand Q) is true. Setting P
and Q equal to each other, we see that the value of (P nand P ) is the negation of the value
of P . So an equivalent expression for (¬A) is
(A nand A).
(c) [8 pts] The constants true and false themselves may be expressed using only nand.
Construct an expression using an arbitrary statement A and nand that evaluates to true re-
gardless of whether A is true or false. Construct a second expression that always evaluates
to false. Do not use the constants true and false themselves in your statements.
Solution. Observe from the truth table for nand that only three combinations of true and
false produce true.
P Q P nand Q
true false true
false true true
false false true
Furthermore, observe that of these three, two are interchangeable simply by negating both
P and Q:
P Q P nand Q
true false true
false true true
We therefore have a method by which we can produce a true value regardless of the value
of P : make sure that Q is the negation of P . Then, as long as Q and P are different, the
value of P has no bearing on the true value of (P nand Q).
So given an arbitrary proposition A, an expression that always evaluates to true is (A nand
(¬A)). By part (b), this is equal to
(A nand (A nand A)).
The negation of true is false. So by substituting the previous expression for A in part
(b), we can construct an expression that always evaluates to false:
(A nand (A nand A)) nand (A nand (A nand A)).
Problem 4. [10 points] You have 12 coins and a balance scale, one of which is fake. All
the real coins weigh the same, but the fake coin weighs less than the rest. All the coins
visually appear the same, and the difference in weight is imperceptible to your senses. In at
most 3 weighings, give a strategy that detects the fake coin. (Note: the scale in this problem
is a scale with two dishes, which tips toward the side that is heavier. For clarification, do an
image search for “balance scale”).
Problem Set 1 5
Solution. There are many ways to approach this problem. One way is this: separate
the coins into three groups of four, and call them A, B, and C. First, weigh A against B.
Because we know that the fake coin is lighter than the rest, this first weighing will tell us
which group the fake coin is in. If A and B do not balance exactly, the fake coin is in
the lighter group. Otherwise, it is in group C. Now, we have narrowed the fake coin to a
group of four coins. First weigh two coins from that group against each other. If they do
not balance, then the fake coin is the lighter of the two. Otherwise, the fake coin is one of
the other two coins. In that case, we can just weigh those two coins against each other to
determine the fake coin. In the worst case, this strategy takes 3 weighings.
Solution. Proof. We prove the given statement by proving its contrapositive: if r1/5 is
rational, then r is rational.
By our assumption that r1/5 is rational, there exists an integer a and a positive integer b
such that:
a
r1/5 = . (1)
b
Since 5 is a positive integer, we may raise both sides of (1) to the power 5, which gives:
a5
r=
b5
Since a5 and b5 are integers, this implies that r is rational. (Note that b5 6= 0, since b is
positive.)
This proves the contrapositive, so the original statement is also true.
Solution. As the problem suggests, we will build a truth table to figure out what z is in
each case of x, y, z being odd or even.
w, x, y are all even. In this case, we can write w, x, y as 2i, 2j, 2k, and the sum of
squares is 4i2 + 4j 2 + 4k 2 = 4(i2 + j 2 + k 2 ). In this case, z can be an even integer when
i2 + j 2 + k 2 = l2 for some integer l.
w, x, y are all odd. In this case, each of their squares is odd, and the sum of three
odd numbers is odd. However, if z is even, then z 2 is also even. So it cannot be that
z 2 = w 2 + x2 + y 2 .
6 Problem Set 1
One of w, x, y is odd. This case is the same as above. Assume x is odd. Then, x2 is
odd, but y 2 and w2 are even. So the sum is once again, odd, which cannot equal the
square of an even integer. So z cannot be even in that case either. The same argument
can be repeated for when w and y are odd as well.
Two of w, x, y are odd. Assume that w and x are odd and that y are even. Then, we
can write the sum as w2 + x2 + y 2 = (2i + 1)2 + (2j + 1)2 + (2k)2 . This can be rewritten
as 4i2 + 4i + 1 + 4j 2 + 4j + 1 + 4k 2 = 4(i2 + j 2 + k 2 + i + j) + 2. Note that 4 does
not divide this sum. However, if z was an even integer, then z 2 is a multiple of 4. So z
cannot be an even integer in this case. The same argument is also used when x, y are
odd, or when w, y are odd.
With this, we have covered all the cases for the parities of w, x, y, and obtain the following
truth table:
Note: writing this truth table is not a required part of solving this problem. Rather, the
truth table was supposed to suggest to the student the casework that needed to be done
for this problem.