Module #21 - Relations 1 8.3 Representing Relations Rosen 6 th ed., Ch. 8.

Slides:



Advertisements
Similar presentations
Representing Relations
Advertisements

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.
Basic Properties of Relations
Discrete Mathematics Lecture # 16 Inverse of Relations.
In The Name of Allah Discrete Structures Instructor: Dr. Ali Movaghar
1 Representing Relations Part 2: directed graphs.
1 Relations Rosen 5 th ed., ch Relations Relationships between elements of sets occur very often.Relationships between elements of sets occur very.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank and Modified By Mingwu Chen Relations.
Discussion #26 Chapter 5, Sections /15 Discussion #26 Binary Relations: Operations & Properties.
Discrete Mathematics Lecture#11.
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.
Relations (1) Rosen 6 th ed., ch. 8. Binary Relations Let A, B be any two sets. A binary relation R from A to B, written (with signature) R:A↔B, is a.
Module #18: Relations, part I
Relations Rosen 5 th ed., ch. 7. Binary Relations Let A, B be any sets. A binary relation R from A to B, written (with signature) R:A×B, or R:A,B, is.
Chapter 4 Relations and Digraphs
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
1 Relations Rosen 6 th ed., § Relations Re lationships between elements of sets occur in many contextsRe lationships between elements of sets occur.
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.
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.
Digraphs and Relations Warm Up. The Divisibility Relation Let “|” be the binary relation on N×N such that a|b (“a divides b”) iff there is an n ∈ N such.
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 8 Relations 歐亞書局.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Relations.
Discrete Mathematics Relation.
Representing Relations
§ 每周五交作业,作业成绩占总成绩的 10% ; § 平时不定期的进行小测验,占总成绩的 20% ; § 期中考试成绩占总成绩的 20% ;期终考 试成绩占总成绩的 50% § 每周五下午 1 ; 00—3 : 00 ,答疑 § 地点:软件楼 301.
Relations. Important Definitions We covered all of these definitions on the board on Monday, November 7 th. Definition 1 Definition 2 Definition 3 Definition.
이산수학 (Discrete Mathematics) 7.3 관계의 표현 (Representing Relations) 2006 년 봄학기 문양세 강원대학교 컴퓨터과학과.
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.
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
1 RELATIONS Learning outcomes Students are able to: a. determine the properties of relations – reflexive, symmetric, transitive, and antisymmetric b. determine.
Relations Section 9.1, 9.3—9.5 of Rosen Spring 2012
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.
RelationsCSCE 235, Spring Introduction A relation between elements of two sets is a subset of their Cartesian products (set of all ordered pairs.
Relations and Functions ORDERED PAIRS AND CARTESIAN PRODUCT An ordered pair consists of two elements, say a and b, in which one of them, say a is designated.
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 B = {a,b} {( 0, 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.
Lecture 7: Relations Dr Andrew Purkiss-Trew Cancer Research UK Mathematics for Computing.
Chapter8 Relations 8.1: Relations and their properties.
15.1 CompSci 102© Michael Frank Today’s topics RelationsRelations –Kinds of relations –n-ary relations –Representations of relations Reading: Sections.
Relations Chapter 9.
Relations and Digraphs
Representing Relations
Dr. Ameria Eldosoky Discrete mathematics
CSE115/ENGR160 Discrete Mathematics 04/28/11
Relations Rosen 5th ed., ch. 7.
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,
Discrete Mathematics and its Applications
§7.3 Representing Relations Longin Jan Latecki
Rosen 5th ed., ch. 7 ~32 slides (in progress), ~2 lectures
Relations and Their Properties
Relations: representation and closures
Relations and Digraphs
Relations and their Properties
Combining relations via relational composition
§7.3 Representing Relations Longin Jan Latecki
Agenda Lecture Content: Relations (Relasi)
Relations 12/7/2019.
4.4 Properties of Relations
Presentation transcript:

Module #21 - Relations Representing Relations Rosen 6 th ed., Ch. 8

Module #21 - Relations 2 §8.3: Representing Relations Some ways to represent n-ary relations:Some ways to represent n-ary relations: –With an explicit list or table of its tuples. –With a function from the domain to {T,F}. Or with an algorithm for computing this function.Or with an algorithm for computing this function. Some special ways to represent binary relations:Some special ways to represent binary relations: –With a zero-one matrix. –With a directed graph.

Module #21 - Relations 3 Using Zero-One Matrices To represent a binary relation R:A×B by an |A|×|B| 0-1 matrix M R = [m ij ], let m ij = 1 iff (a i,b j )  R.To represent a binary relation R:A×B by an |A|×|B| 0-1 matrix M R = [m ij ], let m ij = 1 iff (a i,b j )  R. E.g., Suppose Joe likes Susan and Mary, Fred likes Mary, and Mark likes Sally.E.g., Suppose Joe likes Susan and Mary, Fred likes Mary, and Mark likes Sally. Then the 0-1 matrix representation of the relation Likes:Boys×Girls relation is:Then the 0-1 matrix representation of the relation Likes:Boys×Girls relation is:

Module #21 - Relations 4 Properties of Relations Reflexivity: A relation R on A×A is reflexive if for all a ∈ A, (a,a) ∈ R.Reflexivity: A relation R on A×A is reflexive if for all a ∈ A, (a,a) ∈ R. Symmetry: A relation R on A×A is symmetric if (x,y) ∈ R implies (y,x) ∈ R.Symmetry: A relation R on A×A is symmetric if (x,y) ∈ R implies (y,x) ∈ R. Anti-symmetry:Anti-symmetry: A relation on A×A is anti-symmetric if (a,b) ∈ R and (b,a) ∈ R implies a = b. A relation on A×A is anti-symmetric if (a,b) ∈ R and (b,a) ∈ R implies a = b.

Module #21 - Relations 5 Zero-One Reflexive, Symmetric Terms: Reflexive, symmetric, and antisymmetric.Terms: Reflexive, symmetric, and antisymmetric. –These relation characteristics are very easy to recognize by inspection of the zero-one matrix. Reflexive: all 1’s on diagonal Symmetric: all identical across diagonal Antisymmetric: all 1’s are across from 0’s any- thing anything

Module #21 - Relations 6 Using Directed Graphs A directed graph or digraph G=(V G,E G ) is a set V G of vertices (nodes) with a set E G  V G ×V G of edges (arcs,links). Visually represented using dots for nodes, and arrows for edges. Notice that a relation R:A×B can be represented as a graph G R =(V G =A  B, E G =R).A directed graph or digraph G=(V G,E G ) is a set V G of vertices (nodes) with a set E G  V G ×V G of edges (arcs,links). Visually represented using dots for nodes, and arrows for edges. Notice that a relation R:A×B can be represented as a graph G R =(V G =A  B, E G =R). Matrix representation M R : Graph rep. G R : Joe Fred Mark Susan Mary Sally Node set V G (black dots) Edge set E G (blue arrows)

Module #21 - Relations 7 Digraph Reflexive, Symmetric It is extremely easy to recognize the reflexive/irreflexive/ symmetric/antisymmetric properties by graph inspection.       Reflexive: Every node has a self-loop Irreflexive: No node links to itself Symmetric: Every link is bidirectional   Antisymmetric: No link is bidirectional    These are asymmetric & non-antisymmetricThese are non-reflexive & non-irreflexive

Module #21 - Relations 8 Properties of Relations Transitivity:Transitivity: A relation on A×A is transitive if (a,b)  R and (b,c)  R imply (a,c)  R. A relation on A×A is transitive if (a,b)  R and (b,c)  R imply (a,c)  R.Graph??