
Discrete Mathematics (c) Marcin Sydow Properties Equivalence Discrete Mathematics relation Relations Order relation N-ary relations (c) Marcin Sydow Contents Discrete Mathematics (c) Marcin Sydow Properties binary relation Equivalence relation domain, codomain, image, preimage Order inverse and composition relation N-ary properties of relations relations closure of relation equivalence relation order relation Binary relation Discrete Mathematics (c) Marcin Sydow Properties Let A; B be two sets. A binary relation between the elements Equivalence relation of A and B is any subset of the Cartesian product of A and B, Order i.e. R ⊆ A × B. relation N-ary We denote relations by capital letters, e.g. R; S, etc. relations We say that two elements a 2 A and b 2 B are in relation R iff the pair (a; b) 2 R (it can be also denoted as: aRb). Examples Discrete Mathematics (c) Marcin Sydow Properties Equivalence relation empty relation (no pair belongs to it) Order relation diagonal relation ∆ = f(x; x): x 2 X g (it is the “equality” N-ary relation) relations full relation: any pair belongs to it (i.e. R = X 2) Binary relation as a predicate and as a graph Discrete Mathematics (c) Marcin Sydow Properties Binary relation can be represented as a predicate with 2 free Equivalence relation variables as follows: Order relation Given a predicate R(x; y), for x 2 X and y 2 Y , the relation is N-ary the set of all pairs (x; y) 2 X × Y that satisfy the predicate relations (i.e. make it true) Each binary relation can be naturally represented as a graph. Example Discrete Mathematics (c) Marcin Sydow Properties Equivalence relation R(x; y): “x is less than y” Order relation The relation R represented by the above predicate is the set of N-ary relations all pairs (x; y) 2 X × Y so that R(x; y) is true (i.e. x < y) Examples of binary relations Discrete Mathematics (c) Marcin Sydow A = B = N Properties Equivalence diagonal relation ∆ (x = y) relation Order x > y relation x ≤ y N-ary relations x is a divisor of y x and y have common divisor x2 + y 2 ≥ 10 More examples Discrete Mathematics (c) Marcin Sydow Properties Examples of relations on the set P × P, where P is the set of all Equivalence people. relation Order relation (x; y) 2 R , x is a son of y N-ary (x; y) 2 R , x is the mother of y relations (x; y) 2 R , x is the father of y (x; y) 2 R , x is a grandmother of y More examples Discrete Mathematics (c) Marcin Sydow Properties Examples of R ⊆ P × C, where C is the set of all courses in the Equivalence relation univeristy for last 5 years. Order relation (p; c) 2 R , p passed course c N-ary relations (p; c) 2 R , p attended course c (p; c) 2 R , p thinks course c is interesting Domain and co-domain of relation Discrete Mathematics (c) Marcin Sydow Properties Equivalence relation For binary relation R ⊆ A × B, the set A is called its domain Order relation and B is called its co-domain N-ary relations Domain and co-domain can be the same set. Image and pre-image of relation Discrete Mathematics (c) Marcin Sydow Properties Equivalence relation Pre-image of binary relation R ⊆ X × Y : Order fx 2 X : 9y 2 Y (x; y) 2 Rg relation N-ary Image of binary relation R ⊆ X × Y : relations fy 2 Y : 9x 2 X (x; y) 2 Rg f(5; 3); (5; 4); (6; 3); (6; 4); (6; 5)g domain of R?: A co-domain of R?: B pre-image of R?: f5; 6g image of R?: f3; 4; 5g Example Discrete Mathematics (c) Marcin Sydow Properties A = f1; 3; 5; 6g, B = f3; 4; 5; 6; 7g. Relation R ⊆ A × B is Equivalence defined as follows: relation Order xRy , x > y relation R =? N-ary relations A co-domain of R?: B pre-image of R?: f5; 6g image of R?: f3; 4; 5g Example Discrete Mathematics (c) Marcin Sydow Properties A = f1; 3; 5; 6g, B = f3; 4; 5; 6; 7g. Relation R ⊆ A × B is Equivalence defined as follows: relation Order xRy , x > y relation R =? f(5; 3); (5; 4); (6; 3); (6; 4); (6; 5)g N-ary relations domain of R?: B pre-image of R?: f5; 6g image of R?: f3; 4; 5g Example Discrete Mathematics (c) Marcin Sydow Properties A = f1; 3; 5; 6g, B = f3; 4; 5; 6; 7g. Relation R ⊆ A × B is Equivalence defined as follows: relation Order xRy , x > y relation R =? f(5; 3); (5; 4); (6; 3); (6; 4); (6; 5)g N-ary relations domain of R?: A co-domain of R?: f5; 6g image of R?: f3; 4; 5g Example Discrete Mathematics (c) Marcin Sydow Properties A = f1; 3; 5; 6g, B = f3; 4; 5; 6; 7g. Relation R ⊆ A × B is Equivalence defined as follows: relation Order xRy , x > y relation R =? f(5; 3); (5; 4); (6; 3); (6; 4); (6; 5)g N-ary relations domain of R?: A co-domain of R?: B pre-image of R?: f3; 4; 5g Example Discrete Mathematics (c) Marcin Sydow Properties A = f1; 3; 5; 6g, B = f3; 4; 5; 6; 7g. Relation R ⊆ A × B is Equivalence defined as follows: relation Order xRy , x > y relation R =? f(5; 3); (5; 4); (6; 3); (6; 4); (6; 5)g N-ary relations domain of R?: A co-domain of R?: B pre-image of R?: f5; 6g image of R?: Example Discrete Mathematics (c) Marcin Sydow Properties A = f1; 3; 5; 6g, B = f3; 4; 5; 6; 7g. Relation R ⊆ A × B is Equivalence defined as follows: relation Order xRy , x > y relation R =? f(5; 3); (5; 4); (6; 3); (6; 4); (6; 5)g N-ary relations domain of R?: A co-domain of R?: B pre-image of R?: f5; 6g image of R?: f3; 4; 5g “x is a parent of y”? Inverse of relation Discrete Mathematics (c) Marcin Sydow Properties Equivalence If R ⊆ X × Y is a binary relation then its inverse relation R−1 ⊆ Y × X is defined as R−1 = f(y; x):(x; y) 2 Rg Order relation Examples: what is the inverse of: N-ary relations “x < y”? Inverse of relation Discrete Mathematics (c) Marcin Sydow Properties Equivalence If R ⊆ X × Y is a binary relation then its inverse relation R−1 ⊆ Y × X is defined as R−1 = f(y; x):(x; y) 2 Rg Order relation Examples: what is the inverse of: N-ary relations “x < y”? “x is a parent of y”? Composition of relations Discrete Mathematics If S ⊆ A × B and R ⊆ B × C are two binary relations on sets (c) Marcin Sydow A,B and B,C, respectively, then the composition of these relations, denoted as R ◦ S is the binary relation defined as Properties follows: Equivalence relation Order relation R ◦ S = f(a; c) 2 A × C : 9b2B [(a; b) 2 R ^ (b; c) 2 S]g N-ary relations Sometimes it is denoted as RS. If R = S then the composition of R with itself: R ◦ R can be denoted as R2. More than 2 relations can be composed. We denote the n-th composition of R with itself as Rn (e.g. R3 = R ◦ R ◦ R, etc.) Composition is associative, i.e.: (R ◦ S) ◦ T = R ◦ (S ◦ T ) f(1; z); (1; v); (3; z); (3; v); (2; y)g (some join operations in relational databases are based on this operator) Is composition commutative?(i.e. is R ◦ S the same as S ◦ R for any binary relations R; S?) For what binary relations their composition is commutative? Example Discrete Mathematics (c) Marcin Sydow A = f0; 1; 2; 3; 4g, B = fa; b; cg, C = fx; y; z; vg Properties R = f(1; a); (2; c); (3; a)g, Equivalence S = f(a; z); (a; v); (b; x); (b; z); (c; y)g relation Order R ◦ S =? relation N-ary relations (some join operations in relational databases are based on this operator) Is composition commutative?(i.e. is R ◦ S the same as S ◦ R for any binary relations R; S?) For what binary relations their composition is commutative? Example Discrete Mathematics (c) Marcin Sydow A = f0; 1; 2; 3; 4g, B = fa; b; cg, C = fx; y; z; vg Properties R = f(1; a); (2; c); (3; a)g, Equivalence S = f(a; z); (a; v); (b; x); (b; z); (c; y)g relation Order R ◦ S =?f(1; z); (1; v); (3; z); (3; v); (2; y)g relation N-ary relations Is composition commutative?(i.e. is R ◦ S the same as S ◦ R for any binary relations R; S?) For what binary relations their composition is commutative? Example Discrete Mathematics (c) Marcin Sydow A = f0; 1; 2; 3; 4g, B = fa; b; cg, C = fx; y; z; vg Properties R = f(1; a); (2; c); (3; a)g, Equivalence S = f(a; z); (a; v); (b; x); (b; z); (c; y)g relation Order R ◦ S =?f(1; z); (1; v); (3; z); (3; v); (2; y)g relation N-ary (some join operations in relational databases are based on this relations operator) (i.e. is R ◦ S the same as S ◦ R for any binary relations R; S?) For what binary relations their composition is commutative? Example Discrete Mathematics (c) Marcin Sydow A = f0; 1; 2; 3; 4g, B = fa; b; cg, C = fx; y; z; vg Properties R = f(1; a); (2; c); (3; a)g, Equivalence S = f(a; z); (a; v); (b; x); (b; z); (c; y)g relation Order R ◦ S =?f(1; z); (1; v); (3; z); (3; v); (2; y)g relation N-ary (some join operations in relational databases are based on this relations operator) Is composition commutative? For what binary relations their composition is commutative? Example Discrete Mathematics (c) Marcin Sydow A = f0; 1; 2; 3; 4g, B = fa; b; cg, C = fx; y; z; vg Properties R = f(1; a); (2; c); (3; a)g, Equivalence S = f(a; z); (a; v); (b; x); (b; z); (c; y)g relation Order R ◦ S =?f(1; z); (1; v); (3; z); (3; v); (2; y)g relation N-ary (some join operations in relational databases are based on this relations operator) Is composition commutative?(i.e.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages77 Page
-
File Size-