If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Surjective (onto) and injective (one-to-one) functions

Introduction to surjective and injective functions. Created by Sal Khan.

Want to join the conversation?

• Well, i was going through the chapter "functions" in math book and this topic is part of it.. and video is indeed usefull, but there are some basic videos that i need to see.. can u tell me in which video you tell us what co-domains are? is the co- domain the range?
• I actually think that it is important to make the distinction. If a transformation (a function on vectors) maps from ℝ^2 to ℝ^4, all of ℝ^4 is the codomain. However, it is very possible that not every member of ℝ^4 is mapped to, thus the range is smaller than the codomain.
• I don't see how it is possible to have a function whoes range of x values NOT map to every point in Y. That is why it is called a function. So if Y = X^2 then every point in x is mapped to a point in Y. What I'm I missing? It would seem to me that having a point in Y that does not map to a point in x is impossible.
• Hi there Marcus. You are simply confusing the term 'range' with the 'domain'. The x values are the domain and, as you say, in the function y = x^2, they can take any real value. However, the values that y can take (the range) is only >=0. (Notwithstanding that the y codomain extents to all real values). I hope that makes sense.
• The function y=x^2 is neither surjective nor injective while the function y=x is bijective, am I correct?
• When both the domain and codomain are ℝ, you are correct.
• I am extremely confused. I understood functions until this chapter. I thought that the restrictions, and what made this "one-to-one function, different from every other relation that has an x value associated with a y value, was that each x value correlated with a unique y value. I'm so confused. Not sure how this is different because I thought this information was what validated it as an actual function in the first place. Not sure what I'm mussing. Please Help.
• function: f:X->Y "every x in X maps to only one y in Y."

one to one function: "for every y in Y that the function maps to, only one x maps to it". (injective - there are as many points f(x) as there are x's in the domain).

onto function: "every y in Y is f(x) for some x in X. (surjective - f "covers" Y)

Notice that all one to one and onto functions are still functions, and there are many functions that are not one to one, not onto, or not either.

Not 1-1 or onto: f:X->Y, X, Y are all the real numbers R: "f(x) = x^2". X, Y = R: "f(x) = the smallest integer > or = x".

Not 1-1: X = R and Y = non-negative R: "f(x) = x^2".

Not onto: X, Y = R: f(x) = a^x

One to one and onto: X, Y = R: "f(x) = ax, for any a not = 0"
(1 vote)
• Dear team, I am having a doubt regarding the ONTO function.
Suppose A={1,2,3,4,5}, B=N and f : A -> B be defined by f(x) = x * x. The range of f={1,4,9,16,25}. Why this function is NOT an ONTO function?
• A function `ƒ: A → B` is onto if and only if `ƒ(A) = B`; that is, if the range of `ƒ` is `B`. In other words, `ƒ` is onto if and only if there for every `b ∈ B` exists `a ∈ A` such that `ƒ(a) = b`.

In your case, `A = {1, 2, 3, 4, 5}`, and `B = N` is the set of natural numbers(?), and `ƒ(x) = x²`. This means that `ƒ(A) = {1, 4, 9, 16, 25} ≠ N = B`. In other words, the range of `ƒ` is not `B`, so `ƒ` is not onto.
• If one element from X has more than one mapping to y, for example x = 1 maps to both y = 1 and y = 2, do we just stop right there and say that it is NOT a function? Or do we still check if it is surjective and/or injective?
• We stop right there and say it is not a function. Injectivity and surjectivity are concepts only defined for functions.
• Isn't the last type of function known as Bijective function?
• Yes. Bijective functions are those which are both injective and surjective.
• Does a surjective function have to use all the x values? Do all elements of the domain have to be in a mapping?
• Every function (regardless of whether or not it is surjective) utilizes all of the values of the domain, it's in the definition that for each x in the domain, there must be a corresponding value f(x).

Even though you reiterated your first question to be more clear, there is a different interpretation of your first question:

Is there an example of a surjective function f: X -> Y
and a strict subset U of X such that the restriction function f |U : U -> Y is still surjective?

And the answer to that is yes, but it's not true always.

Consider X={1,2,3,4}, U={1,2,3}, Y={a,b,c}, and
f: X -> Y; f(1)=a, f(2)=b, f(3)=c, f(4)=c.

This is a function who satisfies another (possibly incorrect) interpretation of your first question.

A function that does not satisfy this condition is
the identity function on any finite set.
• Give an example of a function which is neither surjective nor injective