home—info—lectures—exams—archive
exam01-practice
exam 1 practice
Instructions:
You can have one single-side 8.5″x11″ piece of paper
which has nothing but your handwriting/drawing on it.
(No mechanical reproduction.)
This is longer than the in-class exam would be
(this practice-exam should take ≤90min.)
All problems refer to 6th edition page/problem numbers.
-
(Rosen §1.1, p.17, #7):
English → Propositional Logic, re freezing and snowing.
-
(Rosen §1.1, p.17, #9):
English → Propositional Logic, re speeding and tickets
-
Consider the statement “If I eat sushi, I am happy.”.
- What is the converse of this statement?
- What is the contrapositive of this statement?
- Which of the above two is/are equivalent to the original?
-
(Rosen §1.2, p.28, #9).
Tautology via truth table
-
(Rosen p.28, #11a).
Use propositional equivalences
to show that the following is a tautology (that is, equivalent to True):
(p∧q)→p.
Your answer will be a series of formulas, joined by ≡,
with each line justified
by one of the reasons from Rosen's tables 6,7,8 in section 1.2.
(Fifth edition: tables 5,6,7.)
You may combine any associativity or commutativity steps
with other steps; just cite that additional justification.
(See solution.)
-
(Rosen §1.3, p.46, #3).
evaluating predicates (states and capitals)
-
(Rosen §1.3, p.47, #7).
first-order logic → English: funny comedians
-
(Rosen §1.3, p.47, #9).
English → first-order: Russian C++
-
(Rosen §1.3, p.47, #11).
Evaluating first-order formulas: x=x²?
-
(Rosen §1.3, p.47, #21).
Making interpretations: old people studying discrete math
-
(Rosen §1.4 p.59, #11).
English → Nested quantifiers: students and profs asking questions
-
(Rosen §1.6, p.84, #3).
Direct proof of ∀n.even(n)→even(n²).
-
Fill in the blank below
with
a logic formula
formally defining the set-difference:
For sets A and B,
A-B = { x |
}
(See solution;
the answer is also given inside the chapter.)
-
(Rosen §2.2, p.130, #15a).
Proving the set version of DeMorgan's law,
showing each a subset of each other.
-
(Rosen p.131, #33).
Practice internalizing a definition: symmetric difference.
-
Consider the standard programming function
parseDouble
(abbreviation: “pd”)
which takes in any String and
either returns what double the string represents (in base 10),
or Double.NaN
(a special sentinel value,
used if the string doesn't represent any double)1
For example,
pd("+18")=18.0,
pd("001.9")=1.9,
pd("1.0000000000000000001")=1.0 (note the round-off error
inherent to type double),
and
pd("w00t")=Double.NaN,
-
Is this function onto (for the stated domain and codomain)?
Explain.
-
Is this function one-to-one (for the stated domain and codomain)?
Explain.
The following are also good study questions
(but would make this practice-exam too long, if they were on it.)
-
(Rosen §2.2, p.130, #29).
Practice with ∪,∩-: making conclusions.
-
(Rosen §2.2, p.130, #31).
An if-and-only-if proof:
the set version the contrapositive.
1
Note that technically, Double.NaN is a value of type
double,
so technically our codomain really is double,
and we don't need to say double∪{Double.NaN}.
↩
home—info—lectures—exams—archive