when is a function said to be onto
Surjective function In mathematics, a function f from a set X to a set Y is surjective (or onto), or a surjection, if for every element y in the codomain Y of f there is at least one element x in the domain X of f such that f(x) = y. It is not required that x is unique; the function f may map one or more elements of X to the same element of Y.