Skip to main content

Relations

1. Introduction to Relations

A relation is a mathematical way of describing a connection between elements of two sets. It is defined as a subset of the Cartesian product of two sets.

Ordered Pair

An ordered pair is written as

(a,b)(a, b)

where:

  • aa is the first element
  • bb is the second element

Order matters.

Example:

(1,2)(2,1)(1,2) \neq (2,1)

Cartesian Product

For two sets

A={1,2},B={a,b,c}A=\{1,2\}, \qquad B=\{a,b,c\}

their Cartesian product is

A×B={(1,a),(1,b),(1,c),(2,a),(2,b),(2,c)}A \times B=\{(1,a),(1,b),(1,c),(2,a),(2,b),(2,c)\}

If

A=m,B=n|A|=m,\qquad |B|=n

then

A×B=mn|A\times B|=mn

Relation

A relation from set AA to set BB is any subset of the Cartesian product.

RA×BR\subseteq A\times B

Example:

Let

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

Then

R={(1,2),(2,3),(3,1)}R=\{(1,2),(2,3),(3,1)\}

is a relation on AA.

Domain

The domain is the set of all first elements.

If

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

then

Domain(R)={1,2,3}\text{Domain}(R)=\{1,2,3\}

Codomain

The codomain is the target set.

If

R:ABR:A\rightarrow B

then

Codomain=B\text{Codomain}=B

Range

The range is the set of second elements that actually appear in the relation.

Example:

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

Then

Range(R)={a,b}\text{Range}(R)=\{a,b\}

2. Representation of Relations

Relations can be represented in three common ways.

A. Set (Roster) Representation

The relation is written as a collection of ordered pairs.

Example:

R={(1,2),(2,3),(3,1)}R=\{(1,2),(2,3),(3,1)\}

This is the simplest representation.

B. Matrix Representation

Suppose

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

and

R={(1,2),(2,3),(3,1)}R=\{(1,2),(2,3),(3,1)\}

The matrix representation is

MR=[010001100]M_R= \begin{bmatrix} 0&1&0\\ 0&0&1\\ 1&0&0 \end{bmatrix}

where

  • Entry is 1 if the pair exists.
  • Entry is 0 otherwise.

C. Directed Graph (Digraph)

Each element is represented as a vertex.

Each ordered pair

(a,b)(a,b)

is represented by a directed edge

aba\rightarrow b

Example:

For

R={(1,2),(2,3),(3,1)}R=\{(1,2),(2,3),(3,1)\}

the digraph contains

  • 121\rightarrow2
  • 232\rightarrow3
  • 313\rightarrow1

3. Types of Relations

Empty Relation

A relation containing no ordered pairs.

R=R=\varnothing

Universal Relation

A relation containing every possible ordered pair.

R=A×AR=A\times A

Example:

If

A={1,2}A=\{1,2\}

then

R={(1,1),(1,2),(2,1),(2,2)}R=\{(1,1),(1,2),(2,1),(2,2)\}

Identity Relation

A relation containing only pairs where both elements are equal.

I={(a,a)aA}I=\{(a,a)\mid a\in A\}

Example:

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

then

I={(1,1),(2,2),(3,3)}I=\{(1,1),(2,2),(3,3)\}

Inverse Relation

The inverse relation reverses every ordered pair.

If

R={(1,2),(2,3)}R=\{(1,2),(2,3)\}

then

R1={(2,1),(3,2)}R^{-1}=\{(2,1),(3,2)\}

In general,

R1={(b,a)(a,b)R}R^{-1}=\{(b,a)\mid(a,b)\in R\}

Complement of a Relation

The complement contains every ordered pair that is not in the relation.

Rc=(A×A)RR^c=(A\times A)-R

Example:

If

A={1,2}A=\{1,2\}

and

R={(1,1),(2,2)}R=\{(1,1),(2,2)\}

then

Rc={(1,2),(2,1)}R^c=\{(1,2),(2,1)\}

Summary

TopicDefinition
Ordered PairPair of elements where order matters
Cartesian ProductSet of all possible ordered pairs
RelationSubset of Cartesian product
DomainFirst elements of the relation
CodomainTarget set
RangeSecond elements actually used
Set RepresentationCollection of ordered pairs
Matrix RepresentationBinary matrix showing existing pairs
DigraphDirected graph representation
Empty RelationNo ordered pairs
Universal RelationAll possible ordered pairs
Identity RelationOnly (a,a)(a,a) pairs
Inverse RelationReverse every ordered pair
Complement RelationAll pairs not present in the relation