4. Relations and Digraphs Binary Relation Geometric and Algebraic Representation Method Properties Equivalence Relations Operations.

Slides:



Advertisements
Similar presentations
Representing Relations
Advertisements

Chapter 2 Revision of Mathematical Notations and Techniques
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.
Graph-02.
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.
Chapter 3 Relations. Section 3.1 Relations and Digraphs.
Chapter 4 Relations and Digraphs Weiqi Luo ( 骆伟祺 ) School of Software Sun Yat-Sen University : Office : A309
Chap6 Relations Def 1: Let A and B be sets. A binary relation from A
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.
Introduction to Graph Theory Lecture 19: Digraphs and Networks.
Discussion #25 1/13 Discussion #25 Set Topics & Applications.
1 Relations: The Second Time Around Chapter 7 Equivalence Classes.
CS5371 Theory of Computation Lecture 1: Mathematics Review I (Basic Terminology)
Relations binary relations xRy on sets x  X y  Y R  X  Y Example: “less than” relation from A={0,1,2} to B={1,2,3} use traditional notation 0 < 1,
Graphs, relations and matrices
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
GRAPH Learning Outcomes Students should be able to:
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
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
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.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
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.
R. Johnsonbaugh, Discrete Mathematics 5 th edition, 2001 Chapter 2 The Language of Mathematics.
1 CS104 : Discrete Structures Chapter V Graph Theory.
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.
8.3 Representing Relations Directed Graphs –Vertex –Arc (directed edge) –Initial vertex –Terminal vertex.
Discrete Structures1 You Never Escape Your… Relations.
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.
Relations and their Properties
Relations – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Properties of Relations Reading: Kolman, Section
§ 每周五交作业,作业成绩占总成绩的 10% ; § 平时不定期的进行小测验,占总成绩的 20% ; § 期中考试成绩占总成绩的 20% ;期终考 试成绩占总成绩的 50% § 每周五下午 1 ; 00—3 : 00 ,答疑 § 地点:软件楼 301.
CHAPTER 3 FUZZY RELATION and COMPOSITION. 3.1 Crisp relation Product set Definition (Product set) Let A and B be two non-empty sets, the product.
Sets and Subsets Set A set is a collection of well-defined objects (elements/members). The elements of the set are said to belong to (or be contained in)
Relations. Important Definitions We covered all of these definitions on the board on Monday, November 7 th. Definition 1 Definition 2 Definition 3 Definition.
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 ?
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
GRAPHS. Graph Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component, spanning tree Types of graphs: undirected,
Relations Section 9.1, 9.3—9.5 of Rosen Spring 2012
Graphs Basic properties.
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.
Section 9.3. Section Summary Representing Relations using Matrices Representing Relations using Digraphs.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
Discrete Mathematics Lecture # 13 Applications of Venn Diagram.
Chapter8 Relations 8.1: Relations and their properties.
Representing Relations Using Digraphs
Relations and Their Properties
Citra Noviyasari, S.Si, MT
Relations.
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
Dr. Ameria Eldosoky Discrete mathematics
Dr. Ameria Eldosoky Discrete mathematics
CSNB 143 Discrete Mathematical Structures
4.2 Relations and Digraphs
Graphs G = (V, E) V are the vertices; E are the edges.
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Agenda Lecture Content: Relations (Relasi)
Representing Relations Using Matrices
Presentation transcript:

4. Relations and Digraphs Binary Relation Geometric and Algebraic Representation Method Properties Equivalence Relations Operations

Product Sets An ordered pair (a,b) is a listing of the objects a and b in a prescribed order. If A and B are two nonempty sets, the product set or Cartesian product A  B is the set of all ordered pairs (a,b) with a  A, b  B. Theorem 1. For any two finite, nonempty sets A and B, |A  B|=|A||B| Cartesian product of the nonempty sets A 1,A 2,…,A m is the set of all ordered m-tuples (a 1,a 2,…,a m ) where a i  A i, i=1,2, …,m. A 1  A 2  …  A m ={(a 1,a 2,…,a m ) | a i  A i, i=1,2, …,m}

Partitions A partition or quotient set of a nonempty set A is a collection P of nonempty subsets of A such that –Each element of A belongs to one of the sets in P. –If A 1 and A 2 are distinct elements of P, then A 1  A 2 = . The sets in P are called the blocks or cells of the partition The members of a partition of a set A are subsets of A A partition is a subset of P(A), the power set of A Partitions can be considered as particular kinds of subsets of P(A)

Relations Let A and B be nonempty sets, a relation R from A to B is a subset of A  B. If (a,b)  R, then a is related to b by R and aRb. If R  A  A, R is a relation on A. The domain of R, Dom(R), is the set of elements in A that are related to some elements in B. The range of R, Ran(R), is the set of elements in B that are related to some elements in A. R(x) is defined as the R-relative set of x, where x  A, R(x)={y  B | xRy } R(A 1 ) is defined as the R-relative set of A 1, where A 1  A, R(A 1 )={y  B | xRy for some x in A 1 }

Relations Theorem 1. Let R be a relation from A to B, and let A 1 and A 2 be subsets of A. Then (a)If A 1  A 2, then R(A 1 )  R(A 2 ). (b)R(A 1  A 2 )=R(A 1 )  R(A 2 ). (c)R(A 1  A 2 )  R(A 1 )  R(A 2 ). Theorem 2. Let R and S be relations form A to B. If R(a)=S(a) for all a in A, then R=S.

The Matrix of a Relation If A and B are finites sets containing m and n elements, respectively, and R is a relation from A to B, represent R by the m  n matrix M R =[m ij ], where m ij =1 if (a i,b j )  R; m ij =0 if (a i,b j )  R. M R is called the matrix of R. Conversely, given sets A and B with |A|=m and |B|=n, an m  n matrix whose entries are zeros and ones determines a relation: (a i,b j )  R if and only if m ij =1.

The Digraph of a Relation Draw circles called vertices for elements of A, and draw arrows called edges from vertex a i to vertex a j if and only if a i Ra j. The pictorial representation of R is called a directed graph or digraph of R. A collection of vertices and edges in a digraph determines a relation If R is a relation on A and a  A, then the in-degree of a is the number of b  A such that (b,a)  R; the out- degree of a is the number of b  A such that (a,b)  R, the out-degree of a is |R(a)| The sum of all in-degrees in a digraph equals the sum of all out-degrees. If R is a relation on A, and B is a subset of A, the restriction of R to B is R  (B  B).

Paths in Relations and Digraphs A path of length n in R from a to b is a finite sequence  : a,x 1,x 2,…,x n-1,b such that aRx 1, x 1 Rx 2, …,x n-1 Rb where x i are elements of A A path that begins and ends at the same vertex is called a cycle the paths of length 1 can be identified with the ordered pairs (x,y) that belong to R xR n y means that there is a path of length n from x to y in R; R n (x) consists of all vertices that can be reached from x by some path in R of length n xR  y means that there is some path from x to y in R, the length will depend on x and y; R  is sometimes called the connectivity relation for R R  (x) consists of all vertices that can be reached from x by some path in R

Paths in Relations and Digraphs If |R| is large, M R can be used to compute R  and R 2 efficiently Theorem1 If R is a relation on A={a 1,a 2,…,a m }, then M = M R  M R Theorem2 For n  2, and R a relation on a finite set A, we have M =M R  M R  …  M R (n factors) The reachability relation R * of a relation R on a set A that has n elements is defined as follows: xR * y means that x=y or xR  y Let  1 : a,x 1,x 2,…,x n-1,b be a path in a relation R of length n from a to b, and let  2 : b,y 1,y 2,…,y m-1,c be a path in R of length m from b to c, then the composition of  1 and  2 is the path of length n+m from a to c, which is denoted by  2  1