100 Problem Set 4
100 Problem Set 4
Since these truth tables have the same truth values, the formulas are equivalent. The truth tables above
are very detailed and you don't need to provide this level of detail in yours. However, you should at
least specify the truth value of each connective.
i. p ↔ q
ii. r ∨ (¬p ∧ q)
iii. ¬(p → q) → (p → ¬q)
You have just shown that every propositional logic formula can be written purely in terms of ↓, since
you can
• Eliminate ↔, →, ⊤, and ⊥ by converting to ¬, ∧, and ∨,
• Eliminate ∨ by converting to ¬ and ∧, and
• Eliminate ¬ and ∧ by converting to ↓.
Because ↓ is powerful enough to derive the rest of the connectives, it is sometimes referred to as a sole
sufficient operator.
An interesting aside: because any propositional formula can be
written entirely in terms of ↓, it is possible to build any digital
circuit using only wires and hardware implementations of ↓ called
NOR gates. Many early computers were assembled with all the
logic done purely in NOR gates. One particularly impressive
such computer was the Apollo Guidance Computer (pictured to
the left; image courtesy of the Computer History Museum), which
helped guide the Apollo spacecraft to safe landings on the moon.
There are actually two sole sufficient operators: the ↓ connective
you just saw, and a second connective call nand whose truth table
is the negation of the truth table for the ∧ connective. Most
modern computers are build primarily of NAND gates rather than
NOR gates, since they're slightly easier to manufacture.
Problem Four: Translating into Logic (32 points)
In each of the following, you will be given a list of first-order predicates and functions along with an
English sentence. In each case, write a statement in first-order logic that expresses the indicated
sentence. Your statement may use any first-order construct (equality, connectives, quantifiers, etc.), but
you must only use the predicates, functions, and constants provided.
i. Given the predicate
Natural(x), which states that x is an natural number,
the function
Product(x, y), which yields the product of x and y,
and the constants 1 and 137, write a statement in first-order logic that says “137 is prime.”
ii. Given the predicates
Word(x), which states that x is a word,
Definition(x), which states that x is a definition, and
Means(x, y), which states that x means y,
write a statement in first-order logic that says “some words have exactly two meanings.”
iii. Given the predicates
x ∈ y, which states that x is an element of y, and
Set(S), which states that S is a set,
write a statement in first-order logic that says “every set has a power set.”
iv. Given the predicates
Lady(x), which states that x is a lady,
Glitters(x), which states that x glitters,
IsSureIsGold(x, y), which states that x is sure that y is gold,
Buying(x, y), which states that x buys y,
StairwayToHeaven(x), which states that x is a Stairway to Heaven,
write a statement in first-order logic that says “There's a lady who's sure all that glitters is gold,
and she's buying a Stairway to Heaven.”*
v. Given the predicates
String(x), which states that x is a string,
Set(S), which states that S is a set,
Regular(L), which states that L is a regular language,
DFA(D), which states that D is a DFA,
Accepts(D, w), which states that D accepts w, and
x ∈ S, which states that x is an element of S,
write a statement in first-order logic that says “If L is a language, then it is a regular language if
and only if there is a DFA that accepts exactly the strings in L.” (If you're starting this problem
set early, we'll define DFAs in Monday's lecture).
* Let's face it – the lyrics to Led Zeppelin's “Stairway to Heaven” are impossible to decipher. Hopefully we can gain
some insight by translating them into first-order logic!
Problem Five: First-Order Negations (12 points)
Proof by contradiction can be difficult because it is often tricky to determine what the negation of the
theorem is. In this problem, you'll use first-order logic to explicitly determine the negation of
statements in first-order logic.
For each of the first-order logic formulas below, find a first-order logic formula that is the negation of
the original statement. Your final formula must not have any negations in it, except for direct negations
of predicates. For example, the negation of
∀x. (p(x) → ∃y. (q(x) ∧ r(y)))
would be found by pushing the negation in from the outside as follows:
¬(∀x. (p(x) → ∃y. (q(x) ∧ r(y))))
∃x. ¬(p(x) → ∃y. (q(x) ∧ r(y)))
∃x. (p(x) ∧ ¬∃y. (q(x) ∧ r(y))
∃x. (p(x) ∧ ∀y. ¬(q(x) ∧ r(y)))
∃x. (p(x) ∧ ∀y. (q(x) → ¬r(y)))
You must show every step of the process of pushing the negation into the formula (along the lines of
what is done above), but you do not need to formally prove that your result is correct.
i. ∃S. (Set(S) ∧ ∀x. x ∉ S)
ii. ∀p. ∀q. (p ∈ ℕ ∧ q ∈ ℕ ∧ q ≠ 0 → q × q × 2 ≠ p × p)
iii. ∀x. (x ∈ ℝ → ∀y. (y ∈ ℝ → (x < y → ∃q. (q ∈ ℚ ∧ x < q ∧ q < y))))
Submission instructions
There are three ways to submit this assignment:
1. Hand in a physical copy of your answers at the start of class. This is probably the easiest way
to submit if you are on campus.
2. Submit a physical copy of your answers in the filing cabinet in the open space near the handout
hangout in the Gates building. If you haven't been there before, it's right inside the entrance
labeled “Stanford Engineering Venture Fund Laboratories.” There will be a clearly-labeled
filing cabinet where you can submit your solutions.
3. Send an email with an electronic copy of your answers to the submission mailing list
( [email protected] ) with the string “[PS4]” in the subject line. If
you do submit electronically, please submit your assignment as a single PDF if at all possi-
ble. Sending multiple files makes it harder to grade your submission.
Extra Credit Problem: Insufficient Connectives (5 Points Extra Credit)
In Problem Three, you proved that the ¬ and ∧ connectives are sufficient to express all propositional
logic formulas with at least one variable.
Prove that there exists a propositional logic formula φ containing at least one variable that cannot be
rewritten as a formula using just the connectives ¬ and ↔.