Discrete Mathematics : Relations

Contents

Functions vs. relations

Are these functions?

Are these functions?
$-$ rational $p =$ rational $q$
$-$ $m < n$
$-$ $d$ does not divide $n$
$-$ $n$ leaves a remainder of 5 when divided by $d$
$-$ line $\ell_1$ is parallel to line $\ell_2$
$-$ person $a$ is a parent of person $b$
$-$ triangle $t_1$ is congruent to triangle $t_2$
$-$ edge $e_1$ is adjacent to edge $e_2$
$-$ matrix $A$ is orthogonal to matrix $B$
No! (Because an input is mapped to more than one output.)

What are these mappings called? Relations!

Venn diagram

Venn diagram relating functions and relations

Examples

Graph of $y = x^2$
Graph of $y = \pm\sqrt{x}$

$y = x^2$$y = \pm\sqrt{x}$
Function?
Relation?

Graph of $y = x$
Graph of $y \ge x$

$y = x$$y \ge x$
Function?
Relation?

What is a binary relation?

Set of all functions is a proper subset of the set of all relations.

Example 1: Marriage relation

Arrow diagram of a marriage relation between two sets

Example 2: Less than relation

A relation $L: \mathbb{R} \rightarrow \mathbb{R}$ as follows.
For all real numbers $x$ and $y$, $(x, y) \in L \Leftrightarrow x \mathrel{L} y \Leftrightarrow x < y$.
Draw the graph of $L$ as a subset of the Cartesian plane $\mathbb{R} \times \mathbb{R}$.

Solution

Graph of the less-than relation on the Cartesian plane

Example 3: Congruence modulo 2 relation

Define a relation $C: \mathbb{Z} \rightarrow \mathbb{Z}$ as follows.
For all $(m, n) \in \mathbb{Z} \times \mathbb{Z}$, $m \mathrel{C} n \Leftrightarrow m - n$ is even.
Prove that if $n$ is any odd integer, then $n \mathrel{C} 1$.

Solution

Graph of the congruence modulo 2 relation on the integer plane

Inverse of a relation

Relation and its inverse

Definition

Example: Inverse of a finite relation

Solution

Arrow diagram of finite relation $R$ on divisibility
Arrow diagram of inverse relation $R^{-1}$ on multiples

Example: Inverse of an infinite relation

Solution

Graph of relation $R$ where $v = 2|u|$
Graph of inverse relation $R^{-1}$

Relation on a set

Example

Solution

Directed graph of the relation $x \mathrel{R} y \Leftrightarrow 2 \mid (x - y)$ on $\{3,4,5,6,7,8\}$

Reflexivity, symmetry, and transitivity

Directed graph showing reflexivity, symmetry, and transitivity for the relation $3 \mid (x - y)$

Example 1

Solution

Directed graph of the relation showing it is reflexive and symmetric but not transitive

Example 2

Solution

Directed graph of the relation showing it is transitive but not reflexive or symmetric

Example 3

Solution

Directed graph of the relation $R = \{(0,1), (2,3)\}$

Equivalence relation and equivalence class

Example: Less than

Solution

So, $R$ is not an equivalence relation.

Example: Equality (or Identity relation)

Solution

So, $R$ is an equivalence relation.
Equivalence classes: $[a] = \{ a \}$.

Example: Partition

Solution

Diagram showing a partition of set $A = \{0,1,2,3,4\}$ into the blocks $\{0,3,4\}$, $\{1\}$, and $\{2\}$

Example: Partition

Solution

So, $R$ is an equivalence relation.

Example: Least element

Solution

Diagram of the equivalence classes induced by the least-element relation on the power set of $\{1, 2, 3\}$

Example: Congruence modulo 3

Solution

Congruence modulo $n$

Let $a$ and $b$ be integers and $n$ be a positive integer. The following statements are equivalent:

Examples

Solution (sketch)

So, $R$ is an equivalence relation.
Equivalence classes: $[0], [1], \ldots, [n - 1]$.

Solution (detailed)

Modular arithmetic

Let $a, b, c, d, n$ be integers with $n > 1$.
Suppose $a \equiv c \pmod{n}$ and $b \equiv d \pmod{n}$. Then
  1. $\fbox{$(a + b) \equiv (c + d) \pmod{n}$}$
  2. $\fbox{$(a - b) \equiv (c - d) \pmod{n}$}$
  3. $\fbox{$(ab) \equiv (cd) \pmod{n}$}$
  4. $\fbox{$(a^m) \equiv (c^m) \pmod{n}$}$ for all positive integers $m$

Units digit

Solution

Equation solving

Solution

Universal product code (UPC)

Solution