Read · 1 min
First, let's define the three terms explicitly, and then I will provide an explanation.
Let's say we have a function that maps elements from a set to another set .
The domain of is all the numbers contained in that we can put into the function such that it maps to an element in .
The codomain of is all the numbers that can POSSIBLY be outputted by .
The range of is all the numbers that ARE outputted by .
Okay, so what's up with these definitions?
Consider the function . Let us set the domain of to be the set of all integers, or . (This means, every integer, and nothing else, COULD be mapped to another element.)
Think about what a suitable codomain is.
Don't think too hard about the codomain. If we put in an integer, what do we always get? An integer! Therefore, our codomain is also . (This means that every integer COULD be possibly be the mapping of an element in the domain, but it is not always the case.)
Alright, what could be the range?
No matter what integer we put into the function, we will always get an even integer. It is not hard to show that we can obtain EVERY even integer via a mapping from a domain. So our range is . (This means that we can ALWAYS obtain an even integer via a mapping. Our codomain was a little uncertain about which ones could be obtained.)