To express a relation as a set of ordered pairs, write each input with its matching output inside parentheses in the order (input, output), then collect all of them inside braces and remove duplicates. For the relation "is the capital of" applied to France and Japan, that gives {(France, Paris), (Japan, Tokyo)}. Order inside a pair is fixed by position; order among pairs is not.
The boundary matters more than most textbooks admit. A relation is any set of ordered pairs drawn from A Γ B, so a rule that leaves one input unmatched, or pairs one input with two different outputs, is still perfectly valid. Only a function adds the extra restriction that no first coordinate repeats with a different second. Get that distinction wrong and half the exercises on this topic go sideways.
What an ordered pair actually encodes before you write any set
An ordered pair is two objects in a fixed slot arrangement, where (3, 5) and (5, 3) are different pairs. The first coordinate comes from the domain and the second from the codomain, and swapping them changes the mathematical object entirely. That is the whole reason the word "ordered" sits in the name.
Textbooks usually define a relation from set A to set B as any subset of the Cartesian product A Γ B. If A = {1, 2, 3} and B = {4, 5}, then A Γ B contains six pairs: (1,4), (1,5), (2,4), (2,5), (3,4), (3,5). Any collection you pull from that list, including the empty collection, is a relation. The Cartesian product itself is the largest relation possible from A to B.
Leonhard Euler's 1748 Introductio in analysin infinitorum is often credited with early systematic use of function notation, while the modern set-theoretic treatment of relations arrived with Giuseppe Peano and later Ernst Zermelo's axiomatization around 1908. You do not need the history to solve problems, but it explains why relations and functions share notation while obeying different rules.
A quick test keeps you honest: count your pairs against the size of A Γ B. If you produce more pairs than |A| Γ |B|, you have duplicated something, because a set cannot hold the same element twice. That single arithmetic check catches most beginner errors before a teacher ever sees them.
The five-step procedure: how to express a relation as a set of ordered pairs
This is the working method I would hand someone stuck on homework tonight. It applies to tabular data, arrow diagrams, equations, and word problems alike, and it fails gracefully because step 5 forces you to re-read the original description.
1: Identify the domain set A and the codomain set B, or state plainly which quantity is the input and which is the output. 2: Read one link at a time from the source β a row in a table, an arrow in a diagram, an input plugged into a formula β and write it as (input, output) in that exact order. 3: Repeat for every link described, including repeated outputs, because two different inputs may legally share one output. 4: Collect every pair inside curly braces and delete exact duplicates, since a set lists each element once. 5: Test the result against the original description by counting pairs and checking that no pair falls outside A Γ B.
Suppose a school club pairs four students with their project mentors. A table shows Amara β Delgado, Ben β Okonkwo, Chen β Delgado, and Dara β Ferreira. Reading down gives {(Amara, Delgado), (Ben, Okonkwo), (Chen, Delgado), (Dara, Ferreira)}. Delgado appearing twice is not an error, because two students can share a mentor; if the task said "one mentor per student, one student per mentor," you would have a matching instead, and the pair set would need adjusting.
The failure handling lives in step 5. If the count of pairs exceeds the product of set sizes, stop and hunt for a duplicate you failed to delete. If a pair uses an element never listed in A or B, either the domain statement is incomplete or you misread a row β check the original before touching the answer.
Reading arrow diagrams and tables without losing a pair
Arrow diagrams are the most common source of silent mistakes, because the eye skips arrows when several originate from one node. Work node by node, left to right, and finish each source before moving on. A diagram with arrows 1 β 7, 1 β 9, and 2 β 9 yields {(1, 7), (1, 9), (2, 9)} β three pairs, not two.
Tables work best when you assign the left column as the first coordinate. State that convention out loud once, then never flip it mid-problem. A table listing x-values 0, 1, 2 against y-values 3, 5, 7 produces {(0, 3), (1, 5), (2, 7)}. Reverse the convention and you get a different relation with different properties, which is why teachers mark coordinate order so aggressively.
Databases offer the same structure at industrial scale. In relational algebra, a table is a set of tuples, and a tuple is just an ordered n-tuple β the same object you are writing for two columns. Edgar Codd's 1970 paper on relational data models formalized this, and it is why a two-column table of employee IDs and department IDs maps one-to-one onto a set of ordered pairs. The difference is that SQL tables can hold duplicate rows unless you declare a key, while mathematical sets cannot.
For a large table, build a scratch list of pairs first and convert to set notation last. Writing braces too early tempts you to skip an entry, and re-scanning a 20-row table for one missing pair costs more time than the extra pass ever saves.
When one input pairs with two outputs: relations that are not functions
This is the edge case that separates a passing answer from a correct one. A relation may map one input to several outputs. The rule that forbids repeated first coordinates applies to functions alone, so a relation like {(2, 4), (2, 9), (5, 1)} is legitimate and simply is not a function.
| Relation | Domain | Range | Function? | Why |
|---|---|---|---|---|
| {(3, 6), (4, 8), (5, 10)} | {3, 4, 5} | {6, 8, 10} | Yes | Each input appears once |
| {(1, 2), (1, 5), (3, 4)} | {1, 3} | {2, 4, 5} | No | Input 1 pairs with both 2 and 5 |
| {(2, 7), (4, 7), (6, 7)} | {2, 4, 6} | {7} | Yes | Repeated outputs are allowed |
| {(8, 1), (8, 2), (8, 3)} | {8} | {1, 2, 3} | No | One input, three outputs |
The vertical line test in coordinate geometry is the graphical version of this rule: if a vertical line crosses a graph more than once, the same x-value has two y-values and the graph is not a function. That test answers a question about functionhood, never about whether the relation exists.
Repeated outputs deserve a note too. {(2, 7), (4, 7), (6, 7)} is a constant function, and the range collapses to a single element even though the domain has three. Many students assume three pairs must mean three range values; the table above shows otherwise, and that mistake shows up on almost every quiz covering this unit.
Domain and range from the pair list, and the one aggregation step students forget
Reading the domain and range off a pair set is direct: the domain is the set of all first coordinates, the range is the set of all second coordinates, and each of them is a set, so duplicates collapse. For {(0, 3), (1, 5), (2, 7), (2, 9)}, the domain is {0, 1, 2} and the range is {3, 5, 7, 9}.
If the relation is given by an equation, you cannot list pairs until you restrict the domain, so state the restriction explicitly. For y = xΒ² β 1 over the integers from β2 to 2, the pairs are {(β2, 3), (β1, 0), (0, β1), (1, 0), (2, 3)}. Notice the range: {β1, 0, 3}, three values, not five, because 0 and 3 each repeat. That is the aggregation step people forget β range values are collected, not counted.
Over the real numbers, that same equation produces infinitely many pairs that cannot be listed one by one. The standard move is to describe the relation as { (x, xΒ² β 1) : x β β }, a set-builder form that stays valid where roster notation fails. Knowing when to switch is part of the skill, and most rubrics award marks for the switch itself.
Domain restrictions from graphs follow the same logic. A semicircle of radius 3 centered at the origin gives pairs (x, y) with xΒ² + yΒ² = 9 and y β₯ 0, so the domain is [β3, 3] and the range is [0, 3]. Interval brackets, not braces, because the values are continuous.
Inverse relations: swap every pair and watch the domain move
The inverse of a relation is the set you get by swapping the coordinates of every pair. If R = {(1, 4), (2, 5), (3, 6)}, then Rβ»ΒΉ = {(4, 1), (5, 2), (6, 3)}. Every pair is legal, and the domain of Rβ»ΒΉ equals the range of R β a fact that answers half of all inverse-relation questions.
The function question changes under inversion. R above is a function, and so is Rβ»ΒΉ, because no first coordinate repeats in either list. But take {(1, 2), (3, 2)}: a valid function with repeated output 2. Its inverse, {(2, 1), (2, 3)}, has input 2 paired with two outputs, so the inverse fails to be a function. That is exactly why textbooks tell you a function has an inverse function only if it is one-to-one.
Graphically, an inverse mirrors the original across the line y = x, so a horizontal line test on the original becomes a vertical line test on the inverse. A parabola opening upward fails the horizontal test, its inverse fails the vertical test, and restricting the parabola to x β₯ 0 repairs both at once.
Word problems sometimes disguise this. "Each book is assigned a shelf, and shelf 4 holds books A and B" describes a relation whose inverse maps each shelf to its books β valid as a relation, invalid as a function. Same pair set, different question, different answer.
Worked example from a rule: turning a sentence into roster notation
Word descriptions are the version of this task that trips people up most, because nothing is pre-labeled. Take this: "A taxi charges a flat 3-dollar base plus 2 dollars per mile, and the fare relation pairs each whole-mile count from 0 to 4 with its total fare." The input is miles, the output is fare, and the formula is 3 + 2m.
Compute one value at a time with the order fixed. At m = 0 the fare is 3, giving (0, 3). At m = 1 it is 5, at m = 2 it is 7, at m = 3 it is 9, and at m = 4 it is 11. The full relation is {(0, 3), (1, 5), (2, 7), (3, 9), (4, 11)}, with domain {0, 1, 2, 3, 4} and range {3, 5, 7, 9, 11}.
Now check the function test. Every mile count appears once, so this is a function. If the description instead said "from 0 to 4 miles, rounded down to the nearest whole mile," then miles 1.2 and 1.7 would both pair with fare 5, and the pair set over all real inputs would contain infinitely many pairs sharing first coordinates β a relation, not a function on that domain.
The arithmetic also serves as a self-check on the set. With a base fare of 3 and a per-mile rate of 2, consecutive outputs must differ by exactly 2. If your list jumps from 7 to 10, the mistake is in the computation, not the notation.
Set-builder notation and the infinite relations roster form cannot hold
Roster notation fails the moment the relation is infinite, and infinite relations are the norm once you leave finite sets. Set-builder form handles them by stating the rule inside the braces: R = { (x, y) β β Γ β : y = 2x + 1 } describes a straight line with infinitely many pairs, each one satisfying the stated equation.
The parts matter. The left side declares the shape of the pair and the universe it comes from; the colon reads "such that"; the right side is the condition. Drop the universe and you can get nonsense, since y = 2x + 1 over the integers gives a dotted scatter of pairs rather than a line.
Converting between forms is routine once you have a rule. From {(x, y) : y = x β 4, x β {5, 6, 7}} you can list (5, 1), (6, 2), (7, 3) because the domain is finite. From the infinite set {(x, y) : y = x β 4, x β β} you cannot list anything, and attempting partial lists is the most common way students lose marks.
Interval notation appears alongside set-builder when the relation's domain is continuous, and the two must agree. A relation defined for 0 β€ x < 5 has domain [0, 5) β square bracket for included, parenthesis for excluded β and the pair set is written with that same condition. Mismatch between the stated domain and the domain implied by the pair set is a graded error in most syllabi, including the Cambridge International AS and A Level Mathematics syllabus, whose algebra content covers relations and functions explicitly (confirm the current edition on Cambridge's site, since syllabi revise on a rolling cycle).
Checking your answer before you submit it
Four checks catch nearly every error, and none of them takes more than a minute. Run them in order, because the cheapest failures surface first.
1: Count check. Pairs in your set must not exceed |A| Γ |B|. If A has 4 elements and B has 3, the maximum is 12 pairs; a 13-pair answer has a duplicate. 2: Slot check. Confirm every first coordinate comes from the stated domain and every second from the codomain. Any outsider means a reading error. 3: Duplicate check. Scan the first coordinates. If the task asked for a function and any first coordinate appears twice with different outputs, one of the pairs is wrong or the relation is not a function. 4: Reversal check. Reread the original sentence and see whether swapping a pair would still match it. If it would, you likely had the coordinate convention backwards.
A quick independent cross-check helps with equations: pick two pairs and substitute both coordinates into the formula. For y = 3x β 1, the pair (2, 5) passes because 3(2) β 1 = 5; a pair like (2, 6) fails immediately. Verification by substitution is faster than re-deriving the entire list.
If your answer disagrees with a classmate's, compare the domains first. Most disagreements on this topic trace back to one person reading the left column as output and the other reading it as input, and the pair sets will look plausible both ways until you check the source.
FAQ
Can a relation be a set of ordered pairs with repeated second coordinates?
Yes. Repetition among second coordinates never invalidates a relation β only first-coordinate repetition with different partners blocks a relation from being a function. The set {(1, 5), (2, 5), (3, 5)} is a function whose range contains exactly one element, 5. Containment in A Γ B is the only membership requirement.
What is the difference between a relation and a function, in one sentence?
A function is a relation in which every input has exactly one output, so the extra rule is a uniqueness condition on first coordinates, not a condition on outputs. Every function is a relation; a relation like {(2, 4), (2, 9)} is not a function. Textbooks state this as the vertical line test on graphs.
How many ordered pairs does the empty set of pairs represent?
The empty set counts as a relation from any A to any B, since the empty set is a subset of every Cartesian product. It has zero pairs, an empty domain, and an empty range. Some courses treat the empty relation as a technical edge case rather than a practical example, so confirm your instructor's convention before using it in an answer.
Is it possible to have 4 ordered pairs from a domain of 2 elements and a codomain of 2 elements?
With |A| = 2 and |B| = 2, the Cartesian product holds 2 Γ 2 = 4 pairs, so a relation with 4 distinct pairs must be the entire product A Γ B. Any fifth pair would be a duplicate or would fall outside the product. This total exactly demonstrates why the count check in step 5 works.
What does the notation {(x, y) : y = 2x} mean in plain English?
It reads as the set of all ordered pairs where the second coordinate is twice the first, drawn from whatever universe the problem states. If the universe is the real numbers, the set describes a straight line through the origin with infinitely many pairs. Without a stated universe, the notation is incomplete and the answer is ambiguous.
How do you express the relation "is a factor of" on the set {1, 2, 3, 6} as pairs?
List every pair (a, b) where a divides b without remainder: (1, 1), (1, 2), (1, 3), (1, 6), (2, 2), (2, 6), (3, 3), (3, 6), (6, 6). That is nine pairs, and 1 appears as first coordinate four times, so the relation is not a function. Divisibility relations are the standard classroom example of a relation that never becomes a function.
Does the order of the pairs inside the braces change the relation?
No. Sets ignore arrangement, so {(1, 2), (3, 4)} and {(3, 4), (1, 2)} are the same relation. Order matters only inside each pair, where (1, 2) and (2, 1) are different. Some teachers accept any listing order, but coordinate order inside a pair is never negotiable.