Applied Discrete Mathematics Week 10: Equivalence Relations

Slides:



Advertisements
Similar presentations
CSE 211- Discrete Structures
Advertisements

Relations Relations on a Set. Properties of Relations.
Representing Relations Rosen 7.3. Using Matrices For finite sets we can use zero-one matrices. Elements of each set A and B must be listed in some particular.
CSE115/ENGR160 Discrete Mathematics 04/26/12 Ming-Hsuan Yang UC Merced 1.
8.3 Representing Relations Connection Matrices Let R be a relation from A = {a 1, a 2,..., a m } to B = {b 1, b 2,..., b n }. Definition: A n m  n connection.
Representing Relations Using Matrices
5/16/20151 You Never Escape Your… Relations. 5/16/20152Relations If we want to describe a relationship between elements of two sets A and B, we can use.
Applied Discrete Mathematics Week 11: Graphs
Relations Chapter 9.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
Applied Discrete Mathematics Week 10: Equivalence Relations
Exam 2 Review 7.5, 7.6, |A1  A2  A3| =∑|Ai| - ∑|Ai ∩ Aj| + |A1∩ A2 ∩ A3| |A1  A2  A3  A4| =∑|Ai| - ∑|Ai ∩ Aj| + ∑ |Ai∩ Aj ∩ Ak| - |A1∩
CS Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 Ofc hr: Thur, 9:30-11:30a Fall 2002KSU - Discrete Structures1.
April 10, 2002Applied Discrete Mathematics Week 10: Relations 1 Counting Relations Example: How many different reflexive relations can be defined on a.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Chapter 9. Section 9.1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and.
Discrete Structures1 You Never Escape Your… Relations.
April 14, 2015Applied Discrete Mathematics Week 10: Equivalence Relations 1 Properties of Relations Definition: A relation R on a set A is called transitive.
Fall 2002CMSC Discrete Structures1 You Never Escape Your… Relations.
Relations. Important Definitions We covered all of these definitions on the board on Monday, November 7 th. Definition 1 Definition 2 Definition 3 Definition.
Lecture on Relations 1Developed by CSE Dept., CIST Bhopal.
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
Discrete Structures – CNS2300
Problem Statement How do we represent relationship between two related elements ?
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Representing Relations Using Matrices A relation between finite sets can be represented using a zero-one matrix Suppose R is a relation from A = {a 1,
Chapter Relations and Their Properties
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
8.4 Closures of Relations Definition: The closure of a relation R with respect to property P is the relation obtained by adding the minimum number of.
Section 7.3: Representing Relations In this section, we will cover two ways to represent a relation over a finite set other than simply listing the relation.
Section 9.3. Section Summary Representing Relations using Matrices Representing Relations using Digraphs.
Module Code MA1032N: Logic Lecture for Week Autumn.
Chapter8 Relations 8.1: Relations and their properties.
Representing Relations Using Digraphs
Discrete Mathematical
Relations and Their Properties
Chapter 5 Relations and Operations
Relations.
CSE 504 Discrete Mathematics & Foundations of Computer Science
CSNB 143 Discrete Mathematical Structures
Applied Discrete Mathematics Week 14: Trees
Relations Binary relations represent relationships between the elements of two sets. A binary relation R from set A to set B is defined by: R  A 
Relations Chapter 9.
Applied Discrete Mathematics Week 5: Mathematical Reasoning
Applied Discrete Mathematics Week 13: Graphs
Special Graphs By: Sandeep Tuli Astt. Prof. CSE.
Applied Discrete Mathematics Week 10: Relations
Representing Relations
Dr. Ameria Eldosoky Discrete mathematics
CSE115/ENGR160 Discrete Mathematics 04/28/11
CSNB 143 Discrete Mathematical Structures
Mathematical Structures for Computer Science Chapter 6
Applied Discrete Mathematics Week 9: Equivalence Relations
CMSC Discrete Structures
Chapter 2 Sets Homework 3 Given U = { 1, 2, 3, 4, 5, 6, 7, 8, 9 } as a set universe and the sets : A = { 1, 2, 3, 4, 5 }, B = { 4, 5, 6, 7 }, C = { 5,
Sequences and Summations
CS2210 Discrete Structures Relations
Relations.
Applied Discrete Mathematics Week 6: Relations/Digraphs
CS100: Discrete structures
Properties of Relations
Discrete Math (2) Haiming Chen Associate Professor, PhD
Combining relations via relational composition
Applied Discrete Mathematics Week 13: Graphs
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Chapter 8 (Part 2): Relations
Agenda Lecture Content: Relations (Relasi)
Applied Discrete Mathematics Week 4: Functions
Representing Relations Using Matrices
Presentation transcript:

Applied Discrete Mathematics Week 10: Equivalence Relations Combining Relations We already know that functions are just special cases of relations (namely those that map each element in the domain onto exactly one element in the codomain). If we formally convert two functions into relations, that is, write them down as sets of ordered pairs, the composite of these relations will be exactly the same as the composite of the functions (as defined earlier). April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Applied Discrete Mathematics Week 10: Equivalence Relations Combining Relations Definition: Let R be a relation on the set A. The powers Rn, n = 1, 2, 3, …, are defined inductively by R1 = R Rn+1 = RnR In other words: Rn = RR … R (n times the letter R) April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Applied Discrete Mathematics Week 10: Equivalence Relations Combining Relations Theorem: The relation R on a set A is transitive if and only if Rn  R for all positive integers n. Remember the definition of transitivity: Definition: A relation R on a set A is called transitive if whenever (a, b)R and (b, c)R, then (a, c)R for a, b, cA. The composite of R with itself contains exactly these pairs (a, c). Therefore, for a transitive relation R, RR does not contain any pairs that are not in R, so RR  R. Since RR does not introduce any pairs that are not already in R, it must also be true that (RR)R  R, and so on, so that Rn  R. April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations We already know different ways of representing relations. We will now take a closer look at two ways of representation: Zero-one matrices and directed graphs. If R is a relation from A = {a1, a2, …, am} to B = {b1, b2, …, bn}, then R can be represented by the zero-one matrix MR = [mij] with mij = 1, if (ai, bj)R, and mij = 0, if (ai, bj)R. Note that for creating this matrix we first need to list the elements in A and B in a particular, but arbitrary order. April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations Example: How can we represent the relation R from the set A = {1, 2, 3} to the set B = {1, 2} with R = {(2, 1), (3, 1), (3, 2)} as a zero-one matrix? Solution: The matrix MR is given by April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations What do we know about the matrices representing a relation on a set (a relation from A to A) ? They are square matrices. What do we know about matrices representing reflexive relations? All the elements on the diagonal of such matrices Mref must be 1s. April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations What do we know about the matrices representing symmetric relations? These matrices are symmetric, that is, MR = (MR)t. symmetric matrix, symmetric relation. non-symmetric matrix, non-symmetric relation. April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations The Boolean operations join and meet (you remember?) can be used to determine the matrices representing the union and the intersection of two relations, respectively. To obtain the join of two zero-one matrices, we apply the Boolean “or” function to all corresponding elements in the matrices. To obtain the meet of two zero-one matrices, we apply the Boolean “and” function to all corresponding elements in the matrices. April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations Example: Let the relations R and S be represented by the matrices What are the matrices representing RS and RS? Solution: These matrices are given by April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations Using Matrices Do you remember the Boolean product of two zero-one matrices? Let A = [aij] be an mk zero-one matrix and B = [bij] be a kn zero-one matrix. Then the Boolean product of A and B, denoted by AB, is the mn matrix with (i, j)th entry [cij], where cij = (ai1  b1j)  (ai2  b2j)  …  (aik  bkj). cij = 1 if and only if at least one of the terms (ain  bnj) = 1 for some n; otherwise cij = 0. April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations Using Matrices Let us now assume that the zero-one matrices MA = [aij], MB = [bij] and MC = [cij] represent relations A, B, and C, respectively. Remember: For MC = MAMB we have: cij = 1 if and only if at least one of the terms (ain  bnj) = 1 for some n; otherwise cij = 0. In terms of the relations, this means that C contains a pair (xi, zj) if and only if there is an element yn such that (xi, yn) is in relation A and (yn, zj) is in relation B. Therefore, C = BA (composite of A and B). April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations Using Matrices This gives us the following rule: MBA = MAMB In other words, the matrix representing the composite of relations A and B is the Boolean product of the matrices representing A and B. Analogously, we can find matrices representing the powers of relations: MRn = MR[n] (n-th Boolean power). April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations Using Matrices Example: Find the matrix representing R2, where the matrix representing R is given by Solution: The matrix for R2 is given by April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations Using Digraphs Definition: A directed graph, or digraph, consists of a set V of vertices (or nodes) together with a set E of ordered pairs of elements of V called edges (or arcs). The vertex a is called the initial vertex of the edge (a, b), and the vertex b is called the terminal vertex of this edge. We can use arrows to display graphs. April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations Using Digraphs Example: Display the digraph with V = {a, b, c, d}, E = {(a, b), (a, d), (b, b), (b, d), (c, a), (c, b), (d, b)}. a b d c An edge of the form (b, b) is called a loop. April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Representing Relations Using Digraphs Obviously, we can represent any relation R on a set A by the digraph with A as its vertices and all pairs (a, b)R as its edges. Vice versa, any digraph with vertices V and edges E can be represented by a relation on V containing all the pairs in E. This one-to-one correspondence between relations and digraphs means that any statement about relations also applies to digraphs, and vice versa. April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Applied Discrete Mathematics Week 10: Equivalence Relations Closures of Relations What is the closure of a relation? Definition: Let R be a relation on a set A. R may or may not have some property P, such as reflexivity, symmetry, or transitivity. If there is a relation S that contains R and has property P, and S is a subset of every relation that contains R and has property P, then S is called the closure of R with respect to P. Note that the closure of a relation with respect to a property may not exist. April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations

Applied Discrete Mathematics Week 10: Equivalence Relations Closures of Relations Example I: Find the reflexive closure of relation R = {(1, 1), (1, 2), (2, 1), (3, 2)} on the set A = {1, 2, 3}. Solution: We know that any reflexive relation on A must contain the elements (1, 1), (2, 2), and (3, 3). By adding (2, 2) and (3, 3) to R, we obtain the reflexive relation S, which is given by S = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 2), (3, 3)}. S is reflexive, contains R, and is contained within every reflexive relation that contains R. Therefore, S is the reflexive closure of R. April 10, 2018 Applied Discrete Mathematics Week 10: Equivalence Relations