
Inmathematics, therange of a function may refer either to thecodomain of thefunction, or theimage of the function. In some cases the codomain and the image of a function are the same set; such a function is calledsurjective oronto. For any non-surjective function the codomain and the image are different; however, a new function can be defined with the original function's image as its codomain, where This new function is surjective.
Given twosetsX andY, abinary relationf betweenX andY is a function (fromX toY) if for everyelementx inX there is exactly oney inY such thatf relatesx toy. The setsX andY are called thedomain andcodomain off, respectively. Theimage of the functionf is thesubset ofY consisting of only those elementsy ofY such that there is at least onex inX withf(x) =y.
As the term "range" can have different meanings, it is considered a good practice to define it the first time it is used in a textbook or article. Older books, when they use the word "range", tend to use it to mean what is now called thecodomain.[1] More modern books, if they use the word "range" at all, generally use it to mean what is now called theimage.[2] To avoid any confusion, a number of modern books don't use the word "range" at all.[3]
Given a function
withdomain, the range of, sometimes denoted or,[4] may refer to the codomain or target set (i.e., the set into which all of the output of is constrained to fall), or to, the image of the domain of under (i.e., the subset of consisting of all actual outputs of). The image of a function is always a subset of the codomain of the function.[5]
As an example of the two different usages, consider the function as it is used inreal analysis (that is, as a function that inputs areal number and outputs its square). In this case, its codomain is the set of real numbers, but its image is the set of non-negative real numbers, since is never negative if is real. For this function, if we use "range" to meancodomain, it refers to; if we use "range" to meanimage, it refers to.
For some functions, the image and the codomain coincide; these functions are calledsurjective oronto. For example, consider the function which inputs a real number and outputs its double. For this function, both the codomain and the image are the set of all real numbers, so the wordrange is unambiguous.
Even in cases where the image and codomain of a function are different, a new function can be uniquely defined with its codomain as the image of the original function. For example, as a function from theintegers to the integers, the doubling function is not surjective because only theeven integers are part of the image. However, a new function whose domain is the integers and whose codomain is the even integersis surjective. For the wordrange is unambiguous.