# How can two different domains map to the same range in a function?

How can two different domains map to the same range in a function? I'm honestly trying to become better at math, so sorry if I come off as ignorant. A function must have every domain value associate to only one y-value. Ok, that makes sense. But then, in a function, one y-value IS able to map to 2 different domains. Why? This puzzles my logic. A function has a rule, so if, per say, my rule is f(x)=x+1 , then I can have the following set: {(1,2),(2,3)}. This set follows the function, however, I am unable to have a set such as: {(1,2),(1,3)}, ok so that makes sense according to my rule. However, a function CAN have a relation of the following: {(1,2),(2,2)}, this is allowed in a function, however, I don't see how this could ever follow my rule? Is there an example where my brain could be proved otherwise? lol Thanks guys!

• The most basic example that comes to mind is a constant function such as $f(x)=5 , x \in \mathbb{R}$. – 2chromatic Jan 27 '18 at 1:04
• $f~:~\{-1,1\}\to\{1\}$ given by $f(x)=x^2$ satisfies $(-1)^2=1$ and $1^2=1$ is an example of where $f(-1)=f(1)$. Perhaps you are only trying linear functions of the form $ax+b$ with $a\neq 0$. As for $\{(1,2),(2,2)\}$, we might call such a function a "constant function" and might be written simply as $f(x)=2$, or if you insist on a more convoluted way, how about $f(x)=|x-1.5|+1.5$ where one has $f(1)=f(2)=2$. – JMoravitz Jan 27 '18 at 1:04
• Here is another example of a function which is not one-to-one: Denote the function "$\text{First}$" with domain being the set of words in the English language and range the set of letters used in the English alphabet defined as taking a word as input and outputting the first letter of that word. We have $\text{First}(apple)=a=\text{First}(ant)$. Written in set form we have $\text{First}=\{(aardvark,a),(aarnet,a),\dots,(first,f),\dots,(zulu,z)\}$. We don't even need our functions to have "rules" that "make sense" in the first place, $\{(1,\pi),(potato,5)\}$ can be a perfectly valid function – JMoravitz Jan 27 '18 at 1:19
• Nice way to prove the point @JMoravitz – chromechris Jan 27 '18 at 1:31

• I think intuitively the idea is A function takes its input and follows a rule to produce its output. Sometimes, following the rule for different inputs leads to the same output result.

• You may be used to functions where different inputs always produce different outputs. For example, "adding one to a number" is a function where different inputs produce different outputs. Or "doubling a number".

However, some rules can behave differently: even if you start with two different inputs, the rule may transform them into the same output.

• Here's an example: a function like $f(x)=x^2$ sends every number to its square. So, for example, $f(3)=3\cdot 3 = 9$. Because (-3)(-3) = +9, we know that $f(-3)=9$ as well. So, squaring -3 and squaring 3 end up as the same result.

So, the function is built of the tuples $(3,9)$ and also $(-3, 9)$.

• Or you can consider the rule $g(x)$ which takes in a number and tells you whether it's odd or even. Then $g(2)=g(4)=g(6)=\ldots = \mathsf{even}$ and $g(1)=g(3)=g(5)=\ldots = \mathsf{odd}$. Many inputs lead to the same result.

• Functions can even deal with things other than numbers. Imagine a function whose inputs are people and whose outputs are numbers— the person's age. Then this rule may associate two different people with the same age.

Functions are designed to model specific relationships, where we associate with each input ("element of the domain") exactly one output ("element of the range"). There is a certain amount of asymmetry in this definition; nothing prohibits a function from sending several inputs to the same output (but fear not, we have such a concept in mathematics as well! Functions that do send different inputs to different outputs are called "one-to-one" or "injective").

It is not an accident that (given a function $f$, and an element $x$ in the domain of $f$) we generally say "$f$ of $x$" when we see $f(x)$. Lots of relationships in the real world are functions in the mathematical sense, and this is especially clear if we can say "the $\_\_\_$ of $\_\_\_$".

For example, "the (biological) mother of $x$" is a function from the set of all people to the set of all people, that associates with a person $x$ that person's mother. Any person has exactly one biological mother, and so it satisfies the definition of a function (each input person gets paired with exactly one output person).

If we denote this function by $f$, then for a given woman $y$, the equation $f(x) = y$ may have many different solutions; a woman may have more than one child, and for any child $x$ of mother $y$, "the mother of $x$ is $y$" is true (symbolically, $f(x) = y$). This is an example where different inputs (people) may get sent to the same output (their mother).

Here again we see asymmetry: If we had tried to define our function by "the child of $x$", that sends to each biological mother her child, this would not be a function: A given input (biological mother) may correspond to several outputs (that mother's children). It certainly constitutes a relationship between biological mothers and people, but in general, we haven't specified any criteria that makes the outputs unique.

• Nice! Hmm, thanks to all who have chimed in! I was wondering, my notion of equations has changed, lol. At first I saw functions ONLY as equations which take input and give an output, which is not wrong, but I did not understand the conceptual constraints on such. Now that I do, I'm left wondering at what the significance of splitting off equations such as f(x)=y^2+3 (non-function relation), and f(x)=x(0)+3 (function relation)? What is the purpose/importance/practice of a function vs a non-function. Why prefer a function over just a relation and vice-versa? – chromechris Jan 27 '18 at 1:58
• Both functions (single output for every input) and relations are useful, and I don't really have a great answer to your question. But, functions eliminate choice. We like deterministic things, and functions are deterministic: You give a function the same input, and it'll always give you the same output. But for a relation, we might have to choose between several "outputs" for a given input. The first way is more "streamlined" in that we don't have to make choices, we just follow a single path. But the second way allows us to model more things. – pjs36 Jan 27 '18 at 2:37
• Awesome explanation! Thanks @pjs36 – chromechris Jan 27 '18 at 2:40