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.

Slides:



Advertisements
Similar presentations
Representing Relations
Advertisements

Partial Orderings Section 8.6.
CSE 211- Discrete Structures
CSNB143 – Discrete Structure
Chapter Matrices Matrix Arithmetic
Relations Relations on a Set. Properties of Relations.
CSE115/ENGR160 Discrete Mathematics 04/26/12 Ming-Hsuan Yang UC Merced 1.
8.3 Representing Relations. Consider the following relations on A={1,2,3,4} Consider the matrixM R1 = | | | | | | | |
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)
Basic Properties of 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.
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.
MATRICES. Matrices A matrix is a rectangular array of objects (usually numbers) arranged in m horizontal rows and n vertical columns. A matrix with m.
1 Representing Relations Epp section ??? CS 202 Aaron Bloomfield.
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.
Chapter 4 Relations and Digraphs
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.
Lecture 14 Relations CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Chapter 4 – Matrix CSNB 143 Discrete Mathematical Structures.
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.
Based on slides by Y. Peng University of Maryland
Discrete Structures1 You Never Escape Your… Relations.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 8 Relations 歐亞書局.
Discrete Mathematics Relation.
Fall 2002CMSC Discrete Structures1 You Never Escape Your… Relations.
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.
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.
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.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 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.
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.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
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.
Discrete Mathematical
Relations and Their Properties
Relations.
Learn about relations and their basic properties
Relations Chapter 9.
Representing Relations
CSE115/ENGR160 Discrete Mathematics 04/28/11
Mathematical Structures for Computer Science Chapter 6
Applied Discrete Mathematics Week 10: Equivalence Relations
CSE 321 Discrete Structures
Properties of 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:

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 (but arbitrary) order. When A=B we use the same ordering for A and B. m ij = 1 if (a i,b j )  R = 0 if (a i,b j )  R

Example Zero-One Matrix b1b2b3 a1 a2 a3 R = {(a1,b1), (a1,b2), (a2,b2), (a3,b2), (a3,b3)}

Matrix of a relation on a set, A Can be used to determine whether the relations has certain properties. Recall that R on A is reflexive if (a,a)  R for every element a  A. ReflexiveNot Reflexive

A relation R on a set A is called Symmetric if (b,a)  R whenever (a,b)  R for a,b  A. M R = (M R ) t is Antisymmetric if (a,b)  R and (b,a)  R only if a=b for a,b  A is antisymmetric. –If m ij = 1, i  j, m ji = 0 SymmetricAntisymmetricNeither

Examples Reflexive Symmetric Reflexive Antisymmetric

Let R1, R2 be relations on A A = {1,2,3} R1 = {(1,1), (1,3), (2,1), (3,3)} R2 = {(1,1), (1,2), (1,3), (2,2), (2,3), (3,1)}

R1  R2, R1  R2 M R1  R2 = M R1  M R2, M R1  R2 = M R1  M R2

What is R2  R1? The composite of R 1 and R 2 is the relation consisting of ordered pairs (a,c) where a  A, c  A, and for which there exists an element b  A such that (a,b)  R 1 and (b,c)  R 2. R2  R1 = {(1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1)} R1 = {(1,1), (1,3), (2,1), (3,3)} R2 = {(1,1), (1,2), (1,3), (2,2), (2,3), (3,1)}

Boolean Product Let A = [a ij ] be an m by k zero-one matrix and B = [b ij ] be a k by n zero-one matrix. Then the Boolean Product of A and B denoted by A B is the m by n matrix with i,j entry c ij where c ij = (a i1  b 1j )  (a i2  b 2j ) ...  (a ik  b kj ).

What is R2  R1? R2  R1 = {(1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1)} M R2  R1 =M R1 M R2

Directed Graphs (Digraph) A directed graph consists of a set V of vertices together with a set E of ordered pairs of elements of V called edges. –(a,b), a is initial vertex, b is the terminal vertex a b c Reflexive (Loops at all vertices) Symmetric (All edges both ways)

Relation R on a set A a b c R = {(a,b), (b,b), (b,c), (c,a), (c,c)} Transitive? No a b c R = {(a,b), (b,b), (b,c), (a,c), (c,c)} Transitive? Yes Rosen, pp

Relation R on a set A a b c R = {(a,a), (a,c), (b,b), (b,a), (b,c), (c,c)} Reflexive Antisymmetric Transitive