Professional Documents
Culture Documents
[2] a. Is it possible that Alice is a dragon? Is it possible that Alice is a troll? Justify
each answer in no more than three sentences.
Hint: a full and complete justification will include more than just a truth table,
and will almost certainly include the word, “because” (with reference to what
the Alice, Bob, and Carol said).
[2] b. Is it possible that Bob is a dragon? Is it possible that Bob is a troll? Justify
each answer in no more than three sentences.
[2] c. Is it possible that Carol is a dragon? Is it possible that Carol is a troll? Justify
each answer in no more than three sentences.
[3] d. There are eight possible “assignments” of dragon or troll to Alice, Bob, and
Carol.
An “assignment” is a label of dragon or troll to each of Alice, Bob, and Carol,
regardless of whether it is correct or incorrect. For example, “Alice is a dragon,
Bob is a dragon, and Carol is a troll” is one of the eight possible assignments,
regardless of whether that assignment is correct or not.
Are all of the eight possible assignments potentially correct, based on what
Alice, Bob, and Carol said? Justify your answer. Your answer will be judged
on the brevity and preciseness of justifying why either “yes” or “no” is correct.
Solution :
√
3
Assume 5 6∈ Q. (1)
√
3
⇒ 5 = a/b for a, b ∈ Z, where a, b share no common factors (2)
3 3
⇒ 5 = a /b (3)
3 3
⇒ 5b = a (4)
⇒ a3 is divisible by 5 (5)
⇒ a is divisible by 5 by the Fundamental Theorem of Arithmetic (6)
⇒ a = 5k for some k ∈ Z (7)
3 3
⇒ 5b = (5k) by (4), (7) (8)
3 3
⇒b =5·5·k (9)
3
⇒ b is divisible by 5 (10)
⇒ b is divisible by 5 by the Fundamental Theorem of Arithmetic (11)
Solution :
Assume 27 | n
⇒ n = 27k for some k ∈ Z
⇒n=9·3·k
⇒ n divides 9
Solution :
[4] b. Show that ∧ can be simulated using NAND gates. That is, design a circuit
whose only gates are all two-input NAND gates, that takes as input two signals
p and q, and whose output is p ∧ q.
You must prove that your circuit accurately computes p∧q by using equivalence
rules.
Solution :
[4] c. Show that ∨ can be simulated using NAND gates. That is, design a circuit
whose only gates are all two-input NAND gates, that takes as input two signals
p and q, and whose output is p ∨ q.
You must prove that your circuit accurately computes p∨q by using equivalence
rules.
1
See, e.g., Epp 4ed at 35, or Dave’s excellent formula sheet.
Solution :
≡ (p NAND p) NAND (q NAND q)
≡∼ ∼ (p ∧ p)∧ ∼ (q ∧ q) by def’n of NAND
≡∼∼ (p ∧ p)∨ ∼∼ (q ∧ q) by de Morgan’s
≡ (p ∧ p) ∨ (q ∧ q) by Double Negation
≡ p ∨ q by Idempotency
[2] d. Why do the answers to the previous three questions prove that any truth table
can be implemented in a circuit that uses only NAND gates? Justify your
answer in no more than three sentences.
Did you know : you can do the same using only two-input NOR gates?
The circuit should output false if there is a cow-tastrophe, so the circuit can be a
negation of the disjunctive-normal form expression of the above four cases. That is,
the circuit can be expressed as:
∼ (x1 ∧ ∼ x2 ) ∨ (∼ x1 ∧ x2 ∧ ∼ x3 ) ∨ (∼ x2 ∧ x3 ∧ ∼ x4 ) ∨ (∼ x3 ∧ x4 )
We could rewrite the formula to find alternative forms, but it does not reduce the
number of gates used (there are still five). However, some people may find it easier
to read:
∼ (x1 ∧ ∼ x2 ) ∨ (∼ x1 ∧ x2 ∧ ∼ x3 ) ∨ (∼ x2 ∧ x3 ∧ ∼ x4 ) ∨ (∼ x3 ∧ x4 )
≡∼ (x1 ∧ ∼ x2 )∧ ∼ (∼ x1 ∧ x2 ∧ ∼ x3 )∧ ∼ (∼ x2 ∧ x3 ∧ ∼ x4 )∧ ∼ (∼ x3 ∧ x4 )
by de Morgan’s
≡ (∼ x1 ∨ ∼∼ x2 ) ∧ (∼∼ x1 ∨ ∼ x2 ∨ ∼∼ x3 ) ∧ (∼∼ x2 ∨ ∼ x3 ∨ ∼∼ x4 ) ∧ (∼∼ x3 ∨ ∼ x4 )
by de Morgan’s
≡ (∼ x1 ∨ x2 ) ∧ (x1 ∨ ∼ x2 ∨ x3 ) ∧ (x2 ∨ ∼ x3 ∨ x4 ) ∧ (x3 ∨ ∼ x4 )
by Double Negation
Solution :
a ∨ b ∧ ∼ ∼ (∼ b) ∨ b ∧ a∧c
≡ a∨b ∧ ∼b∨b ∧ a ∧ c by Double Negation
≡ a ∨ b ∧ T ∧ a ∧ c by Negation
≡ a ∨ b ∧ a ∧ c by Identity
≡ a∧ a∧c ∨ b∧ a∧c by Distributivity
≡ a∧c ∨ b∧ a∧c by Idempotency
≡ a ∧ c by Absorption
[1] d. Draw a circuit of the simplified equivalent expression, using nothing other than
two-input AND and OR gates, and single-input NEGATION gates.
3
See, e.g., Epp 4ed at 35, or Dave’s excellent formula sheet.
Solution :