<<

4.1 Sets and Partitions 1. Product Sets: Let A and B be two nonempty sets. The product or Cartesian product A  B is the set of all ordered pairs a,b with a ∈ A and b ∈ B, that is, A  B  a,b| a ∈ A and b ∈ B . Example: Let A  1,2,3 and B  r,s. A\Br s A  B  1,r,1,s,2,r,2,s,3,r,3,s. 1 1,r1,s |A  B|  |A||B| 2 2,r2,s 3 3,r3,s Example: Let A  B  R. Then A  B  R2. Cartesian Product:

A1  A2    Am  a1,...,am | ak ∈ Ak , k  1,...,m

1 2. Partitions A partition or a quotient set of a nonempty set A is a collection P of nonempty of A such that (1) Each of A belongs to one of the sets of P.

(2) If A1 and A2 are distinct elements of P, then A1 ∩ A2  . The sets in P are called the blocks or cells of the partition. Example 6: Let A  a,b,c,d,e,f,g,h. Consider subsets of A:

A1  a,b,c,d, A2  a,c,e,f,g,h, A3  a,c,e,g,

A4  b,d, A5  f,h

Then A1, A2  is not a partition because A1 ∩ A2  .

A1, A5  is not a partition because e,g ∉ A1 and A5.

A2, A4  and A3, A4, A5  are partitions of A.

2 4.2 Relations and Digraphs 1. Relations Let A and B be two non-empty sets. A R from A to B is a of A  B  a,b| a ∈ A, b ∈ B. If R ⊆ A  B and a,b ∈ R, then we say that a is related to b by R, denoted as aRb. Other notation: a R b. If a is not related to b, then a ≠R b.

Example: Let A and B be two sets of real numbers. Define a relation R from A to B as

y aRbif and only if a  b. 4 2

R  x,x| x is a -4 -2 2 4 x -2

The graph of this relation: -4

Example: Let A  ℤ. Define R from A to A by aRbif and only if a | b.

3 R  a,qa| q is an integer  1,1, 1,2, ...,2,2,2,4, ...

y 12

10

8

Graph of R : 6

4

2

0 1 2 3 4 x

2. Domain and Range of a Relation The domain of a relation, denoted as Dom(R), is a subset of A containing all elements that are related to some elements in B. The range of a relation, denoted as Ran(R), is a subset of B containing all elements that are paired with some elements in A.

Example: A is also a relation. The domain and range of a

4 function are the same the domain and range of that relation. Let fx  x2 − 1 , gx  e−x, hx  lnx  3.

Example: Let A be the set of all real numbers. Consider the relation R: xRyif and only if x and y satisfy the equation x2 y2 4  9  1

3. The Matrix of a Relation The matrix of a given relation R is defined by

1 if ai,bj  ∈ R M  mij  where mij  0 if ai,bj  ∉ R Example: Sketch the direct graph of R if the matrix of R is given: M  

5 4. The Directed Graph (Digraph) of a Relation Let R be a relation on A A  A. Then the directed graph of R is a graph whose vertices are elements of A and which has an edge from vertex a to b if a,b in R. The in-degree of the element a in A is defined by the number b in A such that b,a ∈ R. The out-degree of the element a in A is defined by the number b in A such that a,b ∈ R.

6 4.3 Paths in Relations and Direct Graphs 1. Paths: A path of length n in R from a to b is a finite : a,x1,x2,...,xn−1,b, beginning with a and ending with b such that aRx1, x1Rx2,...,xn−1Rb. Note: In a direct graph, a path is a succession of edges. A cycle is a path that begins and ends at the same vertex. Example 1: There are several paths:

P1: 1,2,3 of length 2; P2: 1,2,5,4,3 of length 4;

P3: 2,2 of length 1, is also a cycle;

P4: 1,2,5,1 of length 3, is also a cycle.

2. Relation Rn and R: Let A be a set and x and y be in A. Define the relation Rn as: xRny if there is a path of length n from x to y. Rnx  y| y ∈ A, and yRnx

7  k n R x  y| y ∈ A, and yR x for some k (all possible k)  n≥1 R

Example 4:A  1,2,3,4,5,6, R: Figure 4.12, R2: Figure 4:13

Example 5:A  a,b,c,d,e, R  a,a, a,b, b,c, c,e, c,d, d,e 11000 00100 M  00011 , 00001 00000

8 2 11000 11100 00100 00011 M2  00011  00001 00001 00000 00000 00000 3 11000 11111 00100 00001 M3  00011  00000 00001 00000 00000 00000

9 4 11000 11112 00100 00000 M4  00011  00000 , 00001 00000 00000 00000 5 11000 11112 00100 00000 M5  00011  00000 00001 00000 00000 00000 M  M2  M3  M4  M5

10 11000 11100 00100 00011  00011  00001  00001 00000 00000 00000 11111 11112 44323 00001 00000 00112 00000  00000  00012 00000 00000 00001 00000 00000 00000 R2  a,a,a,b,a,c,b,d,b,e,c,e R3  a,a,a,b,a,c,a,d,a,e R

11 3. Matrix Representing a Relation: (1) Boolean Matrix Operations (Section 1.5): A Boolean matrix is a matrix whose entries are 0 or 1.

Let A  aij , and B  bij  be m  n Boolean matrices.

(i) the of A and B: C  A ∨ B  cij  where

1 if aij  1 or bij  1 cij  0 if aij  0 and bij  0

(ii) the meet of A and B: D  A ∧ B  dij  where

1 if aij  1 and bij  1 dij  0 if aij  0 or bij  0

(iii) Let A  aij  be m  p, and B  bij  be p  n Boolean matrices. the Boolean product of A and B: E  A ⊙ B  eij  where

1 if aik  1 and bkj  1 for some k,1≤ k ≤ p eij  0 otherwise

12 110 1000 010 Example: A  , B  0110 110 1011 001

1110 0110 A ⊙ B  1110 1011

(2) Matrix Representation of Rn:

Let R bearelationonafinitesetA  a1,...,an , and let MR be the n  n matrix representing R. Then MR2  MR ⊙ MR is the matrix 2 representing R and MRn  MR ⊙ MR ⊙ MR is the matrix representing Rn. Example 5: A  a,b,c,d,e, R  a,a,a,b,b,c,c,e,c,d,d,e

13 11000 00100

MR  00011 , 00001 00000

11000 11000 11100 00100 00100 00011

MR ⊙ MR  00011 00011  00001 00001 00001 00000 00000 00000 00000 R2  a,a,a,b,a,c,b,d,b,e,c,e

4. Composition of Paths:

Let P1: a,x1,...,xn−1,b be a path in a relation R and P2: b,y1,y2,...,ym−1,c

14 be a path in R. Then the composition of P1 and P2 is a path P  P1 ∘ P2: a,x1,...,xn−1,b,y1,...,ym−1,c of length n  m from a to c. Example 7:

15 4.4 Properties of Relations: 1. Reflexive and Irreflexive Relations: A relation R onasetA is reflexive if a,a ∈ R for all a ∈ A. A relation if irreflexive if none of a,a is in R.

Note that the diagonal entries of MR are 1’s if R is reflexive and are all 0′s if R is irreflexive. Example 1:

(a) R1  a,a| a ∈ A - reflexive

(b) R2  a,b ∈ A  A| a ≠ b - cannot be reflexive so it irreflexive

2. Symmetric, Asymmetric, and Antisymmetric Relations: A relation R is symmetric if b,a ∈ R whenever a,b ∈ R. A relation R is asymmetric if b,a ∉ R whenever a,b ∈ R. A relation R is antisymmetric if whenever a,b ∈ R and b,a ∈ R, then a  b.

16 Example 2: Let A  ℤ and R  a,b ∈ A  A| a  b R is NOT symmetric since b ≰ a if a ≤ b. So it is asymmetric. R is not antisymmetric since a  b, a ≠ b

3. Graph of a Symmetric Relation: The graph with undirected edges is called undirected graph or graph. The graph of a symmetric relation can be expressed by a undirected graph. Vertices a and b are called adjacent vertices and the matrix is called adjacent matrix.

4. Transitive Relations: A relation R onasetA is transitive if whenever a,b ∈ R and b,c ∈ R, then a,c ∈ R. Theorem 1: A relation R is transitive if and only if it satisfies the following property: If there is a path of length greater than 1 from a to b,then there is a path

17 of length 1 from a to b

5. Summary: Let R be a relation on a set of A. Reflexivity of R means that a,a ∈ R for all a ∈ A. Symmetry of R means that a,b ∈ R if and only if b,a ∈ R. Transitivity of R means that a,b ∈ R and b,c ∈ R implies a,c ∈ R.

18 4.5 Equivalence Relations A relation R onasetA is an if it is reflexive, symmetric and transitive. Example: a ≡ b (mod n) "a is congruent to b mod n" meaning a  qn  r and b  pn  r

Note: fna  fnb or a − b  q − pn, n|a − b Determine if R  a,b | a ≡ b (mod 2) is an equivalence relation. Example: Let A  ℤ and let n ∈ ℤ. Define R  a,b ∈ A  A| a ≡ b mod n n3 example: R  a,b ∈ A  A| a ≡ b mod 3 For m  0,1,2,..., 0,3m ∈ R, 1,3m  1 ∈ R, 2,3m  2 ∈ R Define R0  b ∈ A| b ≡ 0 mod 3 , R1  b ∈ A| b ≡ 1 mod 3 and R2  b ∈ A| b ≡ 2 mod 3 .

19 R0, R1 and R2 are called the equivalence classes of R, denoted as a, a  0,1,2. Notes: (a) P  R0, R1, R2 forms a partition of A. (b) R0  R3. We say, Ra and Rb are distinct if and only if Ra ≠ Rb.

Theorem 2: Let R be an equivalent relation on A and P be a collection of all distinct relative sets Ra for all a in A. Then P is a partition of A, and R is the equivalence relation determined by P.

Quotient set: P  A/R, is a special quotient set of A. Example: P  R0, R1, R2 the quotient set of ℤ constructed from R.

20