Let X={a,b,c,d} and Y={1,2,3,4,5} and define f:X rightarrow Y by f(a)=1, f(b)=2, f(c)=5, f(d)=2. Find the domain, codomain and range. If someone could explain this question in detail so i can do some revision on it, i'd be grateful.

Karsyn Beltran

Karsyn Beltran

Answered question

2022-07-18

Discrete Maths - Range of function
Let X = { a , b , c , d } and Y = { 1 , 2 , 3 , 4 , 5 } and define f : X Y by f ( a ) = 1, f ( b ) = 2, f ( c ) = 5, f ( d ) = 2.
Find the domain, codomain and range. If someone could explain this question in detail so i can do some revision on it.

Answer & Explanation

slapadabassyc

slapadabassyc

Beginner2022-07-19Added 21 answers

Step 1
Domain is a set on which valid inputs to f are defined. Since f is defined on a,b,c,d, the domain is the entire X.
Range is a set to which f maps the input -- in other words, all possible outputs of f. Here, {1,2,5}. Sometimes range is called image.
Codomain is the bigger set where every output must be defined, here it is Y.
Step 2
For another example consider f : R R given by f ( x ) = 1 / x 2 .
- The domain are all possible inputs, so 0 is not a part of it since 1/0 is undefined. So the domain are all non-zero reals.
- The codomain is where f maps, here is defined as R.
- The image or range of f is the actual outputs of f, here all positive reals.
Aleah Booth

Aleah Booth

Beginner2022-07-20Added 5 answers

Step 1
By definition the domain of f is the set of all inputs for which f is defined; in this case that’s { a , b , c , d } = X. This is actually implicit in the notation f : X Y, which almost always implies that that the domain of f is X. (I say almost because in some areas of mathematics one deals with so-called partial functions from X to Y, whose domains may not be all of X. I would not worry about this: it should not come up in what you’re doing.)
Step 2
The codomain can also be read straight from the notation f : X Y: it’s the target set Y, which here is {1,2,3,4,5}. The range is always a subset of the codomain: it’s the set of values that the function actually assumes (or if you prefer -- and in CS you might! -- outputs). For your function f those values are 1,2, and 5, so the range of f is the set {1,2,5}.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Discrete math

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?