CSCI 3700 CSCI 3700 Test 1 Spring 2012 *****KEY***** Spring

CSCI 3700 Test 1 Spring 2012 *****KEY*****
CHAPTER 1:
1: The Foundations: Logic and Proofs
SECTION 1.1 Propositional Logic – Be able to do problems like on the homework, and know
the different ways of expressing p→
p→q.
if p, then q
p implies q
if p, q
p only if q
q unless ¬p
q when p
q if p
q when p
q whenever p
p is sufficient for q
q follows from p
q is necessary for p
a necessary condition for p is q
a sufficient condition for q is p
2. Propositions must have clearly defined truth values, so a proposition must be a declarative sentence
with no free variables.
a) This is not a proposition; it’s a command.
b) This is not a proposition; it’s a question.
c) This is a proposition that is false, as anyone who has been to Maine knows.
d) This is not a proposition; its truth value depends on the value of x.
e) This is a proposition that is false.
f) This is not a proposition; its truth value depends on the value of n.
6. a) True, because 288 > 256 and 288 > 128.
b) True, because C has 5 MP resolution compared to B’s 4 MP resolution. Note that only one of these
conditions needs to be met because of the word or.
c) False, because its resolution is not higher (all of the statements would have to be true for the
conjunction to be true).
d) False, because the hypothesis of this conditional statement is true and the conclusion is false.
e) False, because the first part of this biconditional statement is false and the second part is true.
8. a) I did not buy a lottery ticket this week.
b) Either I bought a lottery ticket this week or [in the inclusive sense] I won the million dollar jackpot on
Friday.
c) If I bought a lottery ticket this week, then I won the million dollar jackpot on Friday.
d) I bought a lottery ticket this week and I won the million dollar jackpot on Friday.
e) I bought a lottery ticket this week if and only if I won the million dollar jackpot on Friday.
f) If I did not buy a lottery ticket this week, then I did not win the million dollar jackpot on Friday\
g) I did not buy a lottery ticket this week, and I did not win the million dollar jackpot on Friday.
h) Either I did not buy a lottery ticket this week, or else I did buy one and won the million dollar jackpot on
Friday.
16. a) This is T ↔ T, which is true.
b) This is T ↔ F, which is false.
c) This is F ↔ F, which is true.
d) This is F ↔ T, which is false.
18. a) This is F → F, which is true.
b) This is F → F, which is true.
c) This is T → F, which is false.
d) This is T → T, which is true.
22.
a) The necessary condition is the conclusion: If you get promoted, then you wash the boss’s car.
b) If the winds are from the south, then there will be a spring thaw.
c) The sufficient condition is the hypothesis: If you bought the computer less than a year ago, then the
warranty is good.
d) If Willy cheats, then he gets caught.
e) The “only if” condition is the conclusion: If you access the website, then you must pay a subscription
fee.
f) If you know the right people, then you will be elected.
g) If Carol is on a boat, then she gets seasick.
28.
a) Converse: If I stay 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 home.
b) Converse: Whenever I go to the beach, it is a sunny summer day. Contrapositive: Whenever I do not
go to the beach, it is not a sunny summer day. Inverse: Whenever it is not a sunny day, I do not go to the
beach.
c) Converse: If I sleep until noon, then I stayed up late. Contrapositive: If I do not sleep until noon, then I
did not stay up late. Inverse: If I don’t stay up late, then I don’t sleep until noon.
32. To construct the truth table for a compound proposition, we work from the inside out. In each case, we
will show the intermediate steps. In part (d), for example, we first construct the truth tables for p ^ q and
for p ∨ q and combine them to get the truth table for (p ^ q) → (p ∨ q). For parts (a) and (b) we have the
following table (column three for part (a), column four for part (b)).
p
¬p
p → ¬p
p ↔ ¬p
T
F
F
F
F
T
T
F
For parts (c) and (d) we have the following table.
p
T
T
F
F
q
T
F
T
F
p∨q
T
T
T
F
p^q
T
F
F
F
p ⊕ (p ∨ q)
F
F
T
F
(p ^ q) → (p ∨ q)
T
T
T
T
For part (e) we have the following table.
p
q
¬p
q → ¬p
T
T
F
F
T
F
F
T
F
T
T
T
F
F
T
T
For part (f) we have the following table.
p
T
T
F
F
q
T
F
T
F
¬q
F
T
F
T
p↔q
T
F
F
T
p ↔ ¬q
F
T
T
F
p↔ q
T
F
F
T
(q → ¬p) ↔ (p ↔ q)
F
F
F
T
(p ↔ q) ⊕ (p ↔ ¬q)
T
T
T
T
44. a) 1 1000 ^ (0 1011 ∨ 1 1011) = 1 1000 ^ 1 1011 = 1 1000
b) (0 1111 ^ 1 0101) ∨ 0 1000 = 0 0101 ∨ 0 1000 = 0 1101
c) (0 1010 ⊕ 1 1011) ⊕ 0 1000 = 1 0001 ⊕ 0 1000 = 1 1001
d) (1 1011 ∨ 0 1010) ^ (1 0001 ∨ 1 1011) = 1 1011 ^ 1 1011 = 1 1011
SECTION 1.2 Applications of Propositional Logic
1. Be able to convert an English sentence to a statement in propositional logic
logic,, such as “If I go to Harry’s
or to the country, I will not go shopping.”
p: I go to Harry’s
q: I go to the country.
r: I will go shopping.
If p or q then not r.
2. Explain the solution to the knight/knave problem.
An island has two types of inhabitants, knights and knaves.
Knights always tell the truth.
Knaves always lie.
What are A and B if:
a) A says “B is a knight.”
b) B says “The two of us are opposite types.”
Let p be the statement that A is a knight.
Let q be the statement that B is a knight.
There are four cases we must consider:
1) A is a knight.
2) B is a knight.
3) A is a knave.
4) B is a knave.
Case 1:
If A is a knight, then A always tells the truth.
Thus (a) is true, so B is a knight.
(p^¬q) ∨ (¬p^q).
Thus (b) is true, so they are of opposite types, meaning that (p
That means that B is a knave.
This is a contradiction because B can’t be both a knight and a knave. So A can’t be a knight because it
leads to this contradiction.
Case 2:
If B is a knight, then B always
lways tells the truth.
Thus (b) is true, so the two are opposite types.
That means that A is a knave, thuss always lies.
Thus based on the comment in (a), B is a knight is false, therefore B is a knave.
This is a contradiction because our original assumption was that B is a knight. So B can’t be a knight
because it leads to this contradiction.
Case 3:
If A is a knave, then A always lies.
Thus (a) is false, so B is a knave.
Thus (b) is false, so they are of the same type, further confirming that B iis a knave.
Case 4:
If B is a knave, then B always lies.
Thus (b) is false, so A and B are not of opposite types, thus A is a knave.
Thus (a) is false, further confirming that B is a knave.
SECTION 1.3 Propositional Equivalencies
1. Define: tautology, contradiction, and contingency.
A tautology is a proposition
roposition which is alwa
always true.
A contradiction is a proposition which is always false.
A contingency is a proposition which is neither a tautology nor a contradiction
contradiction.
2. Be able to determine if a proposition is a tautology, a contradiction, or a contingency.
3. State DeMorgan’ss laws. Write the truth tables for them.
p
q
¬p
¬q
(p∧q)
¬(p∧q)
¬p∨¬q
T
T
F
F
T
F
F
T
F
F
T
F
T
T
F
T
T
F
F
T
T
F
F
T
T
F
T
T
p
q
¬p
¬q
(p∨q) ¬(p∨q)
¬p∧¬q
T
T
F
F
T
F
F
T
F
F
T
T
F
F
F
T
T
F
T
F
F
F
F
T
T
F
T
T