Discrete Math (2) Haiming Chen Associate Professor, PhD

Slides:



Advertisements
Similar presentations
Epp, section 10.? CS 202 Aaron Bloomfield
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.
Transitive Closure Theorem 1. Let R be a relation on a set A. Then R  is the transitive closure of R. the reachability relation R * of a relation R on.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 CHAPTER 4 - PART 2 GRAPHS 1.
Representing Relations Using Matrices
Applied Discrete Mathematics Week 11: Graphs
8.4 Closures of Relations. Intro Consider the following example (telephone line, bus route,…) abc d Is R, defined above on the set A={a, b, c, d}, transitive?
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
TEDI: Efficient Shortest Path Query Answering on Graphs Author: Fang Wei SIGMOD 2010 Presentation: Dr. Greg Speegle.
Properties of Relations In many applications to computer science and applied mathematics, we deal with relations on a set A rather than relations from.
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.
CSC-2259 Discrete Structures
8.3 Representing Relations Directed Graphs –Vertex –Arc (directed edge) –Initial vertex –Terminal vertex.
1 Closures of Relations: Transitive Closure and Partitions Sections 8.4 and 8.5.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 8 Relations 歐亞書局.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Relations.
Relations and their Properties
Reflexivity, Symmetry, and Transitivity Lecture 44 Section 10.2 Thu, Apr 7, 2005.
1 Chapter Equivalence, Order, and Inductive Proof.
CSNB143 – Discrete Structure Topic 7 – Relations Part II.
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.
Problem Statement How do we represent relationship between two related elements ?
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,
GRAPHS. Graph Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component, spanning tree Types of graphs: undirected,
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
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Relations.
Graph Theory. undirected graph node: a, b, c, d, e, f edge: (a, b), (a, c), (b, c), (b, e), (c, d), (c, f), (d, e), (d, f), (e, f) subgraph.
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.
1 Closures of Relations Based on Aaron Bloomfield Modified by Longin Jan Latecki Rosen, Section 8.4.
Section 9.3. Section Summary Representing Relations using Matrices Representing Relations using Digraphs.
Chapter8 Relations 8.1: Relations and their properties.
2-1 Basic Assumptions Objective: To use number properties to simplify expressions.
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.
Representing Relations Using Digraphs
Relations and Their Properties
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 
Aaron Bloomfield CS 202 Rosen, section 7.4
Applied Discrete Mathematics Week 13: Graphs
Special Graphs By: Sandeep Tuli Astt. Prof. CSE.
Representing Relations
CS 173: Discrete Mathematical Structures
CSNB 143 Discrete Mathematical Structures
Discrete Structures – CNS2300
CS201: Data Structures and Discrete Mathematics I
Applied Discrete Mathematics Week 10: Equivalence Relations
Discrete Math (2) Haiming Chen Associate Professor, PhD
Based on slides by Y. Peng University of Maryland
CS2210 Discrete Structures Relations
Discrete Math (2) Haiming Chen Associate Professor, PhD
Discrete Math (2) Haiming Chen Associate Professor, PhD
Discrete Math (2) Haiming Chen Associate Professor, PhD
Closures of Relations: Transitive Closure and Partitions
Discrete Math (2) Haiming Chen Associate Professor, PhD
Graph Operations And Representation
Connectivity Section 10.4.
Discrete Math (2) Haiming Chen Associate Professor, PhD
Discrete Math (2) Haiming Chen Associate Professor, PhD
교환 학생 프로그램 내년 1월 중순부터 6월 초 현재 학부 2,3 학년?
Applied Discrete Mathematics Week 13: Graphs
Closures of Relations Epp, section 10.1,10.2 CS 202.
Based on slides by Y. Peng University of Maryland
Chapter 8 (Part 2): Relations
Representing Relations Using Matrices
Relations 12/7/2019.
Presentation transcript:

Discrete Math (2) Haiming Chen Associate Professor, PhD Department of Computer Science, Ningbo University http://www.chenhaiming.cn

Closure 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 with property P containing R such that S is a subset of every relation with property P containing R S is the smallest transitive relation that contains R. S is called the closure of R with respect to P

Reflexive Closure R = {(1, 1), (1, 2), (2, 1), (3, 2)} on the set A = {1, 2, 3} not reflexive How can we produce a reflexive relation containing R that is as small as possible? any reflexive relation that contains R must also contain (2, 2) and (3, 3) S= {(1, 1), (1, 2), (2, 1), (3, 2)}∪{(2,2), (3,3)} is the reflexive closure of R The reflexive closure of R equals R ∪ Δ, where Δ = {(a, a) | a ∈ A} is the diagonal relation on A.

Reflexive Closure

Symmetric Closure The relation {(1, 1), (1, 2), (2, 2), (2, 3), (3, 1), (3, 2)} on {1, 2, 3} is not symmetric How can we produce a symmetric relation that is as small as possible and contains R? S={(1, 1), (1, 2), (2, 2), (2, 3), (3, 1), (3, 2)} ∪{(2,1), (1,3)} S is called the symmetric closure of R The symmetric closure of a relation can be constructed by taking the union of a relation with its inverse R ∪ R−1 is the symmetric closure of R, where R−1 = {(b, a) | (a, b) ∈ R}.

Symmetric Closure

Transitive Closures R = {(1, 3), (1, 4), (2, 1), (3, 2)} on the set {1, 2, 3, 4} 1 2 3 4 Path: {2, 1, 3} Cycle: {2, 1, 3,2)}

Transitive Closures a, b, e, d; a, e, c, d, b b, a, c, b, a, a, b d, c e, b, a, b, a, b, e

Transitive Closures connectivity relation The relationR2 contains (a, b) if there is a person c such that (a, c) ∈ R and (c, b) ∈ R, that is, if there is a person c such that a has met c and c has met b. Similarly, Rn consists of those pairs (a, b) such that there are people x1, x2, . . . , xn−1 such that a has met x1, x1 has met x2, . . . , and xn−1 has met b. The relation R∗ contains (a, b) if there is a sequence of people, starting with a and ending with b, such that each person in the sequence has met the next person in the sequence.

Transitive Closures

Transitive Closures Warshall’s Algorithm W1 has 1 as its (i, j )th entry if there is a path from vi to vj that has only v1 = a as an interior vertex If a, x1, x2, . . . , xm−1, b is a path, its interior vertices are x1, x2, . . . , xm−1,

Transitive Closures W3 has 1 as its (i, j )th entry if there is a path from vi to vj that has only v1 = a, v2 = b, and/or v3 = c as its interior vertices, if any. W4 has 1 as its (i, j )th entry if there is a path from vi to vj that has v1 = a, v2 = b, v3 = c, and/or v4 = d as interior vertices, if any W4 is the matrix of the transitive closure,Wn = MR∗

Homework Page 607, Ex.25(a), 27