Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

SC/MATH 1019B - HOMEWORK 2 Discrete Math for Computer Science with Verified Solutions, Exams of Discrete Mathematics

SC/MATH 1019B - HOMEWORK 2 Discrete Math for Computer Science with Verified Solutions

Typology: Exams

2024/2025

Available from 10/25/2024

star_score_grades
star_score_grades 🇺🇸

3.6

(19)

1.7K documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SC/MATH 1019B - HOMEWORK 2
DUE OCTOBER 23, 2024
Solutions to the problems below must be brought to class on October,23 2018. Solu-
tions may by typed or neatly hand written. You must clearly indicate which problem
you are solving. All solutions must be fully justified.
# 1.
(a) Given an example of a function
f
: N N which is injective but not
surjective.
(a) Given an example of a function g : N N which is surjective but not
injective.
An example of an injective but not surjective function is f : N N by f (n) = n+5.
If
f
(n
1
)
= f
(n
2
), then n
1
+
5
=
n
2
+
5 and so n
1
=
n
2
. Therefore
f
is injective.
To see that
f
is not surjective consider 1 N (the codomain). If
f
(n)
=
1,
then n
+
5
=
1 and n
=
4. However, 4
/∈
N (the domain) so
f
is not
surjective.
An example of a surjective but not injective function is g : N N by g(n)
=
[n/2. Indeed for any n N (the codomain) take 2n N (the domain) and
g(2n)
=
n. The function g is not injective since g(2)
=
1
=
g(3) but 2 /= 3.
# 2. Let A, B, and C be nonempty sets. Let
f
: A B and g : B C be
functions. Show that if g
f
is one-to-one, then
f
must be one-to-one. Is it
true that g must also be one-to-one?
Let us use proof by contrapositive. Assume that
f
is not one-to-one. Then there
exists a
1
, a
2
A with a
1
/= a
2
such that
f
(a
1
)
= f
(a
2
). This means
(g
f
)(a
1
)
=
g(f (a
1
))
=
g(f (a
2
))
=
(g
f
)(a
2
)
and g
f
is not one-to-one.
To see an example where g
f
is one-to-one, but that g is not one-to-one tkae
A = {0}, B =
Z, and
C = {0}
with
f
(0)
=
0 and g(n)
=
0 for n Z. Then g is
not one-to-one since g(0)
=
0
=
g(1), but g
f
:
{0}
{0}
is one-to-one.
#
3. Solve the recurrence relation given by a
1
=
2 and a
n
=
2na
n1
for n
>
1.
We claim that a
n
=
2
n
n!. Indeed a
1
=
2
=
2
1
1!. Assume that a
n
=
2
n
n! for some
n 1, then
a
n+1
= 2(n + 1)a
n
= 2n(2
n
n!) = 2
n+1
(n + 1)!.
1

Partial preview of the text

Download SC/MATH 1019B - HOMEWORK 2 Discrete Math for Computer Science with Verified Solutions and more Exams Discrete Mathematics in PDF only on Docsity!

SC/MATH 1019B - HOMEWORK 2

DUE OCTOBER 23, 2024

Solutions to the problems below must be brought to class on October,23 2018. Solu- tions may by typed or neatly hand written. You must clearly indicate which problem you are solving. All solutions must be fully justified. # 1. (a) Given an example of a function f : N → N which is injective but not surjective. (a) Given an example of a function g : N → N which is surjective but not injective. An example of an injective but not surjective function is f : N → N by f ( n ) = n +5. If f ( n 1 ) = f ( n 2 ), then n 1 + 5 = n 2 + 5 and so n 1 = n 2. Therefore f is injective. To see that f is not surjective consider 1 ∈ N (the codomain). If f ( n ) = 1, then n + 5 = 1 and n = −4. However, − 4 /∈ N (the domain) so f is not surjective. An example of a surjective but not injective function is g : N → N by g ( n ) = [ n/ 2 ♩. Indeed for any n ∈ N (the codomain) take 2 n ∈ N (the domain) and g (2 n ) = n. The function g is not injective since g (2) = 1 = g (3) but 2 /= 3. # 2. Let A, B , and C be nonempty sets. Let f : AB and g : BC be functions. Show that if gf is one-to-one, then f must be one-to-one. Is it true that g must also be one-to-one? Let us use proof by contrapositive. Assume that f is not one-to-one. Then there exists a 1 , a 2 ∈ A with a 1 /= a 2 such that f ( a 1 ) = f ( a 2 ). This means ( gf )( a 1 ) = g ( f ( a 1 )) = g ( f ( a 2 )) = ( gf )( a 2 ) and gf is not one-to-one. To see an example where gf is one-to-one, but that g is not one-to-one tkae A = { 0 } , B = Z, and C = { 0 } with f (0) = 0 and g ( n ) = 0 for n ∈ Z. Then g is not one-to-one since g (0) = 0 = g (1), but gf : { 0 } → { 0 } is one-to-one. # 3. Solve the recurrence relation given by a 1 = 2 and an = 2 nan− 1 for n > 1. We claim that an = 2 nn !. Indeed a 1 = 2 = 21 1!. Assume that an = 2 nn! for some n ≥ 1, then an +1 = 2( n + 1) an = 2 n (2 nn !) = 2 n +1( n + 1)!. 1