CS/MATH 1019 Discrete Math for Computer Science
All documents for this subject (14)
Seller
Follow
YourAssignmentHandlers
Reviews received
Content preview
SC/MATH 10 19B - HOMEW OR K 2
DUE OCTOB ER 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 (n1) = f (n2), then n1 + 5 = n2 + 5 and so n1 = n2. 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 a1, a2 ∈ A with a1 /= a2 such that f (a1) = f (a2). This means
(g ◦ f )(a1) = g(f (a1)) = g(f (a2)) = (g ◦ f )(a2)
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 a1 = 2 and an = 2nan−1 for n > 1.
We claim that an = 2nn!. Indeed a1 = 2 = 211!. Assume that an = 2nn! for some
n ≥ 1, then
an+1 = 2(n + 1)an = 2n(2nn!) = 2n+1(n + 1)!.
1
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller YourAssignmentHandlers. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $14.99. You're not tied to anything after your purchase.