"Isn't a relation just a function where the output can branch?"

The instinct behind the question is good — you are noticing that a function takes an input and gives an output, and a relation takes an input and gives one or more outputs, and those two descriptions feel like the same object with different rules. But "same object with different rules" is exactly what distinguishes a function from a general relation. The rules are the point.

A function is a relation. A general relation is not a function. The word function names a strict sub-kind of relation, and the strictness is what makes functions useful.

The two definitions side by side

Relation

A relation from A to B is any subset R \subseteq A \times B. Given an input a \in A, the set of outputs is \{b \in B \mid (a, b) \in R\} — possibly empty, possibly one element, possibly many.

Function

A function f from A to B is a relation from A to B with two extra conditions:

  1. Totality. For every a \in A, at least one pair (a, b) \in f exists.
  2. Uniqueness. For every a \in A, at most one such b exists.

Put together, totality plus uniqueness say: every input has exactly one output. That single rule is the whole difference.

Why: without uniqueness you cannot write f(a) = b unambiguously — the notation f(a) would not know which b to pick. Functions exist precisely so that f(a) names a single thing.

A small picture that makes the difference visible

Let A = \{1, 2, 3\} and B = \{x, y\}.

Arrow diagrams comparing a function and a non-function relationTwo side-by-side arrow diagrams. The left panel shows a function: each of 1, 2, 3 in set A has exactly one arrow going to either x or y in set B. The right panel shows a non-function relation: element 1 has two arrows (to both x and y), element 2 has no arrow, and element 3 has one arrow to y. function f relation R (not a function) A B 1 2 3 x y A B 1 2 3 x y each input → exactly one output 1 has two outputs, 2 has none
Left: a function — every element of $A$ sends exactly one arrow into $B$. Right: a relation that is not a function — element $1$ has two arrows (uniqueness fails), element $2$ has no arrow (totality fails). Both panels are valid relations; only the left one is a function.

The right-hand picture is a perfectly legal relation. It breaks the function rules in two ways — element 1 relates to both x and y, and element 2 relates to nothing — and either break, by itself, would already disqualify it from being a function.

The vertical-line test is the same idea

You may have seen the vertical-line test in a graphing context: a curve in the xy-plane is the graph of a function y = f(x) only if every vertical line hits the curve at most once. That is exactly the uniqueness condition in disguise. A vertical line at x = a meets the graph at points (a, b) — one point for each output paired with a. If a vertical line hits twice, the relation has sent a to two different b-values, which a function is not allowed to do.

The curve x^2 + y^2 = 1 (a circle) is a relation between x and y, because x = 0 is paired with both y = 1 and y = -1. It is not a function.

An interactive contrast

Slider switching between a function view and a non-function viewA horizontal track with a draggable red point. The readout label above the track changes as the point moves, showing whether the relation on display has at most one output per input (function) or multiple outputs per input (relation only). function zone non-function zone drag to cross the boundary
Drag the red point across the slider. On the left half, the relation under consideration satisfies the function rule: every input has exactly one output. On the right half, the relation fails the rule — some input has two or more outputs — and is therefore a relation but not a function.

What the misconception gets right — and wrong

The instinct behind "a relation is just a function with variable output" has a grain of truth: yes, relations are the bigger umbrella, and yes, functions sit inside that umbrella. But two framings that sound similar in English behave very differently in mathematics:

Why the distinction matters in JEE

Question. Let R = \{(1, 2), (1, 3), (2, 3)\} be a relation on \{1, 2, 3\}. Is R a function from \{1, 2, 3\} to \{1, 2, 3\}?

Answer. No, for two reasons:

  1. Element 1 is paired with both 2 and 3. Uniqueness fails.
  2. Element 3 is paired with nothing. Totality fails.

Either reason alone would disqualify R from being a function. You must check both conditions, not just one.

Why: examiners specifically design relations that break one condition and not the other, to see whether you noticed both must hold. "It's not a function because 1 has two outputs" is a correct reason; missing the 3-has-no-output reason when asked "list all ways this fails the function definition" costs marks.

The one-sentence answer

A relation is a set of ordered pairs. A function is a relation where every input from the source set appears exactly once as a first coordinate. The phrase "function where the output can vary" is a self-contradiction — the moment the output varies, it is no longer a function.

Related: Relations · Functions — Introduction · Ordered-Pair Plotter: Relation on the Grid · What Does (a, b) in R Mean in Real Life?