Agenda Lecture Content: Relations (Relasi)

Slides:



Advertisements
Similar presentations
Representing Relations
Advertisements

Partial Orderings Section 8.6.
Chapter 3. Relations Definitions Relations Binary relations Domain Range Vertex Direct edge Loops Reflective Relations Sympatric Relations Anti Symmetric.
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.
Basic Properties of Relations
Ch. 8: Relations 8.1 Relations and their Properties.
Relations. Binary Relations a relation between elements of two sets is a subset of their Cartesian product (of ordered pairs). Note the di ff erence between.
1 Representing Relations Part 2: directed graphs.
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.
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
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.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 8 Relations 歐亞書局.
Discrete Mathematics Relation.
§ 每周五交作业,作业成绩占总成绩的 10% ; § 平时不定期的进行小测验,占总成绩的 20% ; § 期中考试成绩占总成绩的 20% ;期终考 试成绩占总成绩的 50% § 每周五下午 1 ; 00—3 : 00 ,答疑 § 地点:软件楼 301.
Section 4.4 Properties of Relations. Order Relations Draw an arrow diagram for the relation R defined on the set {1,2,3,4} such that
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.
Discrete Structures – CNS2300
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
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.
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.
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.
Discrete Mathematical
Relations and Their Properties
Chapter 5 Relations and Operations
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.
Representing Relations
Cartesian product Given two sets A, B we define their Cartesian product is the set of all the pairs whose first element is in A and second in B. Note that.
CSE115/ENGR160 Discrete Mathematics 04/28/11
CSNB 143 Discrete Mathematical Structures
Applied Discrete Mathematics Week 9: Equivalence Relations
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,
Applied Discrete Mathematics Week 10: Equivalence Relations
Relations and Their Properties
8.1 Relations and Their Properties
8.1 Relations and Their Properties
Relations: representation and closures
Relations and their Properties
Introduction to Relations and Functions
CSE 321 Discrete Structures
Properties of Relations
Discrete Math (2) Haiming Chen Associate Professor, PhD
Discrete Math (2) Haiming Chen Associate Professor, PhD
Combining relations via relational composition
Basics of Relations.
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Chapter 8 (Part 2): Relations
Lecture # 16 Inverse of Relations
Presentation transcript:

Agenda Lecture Content: Relations (Relasi) Matrices of Relations (Matriks Relasi) Review Quiz Exercise

Relations

Relations Relations generalize the notion of function.  Function is a special type of Relation Relationships between elements of sets occur in many contexts. To express a relationship between elements of two sets: ordered pairs made up of two related elements  binary relations. (Bogor, Jawa Barat), (Surabaya, Jawa Timur)

Relation: Definition Let A and B be sets. A binary relation from A to B is a subset of A  B. Cartesian Product IF R : binary relation THEN a R b: (a, b)  R a R b: (a, b)  R Notation: domain: {a  A | (a,b)  R for some b  B} range: {b  B | (a,b)  R for some a  A}

Example A = {0, 1, 2} B = {a, b} Relation from a to b: {(0, a), (0, b), (1, a), (2, b)} 0 R a ? 0 R 2 ? 2 R a ?

Note: Function is a special type of Relation Properties: The domain of the function f is equal to A For each a  A, there is exactly one b  B such that (a,b)  f.

How to represent relation R = {(0, a), (0, b), (1, a), (2, b)} Table A B 0 a 0 b 1 a 2 b

How to represent relation Digraphs = Directed Graphs (chapter 8) A = {a, b, c, d}, R = {(a, b), (a, d), (b, b), (b, d), (c, a), (c, b), (d, b)}. a b d c

How to represent relation 1 A 2 3 4 B C D R A B C D 1 2 3 4 1 1 1 1 1 1

Relations on a Set A Relation on the set A is a relation from A to A  a subset of A  A A = {1, 2, 3, 4} Which pairs are belong to R = {(a, b) | a ≤ b} ? {(1, 1), (1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4), (2,2), (3,3),(4,4)}

Example Ordered pairs: (1, 1), (1, 2), (2, 1), (1, -1) and (2, 2) R1 = {(a, b) | a ≤ b} R2 = {(a, b) | a > b} R3 = {(a, b) | a = b} R4 = {(a, b) | a = b or a = -b} R5 = {(a, b) | a = b + 1} R6 = {(a, b) | a + b ≤ 3}

Properties of Relations Reflexive Symmetric Antisymmetric Transitive Composite

Reflexive A relation R on a set A is called reflexive if (a, a)  R for every element a  A. R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)} R2 = {(1, 1), (1, 2), (2, 1)} R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)} R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)} R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)} R6 = {(3, 4)}

Which one is reflexive? R1 = {(a, b) | a ≤ b} R2 = {(a, b) | a > b} R3 = {(a, b) | a = b} R4 = {(a, b) | a = b or a = -b} R5 = {(a, b) | a = b + 1} R6 = {(a, b) | a + b ≤ 3}

Symmetric and Antisymmetric A relation R on a set A is called symmetric: if (a, b)  R then (b, a)  R. A relation R on a set A is called antisymmetric: if for all a, b  R, IF (a, b)  R AND a ≠ b THEN (b, a)  R . (IF (a, b)  R AND (b, a)  R THEN a = b ) R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)} R2 = {(1, 1), (1, 2), (2, 1)} R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)} R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)} R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)} R6 = {(3, 4)}

Which one is symmetric, antisymmetric? R1 = {(a, b) | a ≤ b} R2 = {(a, b) | a > b} R3 = {(a, b) | a = b} R4 = {(a, b) | a = b or a = -b} R5 = {(a, b) | a = b + 1} R6 = {(a, b) | a + b ≤ 3}

Transitive A relation R on a set A is called transitive if whenever (a, b)  R and (b, c)  R then (a, c)  R, for all a, b, c  A . R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)} R2 = {(1, 1), (1, 2), (2, 1)} R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)} R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)} R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)} R6 = {(3, 4)}

Which one is transitive? R1 = {(a, b) | a ≤ b} R2 = {(a, b) | a > b} R3 = {(a, b) | a = b} R4 = {(a, b) | a = b or a = -b} R5 = {(a, b) | a = b + 1} R6 = {(a, b) | a + b ≤ 3}

S  R = {(a,c) | (a,b)  R and (b,c)  S for some b  B} Composition Let R be a relation from a set A to a set B and S a relation from B to a set C. We denote the composition of R and S by S  R. S  R = {(a,c) | (a,b)  R and (b,c)  S for some b  B} R is the relation from {1, 2, 3} to {1, 2, 3, 4} R = {(1, 1), (1, 4), (2, 3), (3, 1), (3, 4)} S is the relation from {1, 2, 3, 4} to {0, 1, 2} S = {(1, 0), (2, 0), (3, 1), (3, 2), (4, 1)} S  R ? S  R = {(1, 0), (1, 1), (2, 1), (2, 2), (3, 0), (3, 1)}

Digraph and Properties of Relations Reflexive: there is a loop at every vertex. Symmetric: whenever there is a directed edge from x to y, there is also a directed edge from y to x. Antisymmetric: whenever there is a directed edge from x to y, and x ≠ y, then there is no directed edge from y to x. Transitive: whenever there are directed edges from x to y and from y to z, then there is also a directed graph from x to z.

Partial Orders Partial Orders is a relation R that is reflexive, antisymmetric and transitive. Ex. R1 = {(a, b) | a ≤ b}

Equivalence Relations A relation on a set A is called an equivalence relation if it is reflexive, symmetric, and transitive Ex. R = {(1,1), (1,3), (1,5), (2,2),(2,4),(3,1),(3,3), (3,5),(4,2),(4,4),(5,1),(5,3),(5,5)} R is an equivalence relation on {1,2,3,4,5}

Matrices of Relations

Matrices of Relations Alternative methods for representing relations: Zero – One matrices

Zero-One Matrices A = {a1, a2, …, an} B = {b1, b2, …, bn} R is a relation from A to B. R can be represented by the matrix MR = [mij] where mij = 1, if (ai,bj)R, and mij = 0, if (ai,bj)R.

Example A = {1, 2, 3} B = {1, 2} R = {(a, b) | a > b} R = {(2, 1), (3, 1), (3, 2)}

Example A = {a1, a2, a3 , a4} B = {b1, b2, b3 , b4} R ?

Zero-One Matrices Find Zero-One Matrices for: Reflexive Relation ? Symmetric Relation ? Antisymmetric Relation ?

Antisymmetric Relation ? Zero-One Matrices Reflexive Relation ? Symmetric Relation ? Antisymmetric Relation ?

Combining Relations A = {1, 2, 3} B = {1, 2, 3, 4} R1  R2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (3, 3)} R1  R2 = {(1, 1)}

Combining Relations

Combining Relations

Review Quiz Exercise