From Possible Pairings to Actual Relationships

In the previous lesson on Cartesian products, we built the set of every possible ordered pairing between two sets.

If

\[ A=\{1,2,3\} \]

and

\[ B=\{a,b\}, \]

then

\[ A\times B = \{ (1,a),(1,b), (2,a),(2,b), (3,a),(3,b) \}. \]

But many real situations do not use every possible pairing. Perhaps \(1\) is related to \(a\), \(2\) is related to \(a\), and \(3\) is related to \(b\). Then the actual relationship is

\[ R=\{(1,a),(2,a),(3,b)\}. \]

Because every pair in \(R\) belongs to \(A\times B\),

\[ R\subseteq A\times B. \]

That is the central idea of a relation:

\[ \boxed{\text{A relation is a set of ordered pairs.}} \]

Review of Ordered Pairs

An ordered pair has the form

\[ (a,b). \]

The first component and second component have different roles. For that reason,

\[ (a,b)\neq(b,a) \]

in general. For example,

\[ (2,5)\neq(5,2). \]

Two ordered pairs are equal exactly when their corresponding components match:

\[ (a,b)=(c,d) \iff a=c \text{ and } b=d. \]

That positional structure is what makes ordered pairs useful for recording relationships.

What Is a Relation?

A relation from \(A\) to \(B\) is any subset of the Cartesian product

\[ A\times B. \]

Symbolically,

\[ \boxed{R\subseteq A\times B}. \]

Each ordered pair in \(R\) records one relationship.

For example, let

\[ A=\{\text{Alice},\text{Ben},\text{Cara}\} \]

and

\[ B=\{\text{Math},\text{Physics},\text{Biology}\}. \]

Suppose the relation “is enrolled in” is

\[ R= \{ (\text{Alice},\text{Math}), (\text{Alice},\text{Physics}), (\text{Ben},\text{Biology}), (\text{Cara},\text{Math}) \}. \]

Each pair tells us that the person in the first position is enrolled in the course in the second position. The pair

\[ (\text{Alice},\text{Math}) \]

means something different from

\[ (\text{Math},\text{Alice}). \]

The order preserves the direction of the relationship.

Relation Notation

If

\[ (a,b)\in R, \]

we may say that \(a\) is related to \(b\) by \(R\). A common compact notation is

\[ aRb. \]

This means exactly the same thing as

\[ (a,b)\in R. \]

Example

Suppose \(R\) is the relation “is less than” on the integers. Then

\[ 3R7 \]

means

\[ 3<7. \]

Equivalently,

\[ (3,7)\in R. \]

Relation notation allows us to move between the language of ordered pairs and more familiar mathematical symbols.

Domain and Range

For a relation, the domain is the set of first components that actually appear in the relation. The range is the set of second components that actually appear.

Suppose

\[ R=\{(1,a),(1,b),(3,b),(4,c)\}. \]

Then the domain is

\[ \operatorname{Dom}(R)=\{1,3,4\}, \]

while the range is

\[ \operatorname{Ran}(R)=\{a,b,c\}. \]

Unused Elements

Suppose the relation was originally defined from

\[ A=\{1,2,3,4\} \]

to

\[ B=\{a,b,c,d\}. \]

The element \(2\) belongs to \(A\) but does not appear as a first component. Therefore,

\[ 2\notin\operatorname{Dom}(R). \]

Likewise, \(d\in B\), but

\[ d\notin\operatorname{Ran}(R). \]

So the domain and range of a relation may be smaller than the original sets used to define the Cartesian product.

Ways to Represent a Relation

The same relation can be represented in several different forms.

1. Set of Ordered Pairs

\[ R=\{(1,2),(2,4),(3,6)\}. \]

2. Table

First Component Second Component
\(1\)\(2\)
\(2\)\(4\)
\(3\)\(6\)

3. Mapping Description

We can describe the same relation verbally as

\[ 1\to2, \qquad 2\to4, \qquad 3\to6. \]

4. Graph

If the components are numbers, each ordered pair can be plotted as a point in the coordinate plane. The relation

\[ R=\{(1,2),(2,4),(3,6)\} \]

becomes three plotted points.

5. Rule or Condition

The same pattern can be extended by the condition

\[ R= \{(x,y)\in\mathbb{R}^2\mid y=2x\}. \]

This version contains infinitely many ordered pairs, not just the three listed above.

These representations are different views of the same basic idea:

\[ \boxed{\text{a relation is a collection of ordered pairs}} \]

Inverse Relations

The inverse relation reverses every ordered pair.

If

\[ R=\{(1,a),(2,b),(3,b)\}, \]

then

\[ R^{-1} = \{(a,1),(b,2),(b,3)\}. \]

Formally,

\[ \boxed{ R^{-1} = \{(b,a)\mid(a,b)\in R\} } \]

The inverse relation reverses the direction of the relationship.

Domain and Range Switch Roles

\[ \operatorname{Dom}(R^{-1}) = \operatorname{Ran}(R) \]

and

\[ \operatorname{Ran}(R^{-1}) = \operatorname{Dom}(R). \]

Real-Life Interpretation

Suppose \(R\) means “employee works on project.” Then \(R^{-1}\) means “project has employee assigned.”

The underlying connection is the same, but its direction has been reversed.

Relations on a Single Set

A relation can connect elements of a set back to elements of the same set. A relation on \(A\) is a subset of

\[ A\times A. \]

For example, let

\[ A=\{1,2,3\}. \]

The relation “is less than” on \(A\) is

\[ R=\{(1,2),(1,3),(2,3)\}. \]

Each ordered pair records a true comparison within the same set.

Another Example

The relation “has the same parity as” on

\[ A=\{1,2,3,4\} \]

includes pairs such as

\[ (1,3), \qquad (2,4), \qquad (3,1), \qquad (4,2), \]

along with

\[ (1,1), \qquad (2,2), \qquad (3,3), \qquad (4,4). \]

Relations on a single set will become important when we study structural properties such as reflexivity, symmetry, and transitivity.

A Preview of Relation Properties

Some relations have recognizable structural patterns. We will study these carefully in later lessons, but it is useful to see the basic ideas now.

Reflexive

A relation on \(A\) is reflexive when every element is related to itself:

\[ (a,a)\in R \]

for every \(a\in A\).

Symmetric

A relation is symmetric when reversing a related pair produces another related pair:

\[ (a,b)\in R \implies (b,a)\in R. \]

Transitive

A relation is transitive when

\[ (a,b)\in R \]

and

\[ (b,c)\in R \]

together imply

\[ (a,c)\in R. \]

These properties help classify relations by their internal structure.

Relations versus Functions

Every function is a relation, but not every relation is a function.

A general relation may connect one first component to several second components. For example,

\[ R=\{(1,a),(1,b),(2,c)\} \]

is a perfectly valid relation.

The input \(1\) is related to both \(a\) and \(b\).

A function imposes a stricter requirement:

\[ \boxed{\text{Each allowed input must have exactly one output.}} \]

Therefore the relation above would not qualify as a function from its domain to its range.

This distinction is central:

\[ \boxed{\text{relation}=\text{allowed pairings}} \] \[ \boxed{\text{function}=\text{allowed pairings with a uniqueness rule}} \]

Practical Applications

Employees and Projects

Let \(E\) be the set of employees and \(P\) the set of projects. The relation

\[ R\subseteq E\times P \]

can represent actual employee-project assignments. One employee may appear in several pairs because an employee may work on several projects.

Students and Courses

If \(S\) is the set of students and \(C\) is the set of courses, then

\[ R\subseteq S\times C \]

can model enrollment. The domain contains students enrolled in at least one course, and the range contains courses with at least one enrolled student.

Road Networks

Let \(C\) be a set of cities. A relation on \(C\) could say that one city has a direct road connection to another. If the roads work in both directions, the relation may be symmetric.

Social Networks

A relation on a set of users may represent:

Databases

Relational databases are built around relationships among records. For example, an order record may be connected with a customer record and several product records.

The practical database implementation is more elaborate, but the underlying mathematical idea remains a structured relationship among objects.

Worked Examples

Example 1: Is It a Relation?

Let

\[ A=\{1,2,3\} \]

and

\[ B=\{x,y\}. \]

Consider

\[ R=\{(1,x),(2,y),(3,x)\}. \]

Every ordered pair belongs to \(A\times B\), so

\[ R\subseteq A\times B. \]

Therefore \(R\) is a relation from \(A\) to \(B\).

Example 2: Domain and Range

Let

\[ R=\{(2,5),(2,7),(4,7),(8,9)\}. \]

The domain is

\[ \operatorname{Dom}(R)=\{2,4,8\}. \]

The range is

\[ \operatorname{Ran}(R)=\{5,7,9\}. \]

Repeated appearances are listed only once because domain and range are sets.

Example 3: Inverse Relation

Let

\[ R=\{(1,4),(2,5),(3,5)\}. \]

Reverse every pair:

\[ R^{-1} = \{(4,1),(5,2),(5,3)\}. \]

Example 4: Relation Defined by a Rule

Define a relation on the integers by

\[ aRb \iff aThen

\[ 2R5 \]

is true because

\[ 2<5. \]

But

\[ 5R2 \]

is false. So this relation is not symmetric.

Example 5: Relation versus Function

Consider

\[ R=\{(1,a),(1,b),(2,c)\}. \]

This is a relation, but it is not a function because the first component \(1\) is paired with two different second components.

Example 6: Graph as a Relation

Consider

\[ R= \{(x,y)\in\mathbb{R}^2\mid x^2+y^2=25\}. \]

This relation is the circle of radius \(5\) centered at the origin. For example,

\[ (3,4)\in R \]

because

\[ 3^2+4^2=25. \]

Also,

\[ (3,-4)\in R. \]

Thus one \(x\)-value can correspond to more than one \(y\)-value, so the entire circle is a relation but not a function of \(x\).

Common Errors

1. Forgetting That a Relation Is a Set

A relation is not merely a verbal statement. Mathematically, it is a set of ordered pairs.

2. Reversing Ordered Pairs

The pair

\[ (a,b) \]

usually represents a different relationship from

\[ (b,a). \]

3. Confusing the Original Sets with Domain and Range

A relation from \(A\) to \(B\) does not need to use every element of \(A\) or \(B\). The domain and range contain only components that actually occur.

4. Counting Repeated Domain or Range Values Twice

If

\[ R=\{(1,a),(1,b),(2,b)\}, \]

then

\[ \operatorname{Dom}(R)=\{1,2\}, \]

not \(\{1,1,2\}\).

5. Assuming Every Relation Is a Function

Relations may pair one first component with several second components. Functions may not.

6. Confusing \(R^{-1}\) with a Numerical Reciprocal

For a relation,

\[ R^{-1} \]

means reverse every ordered pair. It does not mean divide by \(R\).

Practice

Domain and Range

Let

\[ R=\{(1,4),(1,5),(3,5),(6,8)\}. \]

Find the domain and range.

Check Answer \[ \operatorname{Dom}(R)=\{1,3,6\} \]

and

\[ \operatorname{Ran}(R)=\{4,5,8\}. \]

Inverse Relation

Find the inverse of

\[ R=\{(a,1),(b,2),(c,2)\}. \]
Check Answer \[ R^{-1} = \{(1,a),(2,b),(2,c)\}. \]

Relation Membership

Let

\[ R= \{(x,y)\in\mathbb{Z}^2\mid y=x+2\}. \]

Determine whether each ordered pair belongs to \(R\).

  1. \((1,3)\)
  2. \((4,6)\)
  3. \((2,5)\)
Check Answers
  1. \[ 3=1+2, \] so \[ (1,3)\in R. \]
  2. \[ 6=4+2, \] so \[ (4,6)\in R. \]
  3. \[ 5\neq2+2, \] so \[ (2,5)\notin R. \]

Relation or Function?

Determine whether each relation is also a function.

  1. \[ \{(1,a),(2,b),(3,c)\} \]
  2. \[ \{(1,a),(1,b),(2,c)\} \]
Check Answers
  1. Yes. Every first component is paired with exactly one second component.
  2. No. The first component \(1\) is paired with both \(a\) and \(b\).

The Deeper Idea

A Cartesian product gives us all possible pairings:

\[ A\times B. \]

A relation selects whichever of those pairings satisfy some condition:

\[ R\subseteq A\times B. \]

That condition may describe:

This means relations are a general language for mathematical connection. Functions are not a separate idea appearing from nowhere. They are a specialized kind of relation with additional structure.

\[ \boxed{ \text{sets} \longrightarrow \text{ordered pairs} \longrightarrow \text{relations} \longrightarrow \text{functions} } \]

That progression lets us move naturally from basic set theory into the language used throughout algebra, geometry, discrete mathematics, and analysis.

Summary

Relations formalize the simple idea that one object can be connected to another. Once those connections are encoded as ordered pairs, we can study their structure precisely and build the additional rules that define functions.

Sets, Relations, and Functions