<<

RELATIONS

A can be thought of as a of ordered pairs. We consider the first of the to be related to the second element of the ordered pair.

Relation of Students to Courses:

Student Course Bill CompSci Mary Math Bill Art Ron History Ron CompSci Dave Math

Definition: A relation R from a set X to a set Y is a of the Cartesian X x Y, if (x, y) ∈ R, we write x R y and say that x is related to y.

In case X = Y, we call R a on X.

Domain and Range of R

The set {x ∈ X | (x, y) for some y ∈ Y} is called the domain of R.

The set {y ∈ Y | (x, y) for some x ∈ X} is called the range of R.

If a relation is given as a table, the domain consists of the first column and the range consists of the second column.

Example: Our relation R in the table above can be re-written as this set of ordered pairs: R= { (Bill, CompSci), (Mary, Math), (Bill, Art), (Ron, History), (Ron, CompSci), (Dave, Math) }

Since (Dave, Math) ∈ R, we may write that Dave R Math. The domain is X= {Bill, Mary, Ron, Dave}. The range is Y = {CompSci, Math, Art, History}

Relation defined by rule of membership: Example 1: Let us define two sets X and Y such that: X = {2, 3, 4}, Y ={3, 4, 5, 6, 7} If we define a relation R from X to Y by: (x, y) ∈ R if x divides y (with zero remainder).

We obtain that the following ordered pairs belong to R: R = {(2,4), (2, 6), (3, 3), (3, 6), (4, 4)}

If we write R as a table, we obtain: X Y 2 4 2 6 3 3 3 6 4 4

The domain of R is the set {2, 3, 4} and the range of R is the set {3, 4, 6}

Example 2: Let R be the relation on X = {1, 2, 3, 4} defined by (x, y) ∈ R if x ≤ y, for x, y ∈X. then R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)}

The domain and range of R are both equal to X.

Digraph:

An informative way to picture a relation on a set is to draw its digraph.

To draw the digraph of a relation on a set X: 1. First, draw dots or vertices to represent the elements of X. 2. Next, if the ordered pair (x, y) ∈ R, draw an arrow, called a directed edge from x to y. 3. An element of the form (x, x) is in relation with itself and corresponds to a directed edge from x to x called a loop.

1. . 2

. 3 4

Example 3: The relation R on X = {a, b, c, d} is given by the digraph

R= {(a, a), (b, c), (c, b), (d, d) }

Properties of Relations:

Reflexive: A relation R on a set X is called reflexive if (x, x)∈ R for every x ∈ X. The digraph of a has a loop on every vertex.

The relation R on X = {1, 2, 3, 4}( in example 2), is reflexive because: for each element x ∈ X, (x, x) ∈ R.

The relation R on X = { a, b, c, d} (in example 3) is not reflexive. For example, b∈ X but (b, b) ∉ R.

Symmetric:

A relation R on a set X is called symmetric if :

for all x, y ∈ X, if (x, y) ∈ R then (y, x) ∈ R.

The digraph of a has the property that whenever there is a directed edge from any vertex v to a vertex w, then there is a directed edge from w to v.

The relation R on X = { a, b, c, d} (in example 3) is symmetric because: for all x, y ∈ X , if (x, y) ∈ R then (y, x) ∈ R

The relation R on X = {1, 2 ,3 ,4} (in example 2) is not symmetric because: For example (2, 3) ∈ R but (3, 2) ∉ R.

Antisymmetric: A relation R on a set X is called antisymmetric if for all x, y ∈ X , if (x, y) ∈ R and x ≠ y then (y, x) ∉ R.

The digraph of an has the property that between any two vertices there is at most one directed edge.

The relation R in example 2 is antisymmetric. The relation R in example 3 is not antisymmetric because both (b,c) and (c,b) are in R

If a relation R on X has no members of the form (x, y) with x ≠ y, then R is antisymmetric. For example: If X = {1, 2, 3} and we define the relation R On X such that : (x, y) ∈ R if x = y

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

This relation R on X is antisymmetric. R is also reflexive and symmetric.

Transitive:

A relation R on a set X is called transitive if: for all x, y, z ∈ X, if (x, y) ∈ R and (y, z) ∈ R then (x, z) ∈ R

The relation R in example 2 is transitive because for all x, y, z ∈ X, if (x, y) ∈ R and (y, z) ∈ R then (x, z) ∈ R

To formally verify that that this relation satisfies the definition, we would have to list all the pairs of form (x, y) and (y, z) and verify that (x, z) ∈ R . We do not need to verify that the relation is true in case x=y or y=z.

(x, y) (y, z) (x, z) (1, 2) (2, 3) (1, 3) (1, 2) (2, 4) (1, 4) (1, 3) (3, 4) (1, 4) (2, 3) (3, 4) (2, 4)

The digraph of a has the property that whenever there are directed edges from x to y and from y to z, there is also a directed edge from x to z.

The relation in example 3 is not transitive, because (b, c) and (c, b) ∈ R but (b, b) ∉ R.

Partial Orders:

A relation R on a set X is called a partial order if R is reflexive, antisymmetric and transitive.

For example, the relation R defined on the set of by: (x, y) ∈ R if x ≤ y is a partial order, it orders the integers