Word

advertisement
ITCS2175-Logic and Algorithms
Second Hour Exam REVIEW
Set Theory, Predicate Calculus, Arithmetic Proofs
Induction, Recursion
75 minutes
Write your name on all sheets.
Reasons given in proofs must include line numbers as well as rule.
Rules can be given by name or number.
THIS IS A CLOSED-BOOK, CLOSED NOTE EXAM.
Problem
1
Set Theory
Possible
Points
10
2
Sets & Pred C.
14
3
Arithmetic Pfs.
14
4
Arithmetic Pfs.
10
5
Induction
16
6
Induction
12
7
Recursion
16
8
Recursion
18
Total
110
Points Earned
1.
Set Theory (10 points)
A = { { } , a, c}
B = {2, 4,5}
(3 minutes)
C = { c, 2, 5}
a.
What is A  B?
b.
What is | A  C| (the cardinality of A  C)?
c.
What is A - C?
d.
What is P(B)?
e.
If P(S) has 64 elements, how many elements does S have?
1
2.
Set Theory and Pred. Calculus (14 points)
Given:
PQ
Q  (S  T)
S  (R  Tc)
x1  P
(6 minutes)
Use predicate calculus to prove x1  R.
You MUST use quantifiers and predicates to solve this problem.
2
3.
Arithmetic Proofs (14 points)
Prove that
(10 minutes)
5 is irrational by contradiction.
3
4.
Arithmetic Proofs (10 points)
a. Prove that, for all n  N,
(8 minutes)
n 3  2n 2  n  1 is not divisible by 3
b. Construct a polynomial function of n, f(n) so that f(n) is always divisible by 3, but does
not have a factor of 3 in every term (in other words, f(n) cannot be 3n, 3n+6 or anything
like these).
4
5. Induction (16 points)
Given the Fibonacci sequence:
f0 = 0
(15 minutes)
f1 = 1
fn = fn-1 + fn-2
Prove by induction:
2
1
f  f 22  f 32 ...  f n2  f n f n 1
5
6.
Induction (12 points)
(10 minutes)
Prove by induction:
2n
 2k  3(n
2
 n)
for n  1
kn

6
7.
Recursion (16 points)
(8 minutes)
Give a recursive form (including bases) for the following functions:
a.
f(n) = 5 + (-1)n
b.
f(n) = n(n+3)
c.
S = 43 + 2
7
8.
Recursion (18 points)
S(0) = 3
S(1) = 10
S(n) = 5S(n-1) - 6S(n-2)
(12 minutes)
Derive the closed form for this recursion and prove it true by induction.
8
Download