1 of 50

312708010 科管碩二 周亨昆

Discrete Mathematics

Presentation

2 of 50

CONTENT

01

02

Relations Revisited -

Properties of Relations

Computer Recognition -

Zero-One Matrices and Directed Graphs

3 of 50

Relations Revisited -

Properties of Relations

​

4 of 50

2021

​

For sets A, B, any subset of A × B is called a (binary) relation from A to B.

​

Any subset of A × A is called a (binary) relation on A.

​

Definition 7.1

5 of 50

2021

​

1. Define the relation R on the set Z by a R b, if a ≤ b. This subset of Z × Z is the ordinary “less than or equal to” relation on the set Z.

​

2. Let n ∈ Z+. For x, y ∈ Z, the modulo n relation R is defined by x R y if x − y is a multiple of n.

e.g., with n = 7, 9 R 2, −3 R 11

Example

6 of 50

3. Consider a finite state machine (FSM) M = (S, φ, O, ν, ω)

(S : 有限狀態集, φ : 輸入字母, O : 輸出字母, ν : 狀態轉移函數, ω : 輸出函式)

​

First level of reachability: S1 R S2 if ν(S1, x) = S2

Second level: S1 R S2 if ν(S1, x1x2) = S2, x1x2 ∈ φ2

7 of 50

A relation R on set A is called reflexive if for all X ∈ A, (X, X) ∈ R.

Definition 7.2

8 of 50

​

​

For A = {1, 2, 3, 4}, a relation R ⊆ A × A will be reflexive if and only if R ⊇ {(1, 1), (2, 2), (3, 3), (4, 4)}.

​

- Are the following relations reflexive?

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

R2 = {(x, y) | x, y ∈ A, x ≤ y}

Example

9 of 50

​

​

For A = {1, 2, 3, 4}, a relation R ⊆ A × A will be reflexive if and only if R ⊇ {(1, 1), (2, 2), (3, 3), (4, 4)}.

​

- Are the following relations reflexive?

R1 = {(1, 1), (2, 2), (3, 3)} ×

R2 = {(x, y) | x, y ∈ A, x ≤ y} ✓

Example

10 of 50

​

​

A relation R on set A is called symmetric if

(x, y) ∈ R ⇒ (y, x) ∈ R,

for all x, y ∈ A.

Definition 7.3

11 of 50

​

​

With A = {1, 2, 3}, we have:

​

(a) R1 = {(1, 2), (2, 1), (1, 3), (3, 1)} symmetric, but not reflexive

(b) R2 = {(1, 1), (2, 2), (3, 3), (2, 3)} reflexive, but not symmetric

(c) R3 = {(1, 1), (2, 2), (3, 3)} both symmetric and reflexive

(d) R4 = {(1, 1), (2, 2), (3, 3), (2, 3), (3, 2)} both symmetric and reflexive

Example

12 of 50

​

​

A relation R on set A is called antisymmetric if for all a, b ∈ A, (a R b and

b R a) ⇒ a = b.

Definition 7.5

13 of 50

​

​

Consider A = {1, 2, 3, 4},

are the following relations antisymmetric?

​

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

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

Example

14 of 50

​

​

Consider A = {1, 2, 3, 4},

are the following relations antisymmetric?

​

R1 = {(1, 1), (1, 2), (2, 3), (3, 1)} ✓

R2 = {(1, 2), (2, 1), (2, 3), (3, 1)} ×

Example

15 of 50

​

​

A relation R on set A is called transitive if for all x, y, z ∈ A,

(x, y), (y, z) ∈ R ⇒ (x, z) ∈ R.

Definition 7.4

16 of 50

​

Consider A = {1, 2, 3, 4},

are the following relations transitive?

​

R1 = {(1, 1), (2, 3), (3, 4), (2, 4)}

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

Example

17 of 50

​

Consider A = {1, 2, 3, 4},

are the following relations transitive?

​

R1 = {(1, 1), (2, 3), (3, 4), (2, 4)} ✓

R2 = {(1, 3), (3, 2)} ×

example:

18 of 50

Define the relation R on the set Z+, by a R b if a (exactly) divides b, that

is b = ca for some c ∈ Z+.

​

Now if x R y and y R z, do we have x R z?

Example

19 of 50

​

Define the relation R on the set Z+, by a R b if a (exactly) divides b, that

is b = ca for some c ∈ Z+.

​

Now if x R y and y R z, do we have x R z?

x R y ⇒ y = sx, for somes ∈ Z+,

y R z ⇒ z = ty, for some t ∈ Z+.

z = ty = t(sx) = (ts)x, for ts ∈ Z+.

​

So x R z and R is transitive.

In addition, R is reflexive, but not symmetric.

e.g., 2 R 6 but 6 /ℛ 2

Example

20 of 50

A relation R on set A is called partial order if R is reflexive, antisymmetric,

and transitive

Definition 7.6

21 of 50

​

Partial Order !

With the set A = {1, 2, 3, 4, 6, 12} and define the relation R on A by x R y

if x (exactly) divides y.

(R is reflexive and transitive)

​

If x, y ∈ A and we have both x R y and y R x, then

x R y ⇒ y = ax, for some a ∈ Z+,

y R x ⇒ x = by, for some b ∈ Z+.

​

y = ax = a(by) = (ab)y, and since y̸ = 0, we have ab = 1 ⇒ a = b = 1, so y = x and R is antisymmetric

R = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 6), (1, 12), (2, 2), (2, 4), (2, 6), (2, 12), (3, 3), (3, 6), (3, 12), (4, 4), (4, 12), (6, 6), (6, 12), (12, 12) }

Example

22 of 50

A relation R on set A is called equivalence relation if R is reflexive, sym-metric, and transitive.

Definition 7.7

23 of 50

if 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)}, and

R4 = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)} = A × A

​

are all equivalence relations on A.

24 of 50

Computer Recognition -

Zero-One Matrices and Directed Graphs

​

​

25 of 50

​

​

If R1 ⊆ A × B and R2 ⊆ B × C, then the composite relation R1 ◦ R2 is a

relation from A to C defined by

R1◦R2 = {(x, z) | x ∈ A, z ∈ C, and there exists y ∈ B with (x, y) ∈ R1, (y, z) ∈ R2}.

Definition 7.8

26 of 50

​

​

Let A = {1, 2, 3, 4}, B = {w, x, y, z}, and C = {5, 6, 7}.

​

Consider R1 = {(1, x), (2, x), (3, y), (3, z)}, a relation from A to B, and

R2 = {(w, 5), (x, 6)}, a relation from B to C.

​

Then R1 ◦ R2 = {(1, 6), (2, 6)} is a relation from A to C.

​

If R3 = {(w, 5), (w, 6)} is another relation from B to C, then R1 ◦ R3 = ∅.

Example

27 of 50

Theorem 7.1

Let A, B, C and D be sets with R1 ⊆ A × B, R2 ⊆ B × C, and R3 ⊆ C × D.

Then

R1 ◦ (R2 ◦ R3) = (R1 ◦ R2) ◦ R3.

​

Definition 7.9

Powers of R on A recursively defined by

(a) R1 = R and

(b) Rn+1 = R ◦ Rn, where n ∈ Z+.

28 of 50

​

Let A = {1, 2, 3, 4}, and R = {(1, 2), (1, 3), (2, 4), (3, 2)}, then

R2 = {(1, 4), (1, 2), (3, 4)}, R3 = {(1, 4)}, and for n ≥ 4, Rn = ∅.

Example

29 of 50

​

An m × n zero matrix (Eij )m×n is a rectangular array of numbers

arranged in m rows and n columns, where each eij for 1 ≤ i ≤ m and 1 ≤ j ≤ n,

​

denotes the entry in the ith row and jth column of E, and each such entry is 0 or 1. [We can also write (0, 1)-matrix for this type of matrix.]

Definition 7.10

30 of 50

The matrix

​

​

​

​

​

​

​

​

is a 3 × 4 (0, 1)-matrix where, for example,

e11 = 1, e23 = 0, e31 = 1.

31 of 50

​

​

Let A = {1, 2, 3, 4}, B = {w, x, y, z}, and C = {5, 6, 7}.

R1 = {(1, x), (2, x), (3, y), (3, z)}, a relation from A to B, and

R2 = {(w, 5), (x, 6)}, a relation from B to C.

​

Define the relation matrices for R1, R2 as follows:

Example

32 of 50

Example

The product of the relation matrices for R1, R2 equals the relation matrix

of the composite relation R1 ◦ R2.

33 of 50

Let A be a set with |A| = n and R a relation on A. If M (R) is the relation

matrix for R, then

​

(a) M (R) = 0 (the matrix of all 0’s) if and only if R = ∅

(b) M (R) = 1 (the matrix of all 1’s) if and only if R = A × A

(c) M (Rm) = [M(R)]m for m ∈ Z+

Properties

34 of 50

Let E = (eij )m×n and F = (fij )m×n be two m × n (0, 1)-matrices.

We say that E precedes, or is less than, F , and we write E ≤ F , if eij ≤ fij , for all 1 ≤ i ≤ m, 1 ≤ j ≤ n.

Definition 7.11

example

35 of 50

36 of 50

37 of 50

38 of 50

​

• For V = {1, 2, 3, 4, 5}, the diagram in Fig. 7.1 is a directed graph G on V

with edge set {(1, 1), (1, 2), (1, 4), (3, 2)}.

• Undirected graph {a, b} = {b, a}.

Example

39 of 50

Precedence Graph

• Dependency among statements (computer programs)

(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

40 of 50

If the directions in Fig. 7.4(a) are ignored, we get the associated undirected

graph shown in Fig. 7.4(b).

• path (no vertex may be repeated)

• closed path → cycle (length at least 3)

41 of 50

​

A directed graph G on V is called strongly connected if for all x, y ∈ V , where

x̸ = y, there is a path (in G) of directed edges from x to y – that is, ei-

ther the directed edge (x, y) is in G or, for some n ∈ Z+ and distinct vertices

v1, v2, . . . , vn ∈ V , the directed edges (x, v1), (v1, v2), . . . , (vn, y) are in G.

Definition 7.15

42 of 50

Example

• In Fig. 7.5 the directed graph on V = {1, 2, 3, 4} is strongly connected

and loop-free.

This is also true of the directed graph in Fig. 7.4(d)

43 of 50

​

• both R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (3, 4), (4, 3), (4, 4)} and R2 =

{(2, 4), (2, 3), (3, 2), (3, 3), (3, 4)} are disconnected

• two components in each graph

Example

44 of 50

The graphs in Fig. 7.7 are examples of undirected graphs that are loop-

free and have an edge for every pair of distinct vertices. These graphs

illustrate the complete graphs on n vertices, which are denoted by Kn.

45 of 50

A digraph G on a vertex set V gives rise to a relation R on V where xRy

if (x, y) is an edge in G.

​

• Both (0, 1)-matrix and digraph can describe relations

– The matrix is called the adjacency matrix for G

– Relation matrix for R

46 of 50

If A = {1, 2, 3} and R = {(1, 1), (1, 2), (2, 2), (3, 3), (3, 1)}, then R is a reflex-

ive antisymmetric relation on A, but it is neither symmetric nor transitive. The

directed graph associated with I consists of five edges. Three of these edges are

loops that result from the reflexive property of R. (See Fig. 7.8.) In general, if

R is a relation on a finite set A, then R is reflexive if and only if its directed

graph contains a loop at each vertex (element of A)

47 of 50

The relation R = {(1, 1), (1, 2), (2, 1), (2, 3), (3, 2)} is symmetric on A =

{1, 2, 3}, but it is not reflexive, antisymmetric, or transitive. The directed graph

for R is found in Fig. 7.9. In general, a relation R on a finite set A is symmetric

if and only if its directed graph may be drawn so that it contains only loops and

undirected edges

48 of 50

• For A = {1, 2, 3}, consider R = {(1, 1), (1, 2), (2, 3), (1, 3)}. Here R is

transitive and antisymmetric but not reflexive or symmetric. The directed

graph indicates that a relation on a set A is transitive if and only if it

satisfies the following: For all x, y ∈ A, if there is a (directed) path from

x to y in the associated graph, then there is an edge (x, y) also.

​

• To use the directed graph of Fig. 7.10 to characterize antisymmetry, we

observe that for any two vertices x, y, with x̸ = y, the graph contains at

most one of the edges (x, y) or (y, x). Hence there are no undirected edges

aside from loops

49 of 50

For A = {1, 2, 3, 4, 5}, the following are equivalence relations on A:

R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (3, 4), (4, 3), (4, 4), (5, 5)},

R2 = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3), (4, 4), (4, 5), (5, 4), (5, 5)}.

​

• In general, a relation on a finite set A is an equivalence relation if and only

if its associated graph is one complete graph augmented by loops at every

vertex or consists of the disjoint union of complete graphs augmented by

loops at every vertex.

50 of 50

FOR YOUR ATTENTION

THANK YOU