0% found this document useful (0 votes)
38 views

D16 R Discrete Mathematics and Combinatory

The document summarizes key concepts about relations from Chapter 7 of the textbook Discrete & Combinatorial Mathematics. It defines various properties of relations such as reflexive, symmetric, transitive, equivalence relation, and partial order. It also discusses how relations can be represented using zero-one matrices and how the composition of relations corresponds to the multiplication of their relation matrices. The power of a relation is defined recursively using relation composition.

Uploaded by

Efrem Girma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

D16 R Discrete Mathematics and Combinatory

The document summarizes key concepts about relations from Chapter 7 of the textbook Discrete & Combinatorial Mathematics. It defines various properties of relations such as reflexive, symmetric, transitive, equivalence relation, and partial order. It also discusses how relations can be represented using zero-one matrices and how the composition of relations corresponds to the multiplication of their relation matrices. The power of a relation is defined recursively using relation composition.

Uploaded by

Efrem Girma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Computer Science and Information Engineering

National Chi Nan University

Combinatorial Mathematics
Dr. Justie Su-Tzu Juan

Chapter 7 Relations: The Second


Time Around
§ 7.1 Relations Revisited: Properties of
Relations
Slides for a Course Based on the Text
Discrete & Combinatorial Mathematics (5th Edition)
by Ralph P. Grimaldi

(c) Spring 2021, Justie Su-Tzu Juan


§ 7.1 Relations Revisited: Properties of Relations

Def 7.1 : A, B: sets, R  A  B: R is called a relation from A to B;


R  A  A: R is called a relation on A;
Ex 7.1 :
a) Defined R on Z by a R b or (a, b)  R, if a  b:
R is the ordinary “less than or equal to” relation on Z.
(Z 可改成 Q, R, but not on C)
b) Let n  Z+, Define R on Z by x R y, if n(x – y):
R is the modulo n relation on Z.
ex. n = 7: 9R 2, –3R 11, (14, 0)  R, 3R 7 (3 is not related to 7).
c) Let U = {1, 2, 3, 4, 5, 6, 7}, C  U, C = {1, 2, 3, 6}
Define R on P(U) by A R B, if A  C = B  C
ex: {1, 2, 4, 5} and {1, 2, 5, 7} are related,
X = {4, 5} and Y = {7} are related;
S = {1, 2, 3, 4, 5} and T= {1, 2, 3, 6, 7} are not related (S R T)
(c) Spring 2021, Justie Su-Tzu Juan
§ 7.1 Relations Revisited: Properties of Relations

Def 7.2 : A relation R on A is called reflexive 


 x  A, (x, x)  R.

Ex 7.5 : If A= n, A  A= n2, there are 2n2 relations on A.


How many of these are reflexive?
2(n2–n)
Def 7.3 : A relation R on A is called symmetric
  x, y  A, (x, y)  R  (y, x)  R .

Note : Let A= n


1) How many relations on A are symmetric? 2(n2+n)/2
2) Both reflexive and symmetric? 2(n2–n)/2
(c) Spring 2021, Justie Su-Tzu Juan
§ 7.1 Relations Revisited: Properties of Relations

Def 7.4 : A relation R on A is called transitive


  x, y, z  A, (x, y), (y, z)  R  (x, z)  R.

Def 7.5 : A relation R on A is called antisymmetric


  a, b  A, (a R b and b R a)  a = b.

Note : How many relations of A are antisymmetric? (|A| = n) ?


(2n)(3(n2–n)/2)
1) (x, x)  A  A (n : 2n)
2) (x, y)  A  A, x  y: (a) (y, x)  R , (b) (x, y)  R ,
(c) (x, y), (y, x)  R
( (n2–n)/2 : 3(n2–n)/2)

(c) Spring 2021, Justie Su-Tzu Juan


§ 7.1 Relations Revisited: Properties of Relations

Def 7.6 : A relation R on A is called a partial order or a partial


ordering relation, if R is reflexive, antisymmetric, and
transitive.

Ex 7.14 : EX 7.1(a) is a partial order,


EX 7.1(b) is not (∵ not antisymmetric),

Def 7.7 : An equivalence relation R on a set A is a relation that


is reflexive, symmetric, and transitive.

Ex 7.16 (1/2):
a) Ex 7.1(b) is equivalence relation.

(c) Spring 2021, Justie Su-Tzu Juan


§ 7.1 Relations Revisited: Properties of Relations

b) Let A = {1, 2, 3}, then


R1 = {(1, 1), (2, 2), (3, 3)}
R2 = {(1, 1), (2, 2), (2, 3), (3, 2), (3, 3)}
R3 = {(1, 1), (1, 3), (2, 2), (3, 1), (3, 3)}
R4 = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)}
are all equivalence relations on A?
c) For a given finite set A = {a1, a2, …, an},
A  A : the largest equivalence relation on A.
R = {(ai, ai) | 1  i  n} : the smallest equivalence relation on A.
(equality relation)
e) If R is a relation on A, then R is both an equivalent relation
and a partial order on A if and only if R is the equality
relation on A.
(c) Spring 2021, Justie Su-Tzu Juan
Computer Science and Information Engineering
National Chi Nan University

Discrete Mathematics
Dr. Justie Su-Tzu Juan

Chapter 7 Relations: The Second


Time Around
§ 7.2 Computer Recognition: Zero-One
Matrices and Directed Graphs (1)
Slides for a Course Based on the Text
Discrete & Combinatorial Mathematics (5th Edition)
by Ralph P. Grimaldi

(c) Spring 2021, Justie Su-Tzu Juan


§ 7.2 Computer Recognition: Zero-One Matrices and
Directed Graphs
Def 7.8 : A, B, C: sets, R1  A  B, R2  B  C. The
composite relation R1。R2  A  C defined by
R1。R2 = {(x, z) | x  A, z  C, and  y  B with (x, y)
 R1, (y, z)  R2}.

Ex 7.17: A = {1, 2, 3, 4}, B = {w, x, y, z}, C = {5, 6, 7} back


R1 = {(1, x), (2, x), (3, y), (3, z)}  A  B
R2 = {(w, 5), (x, 6)}  B  C
R3 = {(w, 5), (w, 6)}  B  C
R1。R2 ={(1, 6), (2, 6)} R1。R3 = 

(c) Spring 2021, Justie Su-Tzu Juan


§ 7.2 Computer Recognition: Zero-One Matrices and
Directed Graphs
Ex 7.18 : A: employees, B: programming languages,
C = {p1, p2, …, p8}: projects.
R1  A  B : (x, y)  R1 means x is proficient in y,
R2  B  C : (y, z)  R2 means z need y.
 R1。R2 has been used to set up a matching
process between employees and projects on the
basis of employee knowledge of specific
programming languages.

(c) Spring 2021, Justie Su-Tzu Juan


§ 7.2 Computer Recognition: Zero-One Matrices and
Directed Graphs
Thm 7.1 : A, B, C, D : sets, R1  A  B, R2  B  C, R3  C  D.
The R1。(R2。R3) = (R1。R2)。R3.
Proof.
1. R1。(R2。R3)  A  D, (R1。R2)。R3  A  D.
2.  (a, d)  R1。(R2。R3)
  b  B s.t. (a, b)  R1  (b, d)  R2。R3
  c  C s.t. (b, c)  R2  (c, d)  R3
∵ (a, b)  R1  (b, c)  R2  (a, c)  R1。R2
∵ (a, c)  R1。R2  (c, d)  R3
 (a, d)  (R1。R2)。R3
∴ R1。(R2。R3)  (R1。R2)。R3
Similar, (R1。R2)。R3  R1。(R2。R3)
R1。(R2。R3) = (R1。R2)。R3
(c) Spring 2021, Justie Su-Tzu Juan
§ 7.2 Computer Recognition: Zero-One Matrices and
Directed Graphs
Def 7.9 : A: sets, R  A  A. The power of R defined recursively:
(a) R1 = R;
(b) Rn+1 = R。Rn ,  n   +.

Ex 7.19: A = {1, 2, 3, 4}, R = {(1, 2), (1, 3), (2, 4), (3, 2)} back
 R2 = {(1, 4), (1, 2), (3, 4)}
 R3 = {(1, 4)}
 Rn = ,  n  4.

Def 7.10: 1) An mn zero-one matrix E = (eij)mn, (0, 1)-matrix:


 m rows, n columns, each entry is 0 or 1.
2) eij  the entry in the ith row and the jth column of E,
 1  i  m and 1  j  n.

(c) Spring 2021, Justie Su-Tzu Juan


§ 7.2 Computer Recognition: Zero-One Matrices and
Directed Graphs
1 0 0 1
Ex 7.20 : E  0 1 0 1 is a 3  4 (0, 1)-matrix.
 
1 0 0 0
1) e11 = 1 2) e23 = 0 3) e31 = 1

Note : Use the standard operations of matrix addition and


multiplication with the stipulation that 1 + 1 = 1
(Boolean addition).

(c) Spring 2021, Justie Su-Tzu Juan


R1 = {(1, x), (2, x), (3, y), (3, z)}  A  B
§ 7.2 Computer Recognition: Zero-One Matrices and
R2 = {(w, 5), (x, 6)}  B  C
Directed Graphs
Ex 7.21: The relation matrices for R1, R2 of Ex 7.17: see
(w) (x) (y) (z) B (5) (6) (7)
(1) 0 1 0 0 ( w) 1 0 0
( 2) 0 1 0 0 ( x) 0 1 0
M(R1) = M(R2) = 
(3) 0 0 1 1 ( y) 0 0 0
   
( 4)  0 0 0 0 ( z ) 0 0 0

A
0 1 0 0 1 0 0 0 1 0
0 1 0 0
0 1 0 0  1 0
M(R1)M(R2) =  = = M(R1。R2)
0 0 1 1 0 0 0 0 0 0
     
0 0 0 0 0 0 0 0 0 0

Note : M(R1)M(R2) = M(R1。R2)

(c) Spring 2021, Justie Su-Tzu Juan


§ 7.2 Computer Recognition: Zero-One Matrices and
Directed Graphs
Ex 7.22 : A = {1, 2, 3, 4}, R = {(1, 2), (1, 3), (2, 4), (3, 2)},
as in Ex 7.19. see
Define the relation matrix for R: M(R) is the 44 (0, 1)-matrix
whose entries mij, for 1  i, j  4, are given by mij = 1, if (i, j)  R,
0, otherwise.
0 1 1 0 0 1 0 1
0 0 0 0 0
0 0 1
M(R) =  (M(R))2 =  = M(R2)
0 1 0 0 0 0 0 1
   
0 0 0 0 0 0 0 0

0 0 0 0
0 0 0 0
(M(R))4 =   R4=
0 0 0 0
 
0 0 0 0
(c) Spring 2021, Justie Su-Tzu Juan
§ 7.2 Computer Recognition: Zero-One Matrices and
Directed Graphs
In general : A: set, |A| = n, R  A  A, M(R) is the relation
matrix for R :
(a) M(R) = 0 (all 0’s) iff R = 
(b) M(R) = 1 (all 1’s) iff R = A  A
(c) M(Rm) = [M(R)]m, for m +.

Def 7.11 : E = (eij)mn, F = (fij)mn : 2 mn (0, 1)-matrices.


E precedes (or is less than) F, E  F,
 eij  fij,  1  i  m, 1  j  n.
1 0 1 1 0 1
Ex 7.23 :E    , F   EF
0 0 1 0 1 1
  8 (0, 1)-matrices G for which E  G.
(c) Spring 2021, Justie Su-Tzu Juan
§ 7.2 Computer Recognition: Zero-One Matrices and
Directed Graphs
Def 7.12 : For n +, In = (ij)nn is the nn (0, 1)-matrix, where
ij = 1, if i = j;
0, if i  j.

Def 7.13 : Let A = (aij)mn. The transpose of A, Atr = (a*ji)nm,


where a*ji = aij, for all 1  j  n, 1  i  m.
0 1 
   0 0 1
Ex 7.24 : A  0 0 , A  
tr

1 1  1 0 1

Def : 1) 00 = 01 = 10 = 0, 11 = 1 (usual multiplication)


2) EF = (xij)mn, where xij = eijfij.

(c) Spring 2021, Justie Su-Tzu Juan


§ 7.2 Computer Recognition: Zero-One Matrices and
Directed Graphs
Thm 7.2 : A: set, |A| = n, R  A  A, let M denote the relation
matrix for R. Then
(a) R is reflexive iff In  M.
(b) R is symmetric iff M = Mtr.
(c) R is transitive iff MM = M2  M.
(d) R is antisymmetric iff MMtr  In.
Proof. (1/2)
Let M = (aij)nn.
(c) () Let M 2  M. If (x, y), (y, z)  R.
 mxy = myz = 1
(mxy means the entry of M in row (x), column (y))
 sxz = 1
(sxz means the entry of M2 in row (x), column (z))
∵ M2  M ∴ mxz = 1
 (x, z)  R and R is transitive.
(c) Spring 2021, Justie Su-Tzu Juan
§ 7.2 Computer Recognition: Zero-One Matrices and
Directed Graphs
Thm 7.2 : A: set, |A| = n, R  A  A, let M denote the relation
matrix for R. Then
(c) R is transitive iff MM = M2  M.
Proof. (2/2)
(c) () If R is transitive
Let sxz  the entry in row (x) and column (z) of
M2 = 1
∵ sxz = 1 ∴  y  A s.t. mxy = myz = 1
 (x, y)  R  (y, z)  R
 (x, z)  R (∵ R is transitive)
 mxz = 1
∴ M2  M.

(c) Spring 2021, Justie Su-Tzu Juan


§ 7.2 Computer Recognition: Zero-One Matrices and
Directed Graphs
Def 7.14 : V: finite nonempty. A directed graph (or digraph) G 
 G = (V, E), where V is called the vertex set, E  V  V is called

the edge set.


 v  V is called the vertices or nodes of G

 (a, b)  E is called the (directed) edges or arcs of G


 a is called the origin or source of (a, b)

 b is called the terminus or terminating vertex of (a, b)


 a is adjacent to b; b is adjacent from a

 (a, a) is called a loop at a


isolated vertex
5
Ex 7.25 : V = {1, 2, 3, 4, 5}, 1
2
E = {(1, 1), (1, 2), (1, 4), (3, 2)}
4 3

(c) Spring 2021, Justie Su-Tzu Juan


§ 7.2 Computer Recognition: Zero-One Matrices and
Directed Graphs
a b a b
Def : If (a, b), (b, a)  E, (a  b), then use {a, b} = {b, a} to
represent. a and b are called adjacent vertices.

Ex 7.26 : precedence graph for the computer program


(S1) b := 3
(S2) c := b + 2
(S3) a := 1
(S4) d := a  b + 5
(S5) e := d – 1
(S6) f := 7
(S7) e := c + d
(S8) g := b  f

(c) Spring 2021, Justie Su-Tzu Juan

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy