CSCI 2824 Lecture 19: Properties of Relations

We will now restrict ourselves to relations R subseteq A times A for a set A. Such relations can be viewed as a graph.

Graphs and Relations

Relations R subseteq A times A with domain and co-domain as the same set A can be viewed as a graph.

Graph

A graph G consists of a set A of nodes and a relation R subseteq A times A of edges. Each edge in a graph a rightarrow b corresponds to a pair (a,b) in R.

It is a common convention to call the set of nodes V (rather than A) edge relation E subseteq V times V (rather than Rsubseteq A times A) if we are talking about a graph. But we will ignore this convention for now.

We will look at two examples of relations and their corresponding graphs.

Example # 1

Consider the relation R_1: { (a,a), (b,a), (c,a), (d,a), (d,b), (d,c), (d,d) } over the set of nodes A = { a,b,c,d,e }. Its graph is depicted below:

300

Note that the graph has a node e without any links. This is because ein A but there is no tuple involving e in the relation R that describes the edge set.

Next, note that the edges corresponding to (a,a) and (d,d) are called self-loops. The graph of the relation in this example has two self loops, one over a and the other over d.

Example # 2

Consider the relation R_2: { (1,1), (1,2), (2,1), (2,3), (3,2), (3,3), (2,2) } over the set of nodes B = { 1,2,3 }. Its graph is depicted below:

100

Note that the arrow from 1 to 2 corresponds to the tuple  (1,2) in R_2, whereas the reverse arrow from 2 to 1 corresponds to the tuple (2,1) in R_2.

Types of Relations

We first study three types of relations: reflexive, symmetric and transitive.

Reflexive Relation

A relation R is reflexive iff (a,a) in R for all a in A.

From the graph, we note that a relation is reflexive if all nodes in the graph have self-loops

The relation R_2 from example #2 above is reflexive whereas the relation R_1 from example #1 is not. R_1 is missing the self loops from (b,b), (c,c) and (e,e).

The next concept is that of a symmetric relation.

Symmetric Relation

A relation R is symmetric iff for all (a,b) in R, (b,a) in R.

From its graph, a relation is symmetric if for every “forward” arrow from a to b, there is also a reverse arrow from b to a.

The relation R_2 from example #2 above is symmetric whereas the relation R_1 from example #1 is not. R_1 has the edge (d,b) but not the reverse edge (b,d).

Finally, we will talk about transitive relations.

Transitive Relation

A relation R is transitive iff for all a,b,c, IF (a,b) in R and (b,c) in R THEN (a,c)in R.

In graph terms, if we start at some node a, and using an edge go from a to b and then from b to c using another edge, we should also be able to go from a to c directly using an edge.

The relation R_2 from example #2 above is not transitive. It is missing the edges (1,3) and (3,1), that would make it transitive. The relation R_1 from example #1 is transitive, on the other hand.

Putting all these together, a relation is an equivalence iff it is reflexive, symmetric and transitive.

We now consider the polar opposite of a reflexive relation, an irreflexive relation:

Irreflexive Relation

A relation R is irreflexive iff (a,a) notin R for all a in A.

For all a in A, we have (a,a) notin R .

While a reflexive relation has all the self-loops, an irreflexive one has no self-loops.

The relation R_1 in example # 1 is not irreflexive since it has self-loops (a,a) and (d,d)$. Removing these from the relations yields us an irreflexive relation

Example

Take the set A = {1,2,3,4}. Give us examples of relations that are

  • Reflexive: {(1,1), (2,2), (3,3), (3,4), (4,4) }.

  • Irreflexive: {(1,3)}. Caution Irreflexive is not the logical negation of reflexive. It is stronger than that.

  • Symmetric: {(1,2), (2,1), (1,1), (1,4), (4,1) }.

  • Transitive: example in class.

  • Equivalence: {(a,b) in N times N | a = b }.

  • Equivalence-2: {(a,b) in N times N | a mod 7 = b mod 7 }.

What about the empty set as a relation? Is it reflexive? Symmetric? Transitive??

Example

Conider the standard leq relation over mathbb{N}.

 { (i,j) | exists k in mathbb{N} i + k  = j }

  • It is reflexive since i leq i for all i in mathbb{N}.

  • It is not symmetric: 1 leq 2 but 2 notleq 1.

  • It is transitive: a leq b mbox{AND} b leq c Rightarrow a leq c.

  • It is not irreflive since 1 leq 1

Anti-Symmetric Relation

We looked at irreflexive relations as the polar opposite of reflexive (and not just the logical negation). Now we consider a similar concept of anti-symmetric relations.

This is a special property that is not the negation of symmetric.

A relation R is anti-symmetric iff whenever (a,b) and (b,a) are both in R then a=b.

Anti-symmetric is not the opposite of symmetric. A relation can be both symmetric and anti-symmetric:

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

Another example is the empty set. It is both symmetric and anti-symmetric.

The leq relation on N is anti-symmetric. Whenever a leq b and b leq a then a=b. In fact, the notion of anti-symmetry is useful to talk about ordering relations such as subseteq over sets and leq over natural numbers.

Partial Orders

A relation R is a partial order iff it is

  • reflexive

  • transitive

  • anti-symmetric.

The easiest way to remember a partial order is to think of the subseteq relation over sets. In fact, the partial order definition is an abstraction of the subset relation.

Example-1

Let us take the words in an english dictionary. The lexicographic ordering (or alphabetic ordering) is a partial order.

Example-2

Is the order leq on N a partial order? What about the < ordering?

Example-3

Is the = relation on N a partial order?

Example-4

Is the empty relation a partial order, in general?

Partial orders can leave elements incomparable. We saw the example with subseteq where {1} is incomparable in the subseteq ordering to {2,3}.

A strict partial order is an irreflexive, transitive and anti-symmetric relation. It is inspired by the subset order between sets which captures the notion of proper subsets.

Total Order

A total ordering is a partial order that also satisfies the property that there are no incomparable elements.

The definition of a total ordering is inspired by the leq relation. It is a partial order over N but additionally for any m,n in N either m leq n or n leq m.

A strict total ordering is a strict partial order that ensures that no two different elements are incomparable.

Strict total orderings are inspired by the < relation on N.

More Examples

Let us take an example and study various find of relations. Let us take the set of natural numbers and classify relations over them.

  • R_1 = { (m,n)  | m-n is even }.

  • R_2 = { (m,n)  | n = m^2 } .

  • R_3 = { (m,n)  | m leq n + 2 }.

  • R_4 = { (m,n)  |  n -2 leq m  leq n+2 }.

Relation Reflexive?? Symmetric?? Transitive? Anti-Symmetric? Irreflexive?
1 Y Y Y N N
2 N N N Y N
3
4