Chapter 3. Relations Definitions Relations Binary relations Domain Range Vertex Direct edge Loops Reflective Relations Sympatric Relations Anti Symmetric.

Slides:



Advertisements
Similar presentations
Representing Relations
Advertisements

Partial Orderings Section 8.6.
Chapter 2 Revision of Mathematical Notations and Techniques
CSE 211- Discrete Structures
Discrete Mathematics 3. MATRICES, RELATIONS, AND FUNCTIONS Lecture 5 Dr.-Ing. Erwin Sitompul
22C:19 Discrete Math Relations Fall 2010 Sukumar Ghosh.
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.
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.
Chapter 3 Relations. Section 3.1 Relations and Digraphs.
1 Representing Relations Part 2: directed graphs.
Theory and Applications
Discrete Mathematics Lecture#11.
1 Section 7.1 Relations and their properties. 2 Binary relation A binary relation is a set of ordered pairs that expresses a relationship between elements.
Partially Ordered Sets Basic Concepts
Graphs, relations and matrices
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
Relation. Relations Recall the definition of the Cartesian (Cross) Product: The Cartesian Product of sets A and B, A x B, is the set A x B = { : x  A.
Chapter 4 Relations and Digraphs
April 10, 2002Applied Discrete Mathematics Week 10: Relations 1 Counting Relations Example: How many different reflexive relations can be defined on a.
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.
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.
Chapter 7: Relations Relations(7.1) Relations(7.1) n-any Relations & their Applications (7.2) n-any Relations & their Applications (7.2)
Discrete Mathematics Relation.
Relations and their Properties
§ 每周五交作业,作业成绩占总成绩的 10% ; § 平时不定期的进行小测验,占总成绩的 20% ; § 期中考试成绩占总成绩的 20% ;期终考 试成绩占总成绩的 50% § 每周五下午 1 ; 00—3 : 00 ,答疑 § 地点:软件楼 301.
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.
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.
4. Relations and Digraphs Binary Relation Geometric and Algebraic Representation Method Properties Equivalence Relations Operations.
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
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.
Relations. L222 Agenda –Relations 7.3 Representing Relations As subsets of Cartesian products Column/line diagrams Boolean matrix Digraph Operations on.
SECTION 2 BINARY OPERATIONS Definition: A binary operation  on a set S is a function mapping S X S into S. For each (a, b)  S X S, we will denote the.
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.
Section 9.1. Section Summary Relations and Functions Properties of Relations Reflexive Relations Symmetric and Antisymmetric Relations Transitive Relations.
Lecture 7: Relations Dr Andrew Purkiss-Trew Cancer Research UK Mathematics for Computing.
Module Code MA1032N: Logic Lecture for Week Autumn.
Chapter8 Relations 8.1: Relations and their properties.
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.
Relations and Their Properties
Chapter 5 Relations and Operations
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 
Learn about relations and their basic properties
Relations Chapter 9.
Relations and Digraphs
Representing Relations
CSNB 143 Discrete Mathematical Structures
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 Math (2) Haiming Chen Associate Professor, PhD
Discrete Math (2) Haiming Chen Associate Professor, PhD
Combining relations via relational composition
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Chapter 8 (Part 2): Relations
Agenda Lecture Content: Relations (Relasi)
Ø Let the universe set U={1,2,3,...,10}.
Presentation transcript:

Chapter 3

Relations Definitions Relations Binary relations Domain Range Vertex Direct edge Loops Reflective Relations Sympatric Relations Anti Symmetric Relations

Metrics of Relations Reflective Relations Symmetric Relations Matrix multiplications

Relations A set of ordered pairs. The existence or the presence of the order pair (a, b) indicates that there is a relationship from a to b. The relational Dbase among records in a data base is based on the Relations concept.

A relation from one set to another can be thought of as which element of the first set is related to which element in the second set StudentCourse BillComputer Science MaryMath BillArt Beth History Computer Science DaveMath Student col is the Domain, Course Col is the Range

Binary Relation R A binary relation R from a set X to a set Y is subset of the Cartesian product X* Y If (x, y) R, we write x R y and we say x related to y. If x = y we say R is Binary relation on X. A function is a special type of Relation, a function f from X to Y is a Relation from X to Y with the properties: The Domain f equals X For each x X, there is exactly y Y such that (x,y) f If X = { Bill, Mary, Beth, Dave} and Y = {Computer Science, Math, Art, History} Then Our Relation from the previous table R = { (Bill, Computer Science), (Mary, Math),(Bill, Art) (Beth, History,), (Beth, Computer Science ),(Dave. Math)}. Since the order pair (Beth, History) R, we can write Beth R History This shows that a Relation can b given by specifying which ordered pair belongs to the Relation

Defining a Relation by giving a Rule for membership in the Relation X = {2, 3, 4} an Y = {3, 4, 5, 6, 7} If we define a relation R from X to Y by (x, y) R if x divides by y. We obtain R ={(2,4), (2,6), (3,3), (3,6), (4,4) And if we Write R as a table we obtain XY The Domain of R is the set {2,3,4} The Range of the set R is {3, 4, 6}

Graphs Let R be the Relation on X = {1,2,3,4} defined by the order pair (x, y) R if x y and x, y X The Relation R can be written as R = {(1,1),(1,2,),(1,3), (1,4), (2,2),(2,3),(2,4), (3,3),(3,4),(4,4)} The Relation R can be drawn as a graph, we call it a digraph (direct graph and will be covered in Chapter , 2, 3, 4 are called vertices The Arrows are called edges If there is a relation between vertices we draw an arrow to represent the relation Element(vertices) with the form off (x, x) are called lops

Digraph of Relation The Relation R on X = {a, b, c, d} given by the Digraph R = {(a,b),(a,d),(d,c), (c,d), (b,b)} a b c d

Reflective relation R A Relation R on the set X is called reflective if (x, x) R for every x X The relation R on the set X ={1,2,3,4}is reflective for each x X, (x, x) R Specifically: {(1,1,), (2,2), (3,3),(4,4)} are each in R The Digraph of reflective Relation has a loop on every vertex THE GRAPH ON SLIDE 8 IS REFLEXSIVE

Not a reflective The Relation R R = {(a,b),(a,d),(d,c), (c,d), )} on X = {a, b, c, d} given by the Digraph a b c d Is not a reflective relation because none of the Vertices have a loop, there is no (b,b), (c,c).. (b,b) and (c,c) R

Not a reflective The Relation R on X = {a, b, c, d} given by the Digraph R = {(a,a),(b,c),(c,b), (d,d), )} Is not a reflective relation is b X, c X But there is no loop on (b,b), (c,c) Vertices have a loop a d cb No Loop

symmetric A relation R on set X is called Symmetric if for all x, y X, if (x, y) R then (y, x) R The Relation R = {(a,a), (b,c),(c,b), (d,d) } on X = {a, b, c, d} Is symmetric because for all x, y if (x,y) R then (y, x) R example ((b,c) is in R and (c,b) is in also in R The diagraph of a symmetric relation has the property that whenever there is a direct edge from v to w there is also a direct edge from w to v bc a d

NOT Symmetric example The Relation R on X = {1,2,3,4} defined by (x, y) R if x y, x,y X R = {(1,1),(1,2,),(1,3), (1,4), (2,2),(2,3),(2,4), (3,3),(3,4),(4,4)} is Not Symmetric. (2,3) R but (3,2) R. The digraph of this relation has a direct edge from 2 to 3 but no direct edge between 3 and

AntiSymmetric The relation R on X is antisymmetric if for all x,y X, if (x,y) R and (y, x) R then x =y Example: The relation R on X = {1,2,3,4} defined by (x,y) R if x y, x,y X is antisymmetric because for all X,Y, IF (x,y) R and (y, x) R x = y We also can say if (x, y) R and (y, x) R then x = y.

Antisymmetric If a relation R has no members of the form (x, y), x y The relation is called Anti Symmetric for all x, y X, if x y then (x, y) R or (y, x) R Example R ={(a, a),(b, b),(c, c) on X = {a, b, c} is an antisymmetric a d c Also we can say, the digraph of antisymmetic relation has at most one directed edge between any two distinct vertices This graph is also symmetric and Reflexive

Metrics of Relations A matrix is a convent way to represent a relation. R from X to Y, such a representation can be used by computers to a analyze a relation. Row elements of X are labeled in some order and the column elements of Y are labeled. Entries in Row X and Column Y are set to 1 if there is R from X to Y otherwise it is set to 0 This type of matrix is called Matrix of relations from X to Y

Example. The matrix of the Relation R when R ={(1, b),(1, d), (2, c), (3, c),(3, b),(4, a)} From X={1, 2,3,4} to Y ={a, b, c, d} IS: abcd The matrix is dependent on the ordering of x, y. How would the Matrix for the Relation R look like if: X= {4, 3,2, 1} and Y = {d, c, b, a} … next slide

R ={(1, b),(1, d), (2, c), (3, c),(3, b),(4, a)} From X={4,3,2,1} to Y ={d, c, b, a} IS: dcba

Example 2 The matrix of the Relation R from X ={2,3,4} to Y={5,6,7,8}is defined by X R Y if x divides y Note: no remainder

Reflective Relations The matrix of the Relation R = {(a,a), (b, b), (c, c), (d, d),(b, c), (c, b) } on {a, b, c, d} relative to the ordering {a, b, c, d} abcd a1000 b0110 c0110 d1011 Matrix diagonal The Relation R is Reflective if and ONLY if A has only ones on the main diagonal. The main diagonal is the line from the upper left corner to the lower right corner. In other words the Relation R is Reflective if and only if (x, x) R for every x R.

Symmetric Relation If the Entry of R,C = the entry of C,R then the relation is symmetric, otherwise it is anti-symmetric. We can quickly determine if the relation is symmetric by checking the main diagonal Look at all entries for all R,C or (i, j) Look at all entries for all C,R or (j,i) If they are all 1 s then it is Symmetric Based on the above: for the previous example the Relation R is Symmetric

How Matrix Multiplication Relate to the composition of Relations and how can we test for Transitivity by using Matrix Relations?

What is Transitivity Transitivity: Transitive means whenever a none Zero entry in A ( entry (i, j) 0) there is also a none Zero in A 2 ( entry (i, j) 0)

Example Let R be the Relation from X to Y X ={1, 2,3} to Y ={a, b} defined by R1 ={(1,a),(2,b), (3,a), (3,b) and R2= the Relation from Y to Z where Z ={x, y, z} And the Relation is defined R2 ={(a,x), (a,y), (b,y), (b,z)} The matrix for R1 Relative to the ordering of 1,2,3 and a,b ab x y z a 1 10 b1 1 1 The Matrix of R2 relative to the ordering of (a,b) on (x, y, z) A1 = A2 = 110 A1.A2 =

Transitivity IF A is the matrix of R (relative to some ordering) We compute A 2 Then we compare A and A 2 The relation R is Transitive if and only if whenever an entry i,j in A is a non zero, an entry i,j in A^2 is also a none zero.

Determine if the Relation R is transitive The matrix of Relation: R = {(a,a),(b,b),(c,c),(d,d), (b,c),(c.b)} On. (a,b,c,d) relative to the order a, b, c, d a b c d abcd abcdabcd abcdabcd A=A^2 = Every none Zero i,j in A is matched with a none zero entry in i,j in A^2 Transitive Relation R

R2 O R1 To obtain the Matrix of the Relation R2 O R1 Compute the Matrix product A1*A2 Change all none zero entries to 1

Adjacency Matrix Will be covered in chapter 11