Chapter 8 (Part 2): Relations

Slides:



Advertisements
Similar presentations
CSE 211- Discrete Structures
Advertisements

Equivalence Relations
Equivalence Relations
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.
Chap6 Relations Def 1: Let A and B be sets. A binary relation from A
Relations.
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
CS2210(22C:19) Discrete Structures Relations Spring 2015 Sukumar Ghosh.
Discrete Mathematics Lecture#11.
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
Equivalence Relations MSU CSE 260. Outline Introduction Equivalence Relations –Definition, Examples Equivalence Classes –Definition Equivalence Classes.
Properties of Relations In many applications to computer science and applied mathematics, we deal with relations on a set A rather than relations from.
CS Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 Ofc hr: Thur, 9:30-11:30a Fall 2002KSU - Discrete Structures1.
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.
Discrete Math for CS Binary Relation: A binary relation between sets A and B is a subset of the Cartesian Product A x B. If A = B we say that the relation.
2.6 Equivalence Relation §1.Equivalence relation §Definition 2.18: A relation R on a set A is called an equivalence relation if it is reflexive, symmetric,
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.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
Discrete Structures1 You Never Escape Your… Relations.
Rosen, Section 8.5 Equivalence Relations
Relations and their Properties
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
Fall 2002CMSC Discrete Structures1 You Never Escape Your… Relations.
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
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 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.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 7 Relations.
Section 9.3. Section Summary Representing Relations using Matrices Representing Relations using Digraphs.
Chapter8 Relations 8.1: Relations and their properties.
Binary Relation: A binary relation between sets A and B is a subset of the Cartesian Product A x B. If A = B we say that the relation is a relation on.
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
Representing Relations Using Digraphs
Discrete Mathematical
Relations and Their Properties
Citra Noviyasari, S.Si, MT
Relations.
CSE 504 Discrete Mathematics & Foundations of Computer Science
CSE15 Discrete Mathematics 05/03/17
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 
Equivalence Relations
Relations Chapter 9.
Chapter 9 (Part 2): Graphs
Representing Relations
CSE115/ENGR160 Discrete Mathematics 04/28/11
CSE 504 Discrete Structures & Foundations of Computer Science
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 9 Relations Slides are adopted from.
CMSC Discrete Structures
Applied Discrete Mathematics Week 10: Equivalence Relations
CS2210 Discrete Structures Relations
8.5 Equivalence Relations
Discrete Math (2) Haiming Chen Associate Professor, PhD
Equivalence Relations
Relations.
Relations and Digraphs
Applied Discrete Mathematics Week 6: Relations/Digraphs
9.5 Equivalence Relations
Equivalence Relations
Equivalence Relations
Rayat Shikshan Sanstha’s S.M.Joshi College, Hadapsar -28
Chapter 4 (Part 2): Mathematical Reasoning, Induction & Recursion
Representing Relations Using Matrices
Presentation transcript:

Chapter 8 (Part 2): Relations CSE 504 Discrete Structures & Foundations of Computer Science Dr. Djamel Bouchaffra Chapter 8 (Part 2): Relations Representing Relations (8.3) Equivalence Relations (8.5) CH. 7 part 2 (Sections 7.3 & 7.5): Relations

Representing Relations (8.3) First way is to list the ordered pairs Second way is through matrices Third way is through direct graphs Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch.7 (Part 2): Relations

Representing Relations (8.3) Representing relations through matrices Example: Suppose that the relation R on a set is represented by the matrix: Is R reflexive, symmetric, and/or antisymmetric? Solution: Since all the diagonal elements of this matrix are equal to 1, R is reflexive. Moreover, since MR is symmetric  R is symmetric. R is not antisymmetric. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch.7 (Part 2): Relations

Representing Relations (8.3) Representing relations using diagraphs Definition 1: A directed graph, or diagraph, 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. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch.7 (Part 2): Relations

Representing Relations (8.3) Example: The directed graph with vertices a, b, c and d , and edges (a,b), (a,d), (b,b), (b,d), (c,a) and (d,b). The edge (b,b) is called a loop. a b c d Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch.7 (Part 2): Relations

Equivalence Relations (8.5) Students registration time with respect to the first letter of their names R contains (x,y)  x and y are students with last names beginning with letters in the same block 3 blocks are considered: A-F, G-O, P-Z R is reflexive, symmetric & transitive The set of student is therefore divided in 3 classes depending on the first letter of their names Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch.7 (Part 2): Relations

Equivalence Relations (8.5) Definition 1 A relation on a set A is called an equivalence relation if it is reflexive, symmetric and transitive. Examples : Suppose that R is the relation on the set of strings of English letters such that aRb if and only if l(a) = l(b), where l(x) is the length of the string x. Is R an equivalence relation? Solution: R is reflexive, symmetric and transitive  R is an equivalence relation A divides b; is it an equivalence relation? Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch.7 (Part 2): Relations

Equivalence Relations (8.5) Equivalence classes Definition 2: Let R be an equivalence relation on a set A. The set of all elements that are related to an element a of A is called the equivalence class of a. The equivalence class of a with respect to R is denoted by [a]R. When only one relation is under consideration, we will delete the subscript R and write [a] for this equivalence class. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch.7 (Part 2): Relations

Equivalence Relations (8.5) Example: What are the equivalences classes of 0 and 1 for congruence modulo 4? Solution: The equivalence class of 0 contains all the integers a such that a  0 (mod 4). Hence, the equivalence class of 0 for this relation is [0] = {…, -8, -4, 0, 4, 8, …} The equivalence class of 1 contains all the integers a such that a  1 (mod 4). The integers in this class are those that have a remainder of 1 when divided by 4. Hence, the equivalence class of 1 for this relation is [1] = {…, -7, -3, 1, 5, 9, …} Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch.7 (Part 2): Relations

Equivalence Relations (8.5) Equivalence classes & partitions Theorem 1: Let R be an equivalence relation on a set A. These statements are equivalent: a R b [a] = [b] [a]  [b]   Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch.7 (Part 2): Relations

Equivalence Relations (8.5) Theorem 2: Let R be an equivalence relation on a set S. Then the equivalence classes of R form a partition of S. Conversely, given a partition {Ai | i I} of the set S, there is an equivalence relation R that has the sets Ai , i  I, as its equivalence classes. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch.7 (Part 2): Relations

Equivalence Relations (8.5) Example: List the ordered pairs in the equivalence relation R produced by the partition A1 = [1,2,3}, A2 = {4,5} and A3 = {6} of S = {1,2,3,4,5,6} Solution: The subsets in the partition are the equivalences classes of R. The pair (a,b)  R if and only if a and b are in the same subset of the partition. The pairs (1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1), (3,2) and (3,3)  R  A1 = [1,2,3} is an equivalence class. The pairs (4,4), (4,5), (5,4) and (5,5)  R  A2 = {4,5} is an equivalence class. The pair (6,6)  R  {6} is an equivalence class. No pairs other than those listed belongs to R. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch.7 (Part 2): Relations