MATH 302 – Discrete Mathematics – Section 501 Homework 7

advertisement
Dr. Timo de Wolff
Institute of Mathematics
www.math.tamu.edu/~dewolff/Spring16/math302.html
MATH 302 – Discrete Mathematics – Section 501
Homework 7
Spring 2016
Due: Monday, April 4th, 2016, 4:10 pm.
When you hand in your homework, do not forget to add your name and your UIN.
Exercise 1. Let f : N → N, g : N → N be recursive functions given by f (0) := 0 and
f (n + 1) := 3f (n) + 7
1. Compute the values for 1, 2, . . . , 5 for f .
2. Show that f is injective.
3. Prove via mathematical induction that the values of f alternate between odd and even
numbers (caution: you need to show the basis step for two numbers and you might
need to do a proof by cases or give a similar argument).
Exercise 2. Investigate the following recursive algorithm RecAlg1:
Input: a, b ∈ N with a < b.
Output: c ∈ N.
begin
if a = 0 then
return b
else
return RecAlg1(b mod a,a)
Algorithm 1: RecAlg1
1. Compute RecAlg1(3, 5), RecAlg1(4, 8), RecAlg1(6, 12). Also give the intermediate
steps.
2. Show that the algorithm terminates after finitely many steps.
1
3. Show that RecAlg1 yields the greatest common divisor for a and b in the following
way: Let (rj , rj−1) be the input of the j-th recursive step of RecAlg1.
• Show that for all n ∈ N it holds that RecAlg1(rn+1 , rn ) returns rn if and only if
rn is the greatest common divisor of rn−1 .
• Use mathematical induction over the number of steps of the algorithm starting
with the final step. Show that the greatest common divisor d of rj and rj−1 also
divides rj+1 .
Exercise 3. A n × m integral matrix is an array with n rows and m columns such that
all entries are integers. Thus, a 2 × 2 matrix A is of the form
a11 a12
A :=
a21 a22
with all aij ∈ Z. Matrices have a product operation. If A, B are 2 × 2 matrices, then the
matrix C := A · B is also a 2 × 2 matrix with entries cij := ai1 · b1j + ai2 · b2j .
1. Let
A :=
2 4
1 3
and B :=
3 1
2 0
Compute A · B, B · A and A · A · B.
2. We define An := A
· · · A}. Let fj denote the j-th Fibonacci number. Show
| · ·{z
n times
1 1
1 0
n
=
fn+1 fn
fn fn−1
.
Exercise 4 (Bonus Exercise). Let A, B be arbitrary countable sets. Prove that the union
of A and B is also countable.
Hint: Use a proof by cases.
2
Download