Discrete Mathematics Lesson 17: Relations

  1. Upcoming
  2. Video
  3. Relations
    1. Ordering
    2. Set vs Relation
    3. Rock, Paper, Scissors
    4. Properties of Relations
    5. Examples: Reflexive
    6. Examples: Symmetric
    7. Examples: Transitive
  4. Equivalence Relations
    1. Definition
    2. Equivalence Classes
    3. Examples
    4. Squares
    5. Sine

Upcoming

Video

Watch the recording of the online lecture I gave in Fall 2020 on this topic. It’s about one hour. You can follow along with the notes below, or with the slides from that lecture.

You may also wish to consult the text An Infinite Descent into Pure Mathematics. Below we mostly cover chapter 5 on relations. Later we will look at section 11.1.

Relations

Definition: Let $X$ and $Y$ be sets. A binary relation $R$ from $X$ to $Y$ is a subset of $X \times Y$, that is, a set of ordered pairs $(x, y)$ where $x \in X$ and $y \in Y$.

Ordering

Classical example: $x, y \in \mathbb{Z}$, $R$ is $<$:

Set vs Relation

Integers as a set vs integers as a relation:

Integers as a set and as a relation

Two element relations:

Two element relations

Rock, Paper, Scissors

Let $X = \{ $ rock, paper, scissors $ \} $. Let $x \mathrel{R} y$ mean “$x$ beats $y$ in a game of rock/paper/scissors”. Describe $R$ completely:

Solution
  • rock beats scissors
  • scissors beats paper
  • paper beats rock
  • So the set is: $\{$ (rock, scissors), (scissors, paper), (paper, rock) $\}$ and that's it.

Properties of Relations

Examples: Reflexive

Let $X$ be the set of all people. Are the following relations reflexive: $\forall x (x \mathrel{R} x)$?

Examples: Symmetric

Let $X$ be the set of all people. Are the following relations symmetric: $\forall x \forall y (x \mathrel{R} y \rightarrow y \mathrel{R} x)$?

Examples: Transitive

Are the following relations transitive: $\forall x \forall y \forall z (x \mathrel{R} y \wedge y \mathrel{R} z \rightarrow x \mathrel{R} z)$?

Equivalence Relations

Let $X$ be a set. A relation $\sim$ on $X$ is called an equivalence relation if it is reflexive, symmetric, and transitive.

Definition

That is, $\sim$ is an equivalence relation on $X$ if:

The idea of an equivalence relation generalizes the following notions:

Congruence modulo 3 is an equivalence relation:

Congruence Modulo 3 Equivalence Relation

Equivalence Classes

Examples

Squares

Let $X = \mathbb{Z}$, and $x \sim y$ if $x^2 = y^2$. Claim: $\sim$ is an equivalence relation.

Solution
  • Proof: Each follows from reflexivity, symmetry, and transitivity of =
  • $[0]_{\sim} = \{ 0 \}, [1]_{\sim} = \{1, -1 \}$
  • One equivalence class for each non-negative number!
  • Can represent using the elements of $\mathbb{N}$!

Sine

Let $X = \mathbb{R}$, and $x \sim y$ if $\sin(x) = \sin(y)$. Claim: $\sim$ is an equivalence relation.

Solution
  • Proof: Again follows from reflexivity / symmetry / transitivity of =
  • $[0]_{\sim} = \{0, \pi, 2\pi, -\pi, -2\pi, \ldots \} = \{ k\pi : k \in \mathbb{Z} \}$. For $\pi/2$: $[\pi/2]_{\sim} = \{ \pi/2 + 2\pi\cdot k : k \in \mathbb{Z} \}$.
  • Before answering, look at the graph below:

Notice that every $y$-value on the graph of $y = \sin(x)$ appears in the interval from $x = -\pi/2$ to $x = \pi/2$. Therefore, a good set of representatives would be the interval $[-\pi/2, \pi/2]$.