In this Lab, N = {1, 2, 3, ...} Exercise 1. Let $f$ be a function from N to N with $f(n) = n^2 + n + 1$ a) Show that $f$ injective (one-to-one). b) Is $f$ surjective (onto)?
Added by Alexander G.
Close
Step 1
Let's assume that f(n1) = f(n2). This means that n1^2 + n1 + 1 = n2^2 + n2 + 1. Simplifying this equation, we get n1^2 + n1 = n2^2 + n2. Now, let's subtract n1^2 + n1 from both sides of the equation: 0 = n2^2 + n2 - n1^2 - n1. We can rewrite this equation as: 0 Show more…
Show all steps
Your feedback will help us improve your experience
Jennifer Stoner and 69 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Let g be a function from R to (0,1) with g(x) = e^x / (1 + e^x) a) Show that f injective (one-to-one). b) Is f surjective (onto)?
Sri K.
For each of the following, determine (with proof) whether the function is injective and/or surjective. (a) Define f : Z → Z by f(n) = 2n + 1. (b) Define g : R → R by g(x) = x 2 + 2x + 2. (c) Define h: Z → Z by h(n) = n + 3.
Adi S.
Let f: Z_4 -> Z_8 be given by: f(x) = 2x For each x in Z_4 Is this function injective, surjective, bijective? Show your proofs:
Madhur L.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD