CSE115/ENGR160 Discrete Mathematics 04/26/12 Ming-Hsuan Yang UC Merced 1.

Slides:



Advertisements
Similar presentations
Representing Relations
Advertisements

Partial Orderings Section 8.6.
Discrete Mathematics 3. MATRICES, RELATIONS, AND FUNCTIONS Lecture 5 Dr.-Ing. Erwin Sitompul
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.
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.
1 Section 7.3 Representing relations (part 1: matrices)
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.
Discrete Mathematics Lecture # 16 Inverse of Relations.
CSE115/ENGR160 Discrete Mathematics 05/03/11 Ming-Hsuan Yang UC Merced 1.
Recursive Definitions Rosen, 3.4 Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
1 Representing Relations Part 2: directed graphs.
Discrete Mathematics Lecture#11.
1 Representing Relations Epp section ??? CS 202 Aaron Bloomfield.
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
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.
Unit Unit 04 Relations IT DisiciplineITD1111 Discrete Mathematics & Statistics STDTLP1 Unit 4 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.
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.
Fall 2002CMSC Discrete Structures1 You Never Escape Your… Relations.
1 RELATIONS Learning outcomes Students are able to: a. determine the properties of relations – reflexive, symmetric, transitive, and antisymmetric b. determine.
Matrices Section 2.6. Section Summary Definition of a Matrix Matrix Arithmetic Transposes and Powers of Arithmetic Zero-One matrices.
Relations. Important Definitions We covered all of these definitions on the board on Monday, November 7 th. Definition 1 Definition 2 Definition 3 Definition.
1 Chapter Equivalence, Order, and Inductive Proof.
Lecture on Relations 1Developed by CSE Dept., CIST Bhopal.
Discrete Mathematics Lecture # 15 Types of Relations (contd.)
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.
Unit II Discrete Structures Relations and Functions SE (Comp.Engg.)
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
Relations Section 9.1, 9.3—9.5 of Rosen Spring 2012
1 Section 4.1 Properties of Binary Relations A binary relation R over a set A is a subset of A  A. If (x, y)  R we also write x R y. Example. Some sample.
Equivalence Relations
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.
RelationsCSCE 235, Spring Introduction A relation between elements of two sets is a subset of their Cartesian products (set of all ordered pairs.
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.
CS 285- Discrete Mathematics Lecture 11. Section 3.8 Matrices Introduction Matrix Arithmetic Transposes and Power of Matrices Zero – One Matrices Boolean.
A very brief introduction to Matrix (Section 2.7) Definitions Some properties Basic matrix operations Zero-One (Boolean) matrices.
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
Relations.
CSE 2813 Discrete Structures
Partial Orderings CSE 2813 Discrete Structures.
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 
Relations Chapter 9.
Relations and Digraphs
Representing Relations
CSE115/ENGR160 Discrete Mathematics 04/28/11
Mathematical Structures for Computer Science Chapter 6
Applied Discrete Mathematics Week 10: Equivalence Relations
Discrete Math (2) Haiming Chen Associate Professor, PhD
Combining relations via relational composition
Chapter 8 (Part 2): Relations
Agenda Lecture Content: Relations (Relasi)
Representing Relations Using Matrices
Presentation transcript:

CSE115/ENGR160 Discrete Mathematics 04/26/12 Ming-Hsuan Yang UC Merced 1

9.3 Representing relations Can use ordered set, graph to represent sets Generally, matrices are better choice Suppose that R is a relation from A={a 1, a 2, …, a m } to B={b 1, b 2, …, b n }. The relation R can be represented by the matrix M R =[m ij ] where m ij =1 if (a i,b j ) ∊R, m ij =0 if (a i,b j ) ∉ R, A zero-one (binary) matrix 2

Example Suppose that A={1,2,3} and B={1,2}. Let R be the relation from A to B containing (a,b) if a ∈ A, b ∈ B, and a > b. What is the matrix representing R if a 1 =1, a 2 =2, and a 3 =3, and b 1 =1, and b 2 =2 As R={(2,1), (3,1), (3,2)}, the matrix R is 3

Matrix and relation properties The matrix of a relation on a set, which is a square matrix, can be used to determine whether the relation has certain properties Recall that a relation R on A is reflexive if (a,a) ∈ R. Thus R is reflexive if and only if (a i,a i ) ∈ R for i=1,2,…,n Hence R is reflexive iff m ii =1, for i=1,2,…, n. R is reflexive if all the elements on the main diagonal of M R are 1 4

Symmetric The relation R is symmetric if (a,b) ∈ R implies that (b,a) ∈ R In terms of matrix, R is symmetric if and only m ji =1 whenever m ij =1, i.e., M R =(M R ) T R is symmetric iff M R is a symmetric matrix 5

Antisymmetric The relation R is symmetric if (a,b) ∈ R and (b,a) ∈ R imply a=b The matrix of an antisymmetric relation has the property that if m ij =1 with i ≠ j, then m ji =0 Either m ij =0 or m ji =0 when i ≠ j 6

Example Suppose that the relation R on a set is represented by the matrix Is R reflexive, symmetric or antisymmetric? As all the diagonal elements are 1, R is reflexive. As M R is symmetric, R is symmetric. It is also easy to see R is not antisymmetric 7

Union, intersection of relations Suppose R1 and R2 are relations on a set A represented by M R1 and M R2 The matrices representing the union and intersection of these relations are M R1 ⋃ R2 = M R1 ⋁ M R2 M R1 ⋂ R2 = M R1 ⋀ M R2 8

Example Suppose that the relations R 1 and R 2 on a set A are represented by the matrices What are the matrices for R 1 ⋃ R 2 and R 1 ⋂ R 2 ? 9

Composite of relations Suppose R is a relation from A to B and S is a relation from B to C. Suppose that A, B, and C have m, n, and p elements with M S, M R Use Boolean product of matrices Let the zero-one matrices for S ∘ R, R, and S be M S ∘ R =[t ij ], M R =[r ij ], and M S =[s ij ] (these matrices have sizes m × p, m × n, n × p) The ordered pair (a i, c j ) ∈ S ∘ R iff there is an element b k s.t.. (a i, b k ) ∈ R and (b k, c j ) ∈ S It follows that t ij =1 iff r ik =s kj =1 for some k M S ∘ R = M R ⊙ M S 10

Boolean product (Section 3.8) Boolean product A B is defined as 11 ⊙ Replace x with ⋀ and + with ⋁

Boolean power (Section 3.8) Let A be a square zero-one matrix and let r be positive integer. The r-th Boolean power of A is the Boolean product of r factors of A, denoted by A [r] A [r] =A ⊙A ⊙A… ⊙A r times 12

Example Find the matrix representation of S ∘ R 13

Powers R n For powers of a relation The matrix for R2 is 14

Representing relations using digraphs 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 vertex b is called the terminal vertex of the edge An edge of the form (a,a) is called a loop 15

Example The directed graph with vertices a, b, c, and d, and edges (a,b), (a,d), (b,b), (b,d), (c,a), (c,b), and (d,b) is shown 16

Example R is reflexive. R is neither symmetric (e.g., (a,b)) nor antisymmetric (e.g., (b,c), (c,b)). R is not transitive (e.g., (a,b), (b,c)) S is not reflexive. S is symmetric but not antisymmetric (e.g., (a,c), (c,a)). S is not transitive (e.g., (c,a), (a,b)) 17