Properties of relations

Reflexive relations

Reflexive relation

A relation on a set is called a reflexive, if $(a, a) \in R$ for every element $a \in A$, in effect everything loops.

For example:

  • Reflexive: on Each element refers to itself.

    digraph G {
    	1->1
      1->2
      3->1
      2->2
      3->3
    }
  • Reflexive: , , Each and every number is lesser than or equal to, greater than or equal or equal to itself.

  • Reflexive: ‘divisibility’ on Each and every number is divisible by itself.

  • Not reflexive: on Not every element refers to itself.

    digraph G {
    	1->1
      1->2
      3->1
    }
Link to original

Irreflexive relations

Irreflexive relation

A relation on a set is called irreflexive if $(a,a) \notin R$ for every element $a \in A$, in effect there are no loops.

For example:

  • Irreflexive: , , on or on Elements do not refer to themselves.

  • Irreflexive: on

    digraph G {
    	1->2
      1->3
      2->1
      3->2
    }
title: Not all "not reflexive" relations are irreflexive!
**Not irreflexive**: $R_2 = \{ (1,1), (1,2), (3,1) \}$ on $\{ 1,2,3 \}$
Some elements refer to themselves.
 
```graphviz
digraph G {
  1->1
  1->2
  3->1
}
Link to original

Symmetric relations

Symmetric relation

A relation on a set is called symmetric, if for all elements $a, b \in A$, $(b,a) \in R$ whenever $(a, b) \in R$. In effect, all relations must be mirrored.

For example:

  • Symmetric: on All pairs of elements have the same properties in both directions.

    digraph G {
    	1->1
      1->2
      2->1
      2->3
      3->2
      3->3
    }
  • Symmetric: on All pairs of elements have the same properties in both directions.

    digraph G {
    	1->1
      2->2
      3->3
    }
  • Symmetric: on

  • Not symmetric: on Not all pairs of elements have the same properties in both directions.

    digraph G {
    	1->1
      1->2
      2->1
      3->1
      3->3
    }
Link to original

Antisymmetric relations

Antisymmetric relation

A relation on a set is called antisymmetric, if $(a, b)$ and $(b, a)$ cannot both be in $R$ unless $a = b$.

(it also does not mean should be in )

This is also not opposite to symmetric, instead it means that you can go one way but you cannot come back unless if you’re going from an element to itself.

For example:

  • Antisymmetric: , , , on , , or .

  • Antisymmetric: on You can go one way but not the other.

    digraph G {
    	1->1
      1->3
      2->3
      3->3
    }
  • Antisymmetric (also symmetric): on You can go one way but not the other.

    digraph G {
    	1->1
      2->2
      3->3
    }
  • Not antisymmetric: on There are bi-directional paths here.

    digraph G {
      1->1
    	1->2
      2->1
    }
Link to original

Transitive relations

Transitive relation

A relation on a set is called transitive, if the following hold, for all elements : $$ \text{If both } (a, b) \in R \text{ and } (b, c) \in R \text{ then } (a, c) \in R $$

In the directed graph representing , is transitive, if every two-step journey along arrows can be done in one step. For example:

  • The following graphs are not transitive:

    digraph A {
    	x->y
      y->z
      z->w
      x->z
    }
     
    digraph B {
    	x->y
      y->z
      z->w
      x->z
      x->w
    }
  • The following graph is transitive:

    digraph B {
    	x->y
      y->z
      z->w
      x->z
      x->w
      y->w
    }
  • Transitive: , , , on , , , or For example, if then and so on…

  • Transitive: on

    digraph B {
    	1->1
      1->2
      1->3
      2->2
      2->3
      3->3
    }
  • Transitive: on We cannot show it’s not transitive, since we only have one one-step journey.

    digraph B {
      3->4
    }
  • Not transitive: on

    digraph B {
      1->1
      1->2
      2->1
    }
Link to original

Transitive closure

Transitive closure

Given that is a relation on a set . The transitive closure of is the smallest transitive relation on $A$ containing $R$. We denote the transitive closure of $R$ by $\boxed {R^*}$.

If is already transitive, then .

For example, given the following definition of , we find :

digraph A {
	label="R"
	x->y
	y->z
	z->w
	x->z
}
digraph B {
	label="R*"
	x->y
	y->z
	z->w
	x->z
	x->w
	y->w
}

Given , we can define the transitive closure, , recursively: ?

  • Basis step: The pairs in are all in .
  • Recursive step: If and then . We add the missing pairs step by step.

Warshall’s algorithm

Warshall's algorithm

Algorithm

An algorithm is a finite sequence of precise step-by-step instructions.

Link to original

Warshall’s algorithm computes the matrix of the transitive closure of . ?

  • Given a relation on a set with elements, we begin with its matrix.
  • There are rounds. For each, we mutate the matrix. is the matrix of the transitive closure of .
    • 1st rule: never change to
    • 2nd rule: for the round, we select the th row and the th column, we look at all of the values not in this row or column. From the position of the value we are looking at, we check to see if the corresponding cells in the th row and column are , if they are, we change to otherwise we don’t do anything.
Link to original

Example

Let be a relation on .

We first construct our starting matrix.

Round 1.

Round 2.

Round 3.

Round 4.

Hence this is our final relation.

digraph A {
	label = "R"
	a->d
	b->a
	b->c
	c->a
	c->d
	d->c
}
 
digraph B {
	label = "R*"
	a->a
	a->c
	a->d
	b->a
	b->c
	b->d
	c->a
	c->c
	c->d
	d->a
	d->c
	d->d
}
Link to original

Equivalence relation

Equivalence relation

A relation on a set is called an equivalence relation if it is: ?

For example:

  • on any set
  • on
Link to original

Partial Order

Partial order

A relation on a set is called an partial order if it is: ?

For example:

  • , , and ‘divisibility’ on
  • Prove that is a partial order on the power set of a set .
    • is reflexive because for every set .
    • is antisymmetric because if and , then holds.
    • is transitive because if and , then holds.
Link to original

Linear Order

Linear order

A relation on a set is called a linear order if: ?

  • It is also a partial order.
  • For all , either or .

For example:

on on

Graph of less than or equal to on natural numbers

  	graph G {
		2--1
		1--0
	}
Link to original

Graph of greater than or equal to on integer numbers

  	graph G {
		{
			m [label="-1"]
		}
	
  		m--0
		0--1
  	}
Link to original

Example

Let be a set with more than one element. Show that is not a linear order on .

If has more than one element, then there are at least two different elements, say and :

  • so and so
  • so and so
  • Neither or hold as .

So and are two elements in such that either or , so so is not a linear order. (It does not form a line.)

graph G {
	{
		a [label="P(s)"]
		x [label="{x}"]
		y [label="{y}"]
	}
	
	x,y--a
}
Link to original