# Examples of relations that are not functions

When teaching functions, one key aspect of the definition of a function is the fact that each input is assigned exactly one output.

I always felt that the "exactly one" part is confusing to students because it seems to be "the default", and I have a hard time to find convincing examples of binary relations with "ambiguous" "outputs".

Therefore I am asking for example of such binary relations. (Bonus points if the "hack" to just take "the set of" multiple possible outputs, for example when looking at divisors of a number, "feels awkward".)

• maybe "relations" would be better? May 4, 2022 at 12:18
• I think "relation" is too general a word. I read the question as asking for things that intuitively feels like a function-like assignment, but isn't actually one. "Relation" covers that and so much more, and yet not every "function-like" thing is a relation, like Paul Garret's "the result of a die throw" example below. May 4, 2022 at 19:12
• If you define function, relation, etc, it should then be straightforward to check if an example is one or the other. The present difficulty is that, contrary to most mathematical terminology, there is no accepted definition for mapping. Sometimes it's means 'function', sometimes not, depending on the whims of the author May 4, 2022 at 22:32
• I think a key to this, after collecting examples of mappings in the answers, is to point out that what is and is not a function is arbitrary, but we have found that things which obey this "maps to exactly one output" rule behave particularly well, and we can do a lot with them which are extremely tricky to do with "maps to many outputs." Its those properties of functions that make the definition of functions useful. May 5, 2022 at 2:50
• I deleted my comment, since the thing about Bishop calling these "operations" was wrong. What I had in mind were functions that don't respect equality, which is not the same as multivalued functions. I also agree now that it would be better to call these relations. May 6, 2022 at 12:37

The example I use:

• $$f(x) = x$$'s sister

Looks fine, has a formula. I can write "$$f($$Chris$$) =$$Jessica" since I have a sister. I can talk about the domain of $$f$$ by asking for someone to volunteer their sister's name, and asking someone else to volunteer that they do not have a sister. Usually someone in the room will have two sisters, and when this comes up, it proves the relation I am talking about is not a function, so I can't really write it as $$f(x)$$ after all.

• I don't particularly like this example. This is just a relation, and coaxing it into function notation has just as much of a problem with the fact that some people have no sister at all as with those who have multiple. Sure, you can make a function out of it by explicitly restricting the domain (which is good, it's important to teach that the domain of a function must be specified), but then it's just as natural to just say the domain is the set of persons who have exactly one sister, as to say it's the set of people who have a sister. Which is begging the question. May 4, 2022 at 9:45
• @leftaroundabout Isn't that the point of the question?! May 4, 2022 at 12:30
• @user253751 the OP doesn't seem to be clear himself what's the point of the question, but I took it to be about mappings that always maps $x$ to... something, but not a unique specific something. Whereas a relation doesn't in general do any map ​ping at all. May 4, 2022 at 15:05
• This is still a function. Using the definition "a function from a set X to a set Y assigns to each element of X exactly one element of Y," this simply means that the elements in your example Y are themselves sets. May 4, 2022 at 17:39
• @TechInquisitor You've just shown that you can create a function out of any relation. But that doesn't make the concept 'relation' the same as 'function'. A relation between $A$ and $B$ is a subset of ${A\times B}$. A function is a relation where there is at most one pair for any element in $B$. May 4, 2022 at 22:26

An example that should be natural to the students is the square root over the positive real numbers. If one simply says "square root of $$4$$" then there are two equally nice roots, $$2$$ and $$-2$$. We make this a function when we prescribe a recipe to choose one of them (typically, "pick the positive one").

• What I like about this one is that it also sets up some nice intuitions about how inverse functions work (by flipping x and y of a given curve), and how some functions just aren't strictly invertable - because even well understood functions like x^2 break this map-to-one rule after flipping about the diagonal. May 4, 2022 at 9:21
• +1 and thanks for specifying that one must verbally say "square root of" (as opposed to using the radical symbol). May 4, 2022 at 13:53
• Or fourth root, sixth root, or any other even numbered root. It may be interesting to show that this rule does not follow for odd numbered roots. May 5, 2022 at 19:19
• @DarrelHoffman: Ah, but then in the complex plane, it applies to all roots (other than the first root, I suppose). You just can't see it from the real line, because the non-principal roots are all complex numbers. May 6, 2022 at 22:01

Given points $$P = \{x_1,x_2,\ldots \}$$ on a line $$L$$, let $$nn(x)$$ for $$x \in L$$ be the nearest neighbor to $$x$$: the point in $$P$$ closest to $$x$$. For most $$x$$, there is a unique $$nn(x)$$, but if $$x$$ is the midpoint of two consecutive points of $$P$$ on $$L$$, then there is a tie.

Generalizing to points ("sites") $$P$$ on a plane leads to the Voronoi diagram: most points $$x$$ have a unique nearest neighbor, points on a Voronoi edge have two equally nearest neighbors, a point at a Voronoi vertex of degree $$k$$ has $$k$$ equally nearest neighbors. So "exactly one" is the default, but there are important exceptions. (Image from Caio M R de Oliveira thesis, Appendix A.)

I’ll give a purely mathematical example that I often used with students beyond the elementary calculus level. (See last paragraph below regarding college algebra and precalculus level students.) At this level students will be encountering situations where they have to show (or be able to understand proofs) that certain definitions of a function are well defined (sometimes one says “give a well defined function”). Examples of this arise when working with quotient groups and quotient rings, when defining the group operation for the fundamental group in topology, when working with congruence classes in number theory, in various places in differential geometry (example 1 and example 2 and example 3), etc. Incidentally, while looking up these links I found the MSE question well-defined functions, which discusses the same type of example given below, and even has aspects very similar to my Observation (2) below, despite my having written that before seeing this other discussion.

Let $$p$$ and $$q$$ be integers, one or both nonzero if necessary.

Let $$f$$ be the “function” from the rationals to the integers defined by $$f\left(\frac{p}{q}\right) = pq,\;$$ or some variation such as $$\;=p+q\;$$ or $$\;=p^2 – q.$$ Incidentally, simplest would be to use $$\;=p\;$$ or $$\;=q,\;$$ but I think using a slightly more involved formula works better, especially when Observation (2) below is dealt with.

Note that $$\frac{1}{2} = \frac{2}{4} = \frac{3}{6},$$ but the formula for $$f$$ gives different outputs for these different representations of the number "one-half". Therefore, there is not a unique output for each input.

I can think of two useful observations that one can make with this example. Observation (1) Using a simple mathematical formula that otherwise seems unproblematic is not enough—the nature of the actual input elements matters. Specifically, we see that the distinction between a representation of the number “one-half” and the number itself actually matters. Observation (2) The “functionality” issue for this example can be investigated in the same way that is done in the actual situations that students will encounter, namely by showing that the output is independent of the choice of representation of the input. Specifically, the representations $$\frac{p}{q}$$ and $$\frac{p’}{q’}$$ correspond to the same number if and only if there exists $$k \neq 0$$ such that $$p’ = kp$$ and $$q’ = kq.$$ Thus, to be well defined (sometimes one says “single-valued” at this point), we require $$f\left(\frac{p}{q}\right) = f\left(\frac{p’}{q’}\right),$$ which is equivalent to the requirement that $$pq = p’q’ = (kp)(kq) = k^2pq.$$ However, because $$k^2 \neq 1$$ is possible, $$f$$ is not well defined.

Note that if we define $$g\left(\frac{p}{q}\right) = \frac{p^2 \; + \; q^2}{pq},$$ then $$g$$ is a function from the nonzero rationals to the rationals. One way to see this, which corresponds to using the approach of Observation (1) above, is to note that $$\frac{p^2 \; + \; q^2}{pq} = \frac{p}{q} + \frac{q}{p},$$ and thus we are actually dealing with the function $$g(x) = x + \frac{1}{x}$$ for nonzero rationals $$x.$$ Another way to see this, which corresponds to using the approach of Observation (2) above (this is what is typically done in practice in the case of quotient groups, the fundamental group operation, etc.), is to note that

$$f\left(\frac{p'}{q'}\right) \; = \; f\left(\frac{kp}{kq}\right) \; = \; \frac{k^2p^2 + k^2q^2}{kp \cdot kq} \; = \; \frac{k^2(p^2 + q^2)}{k^2pq} \; = \; \frac{p^2 + q^2}{pq} \; = \; f\left(\frac{p}{q}\right)$$

These examples can also be used at the college algebra and precalculus level, and I’ve done this. I like to think of pictures with arrows and tables as a “right brain” approach and something like $$f\left(\frac{p}{q}\right) = pq$$ as a “left brain” approach. Of course, while some students at this level will be intrigued with the approach of Observation (1) above for $$f\left(\frac{p}{q}\right) = pq$$, you’ll definitely want to stay away from the symbolism involved in the approach of Observation (2).

• Can I ask why this needs to be "beyond the elementary calculus level"? This seems to involve just elementary operations. Maybe "elementary algebra" was meant, something else? May 4, 2022 at 6:14
• @Eric Duminil: No, you're not missing anything. I'm on my way "out the door" right now, so I'll fix this later. Also, the writing is a bit wandering and likely difficult for non-native speakers to parse (this was written perhaps too hurriedly yesterday), so this will allow me to clean things up a bit in regards to readability. May 4, 2022 at 11:44
• @Eric Duminil: A longer than expected hospital procedure for someone (not me) kept me from fixing this sooner, but it's taken care of now. May 6, 2022 at 7:44

A classic example, and perhaps the reason that people started thinking about "multivalued functions" in the first place:

Try to define

$$\theta(x,y) = \displaystyle\int_{(1,0)}^{(x,y)} \frac{-y \textrm{ d}x + x\textrm{ d}y}{x^2+y^2}$$

where you are integrating along any path from $$(1,0)$$ to $$(x,y)$$. This gives the measure of "the angle" connecting $$(1,0)$$, $$(0,0)$$, and $$(x,y)$$. Unfortunately there is no "the angle": the angle is only well defined up to multiples of $$2\pi$$, and the value of this integral will differ by multiples of $$2\pi$$ depending on the path taken.

Another "real life" example is "result of throw of a die" (namely, from one to six pips).

• That seems like the canonical example of a "random variable", which is formally defined as a type of function per Wikipedia, where the domain is possible outcomes, and the range is associated probability measures. May 8, 2022 at 8:48
• @DanielR.Collins, heh, perhaps yes, but what's the domain? The range? :) The graph? :) May 8, 2022 at 16:06
• I just said the domain is the possible outcomes, the range the probability measures. The graph is here. In counterpoint, I'm not sure what you meant for domain/range in your answer. May 8, 2022 at 18:16
• @DanielR.Collins, well, yes, in that formalization... but/and my point is that viewing the result of the throw of the die as the "output", which has some plausibility to it, does not fit... Anyway, indeed, this is not relevant for novices! :) May 8, 2022 at 18:39
• @DanielR.Collins, ... only that if we try to make "outcome of the throw of a die" be a function with "output" the number of pips facing upward, it is difficult to make it work. Yes, I agree, the definition of "random variable" is very clever, and does make it into a genuine function, but I think not in the way that a person might anticipate. :) May 9, 2022 at 22:23

If you are also teaching sets, or a student brings this up, consider the mapping from sets to their elements:

$$f(\{1, 2\}) = 1\\f(\{1, 2\}) = 2$$

So this is not a function. On the other hand, there is a function that maps singletons to their respective element:

$$f(\{x\}) = x$$

Trying to assemble the outputs into a set would miss the whole point of the mappings.

(On a side note, if someone brings up the idea that a non-functional mapping is just a function to a set, I think I would try to make clear that this changes what we're talking about. When I ask them, "Who is your friend?", they may have more than one answer; they most likely won't respond like "It's the set of Anna and Bob." It's not the set that is their friend. Asking "What's the set of your friends" is a different question. – There may, of course, very well be a function from your students to their best friend.)

As you are teaching to students in a classroom, and presumably they are not your only students nor you their only teacher, a variety of mappings between the teachers, students, classes, and rooms become available to illustrate which can be functions and which are not:

• One $$teacher_{math}$$ maps to many students

• One student maps to many $$teacher_{subject}$$

• Many students map to many $$teacher_{departments}$$

• One $$class_{math}$$ may map to one or multiple rooms

and so on.

Ideally the actual examples are chosen to reflect specific points you want to convey, and may depend on the context of your own institution (or a specific choice of institutions, whether real or invented) to do this clearly.

Map each country to their official languages. This might look like a (not injective) function depending on which countries you start out with but there are definitely countries with more than one official language.

A confidence, tolerance, or predictive interval maps data to a range.

Note that there are additional lessons here because there are an infinite number of confidence intervals. Any function that covers the issue of interest at least $$1-\alpha$$ percent of the time is a valid interval. For example, if you throw a penny to the bottom of a pool and blindfold somebody and give them directions based on an interval to find the penny, the entire swimming pool is the trivial 100% interval as you know it is in there with probability one. It is also a 95% interval since it covers it at least 95% of the time.

That is ambiguous. It does not cover it 95% of the time. It covers it at least 95% of the time because it covers it 100% of the time.

Most intervals, except exact intervals, are a range built on a minimax utility function. You are guaranteed that it works at least $$1-\alpha$$ percent of the time. In fact, the interval maps to a probability region instead of a point. $$\Pr(\theta\in[a,b])\ge{1-\alpha},\forall{x_1,x_2,x_3}\dots{x_n}\in\chi,$$ where $$\chi$$ is the sample space.

It gets a little wilder too. All samples that share the same sample statistics, share the same interval. The data is mediated by estimators, so an interval is actually $$g(h(x_1,x_2,\dots,x_n))$$, where $$h$$ is an estimator(s) chosen under some rule and $$g$$ is a mapping rule. If $$h(X)=h(X')$$, then $$[a,b]$$ is the interval for both sample $$X$$ and sample $$X'$$.

If you want to get wilder, the definition of a Frequentist interval is a bit wild. A 95% confidence interval does not imply that there is a 95% chance the real parameter is inside the interval. What it does say is that if you built an infinite number of intervals, at least 95% of the intervals would cover the parameter. It says nothing about the current experiment's chance of covering the parameter.

A function can usually be thought of as having an output with a clear meaning. That isn't a clear meaning. You toss in 50 apples and you get one jar of applesauce. Here, you toss in a group of inputs and you do not get an output that says the solution is somewhere around "here". You get an output that says the function works at least some amount of time and is broken, maybe even nonsense, at other times. The answer isn't necessarily in the range, but it is wise to act as if it is. If it isn't, you may look like a fool. However, you will never be a fool more than $$\alpha$$ percent of the time.

Maybe your students don't yet know this (but it might be instructive to revisit this when it comes up):

The indefinite integral (antiderivative) can be considered a map from functions to functions, but of course the result is not a single function - that's just the point of the $$+c$$ in $$\int x\, \text{d}x =\frac12 x^2+c$$.

I found this example in "Finite Mathematics" by Rolf:

When Sarah buys six apples ($$x=6$$), the checker determines the weight in order to know the cost. The six apples of the customer behind Sarah likely will correspond to a different weight. Thus the weight "function" of $$x$$ apples is not a function of the number of apples because a number in the domain (number of apples) may be related to more than one number in the range (weight of $$x$$ apples).

I think this is a pretty intuitive example of a relation/map not being well-defined.

Rolf actually goes a bit further pointing out that, likewise, cost is not a function of the number of apples since the price is usually by weight. So there's a natural comparison to "Cost of $$x$$ apples" not being well-defined, but something like "Cost of $$x$$ candy bars" is.

Let $$p(x,y)$$ be a two-variable polynomial (or really any function of two variables). Set $$a R b$$ if $$p(a,b) = 0$$. This is a binary relation that typically is not a function.

Example: $$p(x,y) = x^2 - 2y^2 - 1$$. Finding integers $$a$$ and $$b$$ where $$a R b$$ amounts to finding integral solutions to a Pell equation.

Look up “correspondences” in algebraic geometry to see that this kind of relation is used in math.

I just think of graphs, rather than input-output machines. A circle is a relation. xsq + ysq = rsq. Gives you more than one y, for a given x. [provided |x| is <r.]

Lot's of good graphs to draw of equations that aren't functions. I think mentioning something like that is useful as it's something dwelt on so much in geometry and algebra 2 class and is familiar to the students. Rather than torturing so much with input-output machines.

I think sometimes people here get so pro function that they forget all the wonderful relations, allowed to be relations. Like graphing inverse trig functions. The inverse of the trig function is not a function. It's a relation. There are multiple possible y values, because of how periodicity works. Which is fine. Relations exist, too.