Source codeVideos

Command Palette

Search for a command to run...

Relations Between Sets

In mathematics, a relation from a set AA to a set BB is a rule that connects members of set AA with members of set BB. This pairing can be in any form.

Example:

The "less than" relation between A={1,2,3}A = \{1, 2, 3\} and B={1,2,3,4}B = \{1, 2, 3, 4\} yields the pairs (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4).

Explanation:

We look for all pairs (a,b)(a, b) with aAa \in A and bBb \in B where a<ba < b.

  • For a=1a=1 -> 1<21 < 2, 1<31 < 3, 1<41 < 4. Pairs: (1,2),(1,3),(1,4)(1, 2), (1, 3), (1, 4).
  • For a=2a=2 -> 2<32 < 3, 2<42 < 4. Pairs: (2,3),(2,4)(2, 3), (2, 4).
  • For a=3a=3 -> 3<43 < 4. Pair: (3,4)(3, 4).

The combination of all these pairs is {(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}\{(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)\}.

Functions as Special Relations

A function (or mapping) ff from a set AA to a set BB, written f:ABf: A \to B, is a special relation that satisfies two conditions:

  1. Every element xAx \in A must have a pair yBy \in B.

    xA,yB such that (x,y)f\forall x \in A, \exists y \in B \text{ such that } (x, y) \in f
  2. Every element xAx \in A has exactly one pair yBy \in B.

    If (x,y1)f and (x,y2)f, then y1=y2\text{If } (x, y_1) \in f \text{ and } (x, y_2) \in f, \text{ then } y_1 = y_2

This means every member of the domain must be connected, and cannot have more than one connection.

Arrow Diagram Examples

Here are visual examples of relations using arrow diagrams to distinguish between functions and non-functions.

Relations That Are Not Functions

One to Many
Element b has more than one pair (m and n).
Arrow diagram of relation between setsXYabcmn
Domain Element Without a Pair
Element c does not have a pair in the codomain.
Arrow diagram of relation between setsXYabcmno

Relations That Are Functions

Exactly One Pair
Each domain element (p, q, r) has exactly one pair.
Arrow diagram of relation between setsXYpqrxyz