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.

Slides:



Advertisements
Similar presentations
Representing Relations
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.
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.
1 Section 7.3 Representing relations (part 1: matrices)
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.
Discrete Mathematics Lecture # 16 Inverse of Relations.
Recursive Definitions Rosen, 3.4 Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
1 Representing Relations Part 2: directed graphs.
MATRICES. Matrices A matrix is a rectangular array of objects (usually numbers) arranged in m horizontal rows and n vertical columns. A matrix with m.
1 Representing Relations Epp section ??? CS 202 Aaron Bloomfield.
Relations Chapter 9.
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
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.
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
CS Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 Ofc hr: Thur, 9:30-11:30a Fall 2002KSU - Discrete Structures1.
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.
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 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
Fall 2002CMSC Discrete Structures1 You Never Escape Your… Relations.
Matrices Section 2.6. Section Summary Definition of a Matrix Matrix Arithmetic Transposes and Powers of Arithmetic Zero-One matrices.
Relations. Important Definitions We covered all of these definitions on the board on Monday, November 7 th. Definition 1 Definition 2 Definition 3 Definition.
Lecture on Relations 1Developed by CSE Dept., CIST Bhopal.
Discrete Structures – CNS2300
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.
Unit II Discrete Structures Relations and Functions SE (Comp.Engg.)
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
Relations Section 9.1, 9.3—9.5 of Rosen Spring 2012
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.
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.
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 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 2.4. Section Summary  Sequences. o Examples: Geometric Progression, Arithmetic Progression  Recurrence Relations o Example: Fibonacci Sequence.
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.
CS 285- Discrete Mathematics Lecture 11. Section 3.8 Matrices Introduction Matrix Arithmetic Transposes and Power of Matrices Zero – One Matrices Boolean.
Module Code MA1032N: Logic Lecture for Week Autumn.
Chapter8 Relations 8.1: Relations and their properties.
Representing Relations Using Digraphs
Discrete Mathematical
Relations and Their Properties
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
CSE115/ENGR160 Discrete Mathematics 04/28/11
CSNB 143 Discrete Mathematical Structures
Applied Discrete Mathematics Week 10: Equivalence Relations
Representing Relations
Properties of Relations
Discrete Math (2) Haiming Chen Associate Professor, PhD
Combining relations via relational composition
Chapter 8 (Part 2): Relations
Agenda Lecture Content: Relations (Relasi)
Representing Relations Using Matrices
Presentation transcript:

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 combined. Let A = {1, 2, 3} and B = {1, 2, 3, 4}. The relations R 1 ={(1, 1), (2, 2), (3, 3)} and R 2 ={(1, 1), (1, 2), (1, 3), (1, 4)} can be combined to obtain R 1 U R 2 = {( 1, 1 ), ( 1, 2), ( 1, 3), ( 1, 4), (2, 2), (3, 3 ) }, R 1 ∩ R 2 = { ( 1, 1 ) }, R 1 - R 2 = {(2, 2), (3, 3 ) }, R 1 - R 2 = { ( 1, 2 ), ( 1, 3), ( 1, 4)}.

Composite Relation Let R be a relation from a set A to a set B and S a relation from B to a set C. The composite of R and S is the relation consisting of ordered pairs (a,c), where a A, c C, and for which there exists an element b B such that (a, b) R and (b, c) S. We denote the composite of R and S by S o R.

Example What is the composite of the relations R and S, where R is the relation from {1, 2, 3} to {1, 2, 3, 4} with R={(1, 1), (1, 4), (2, 3), (3, 1), (3, 4)} and S is the relation from {l, 2, 3, 4} to {0, 1, 2} with S={(1, 0),(2, 0),(3,1),(3,2), (4, 1) }? Solution: The ordered pairs (2, 3) in R and (3,1) in S produce the ordered pair (2, 1 ) in S o R. Computing all the ordered pairs in the composite, we find S o R = {( 1, 0), ( 1, 1 ), (2, 1 ), (2, 2), (3, 0), (3, 1 ) }.

Powers of a Relation Let R be a relation on the set A. The powers R n, n=1, 2, 3,.., are defined recursively by R 1 =R and R n+1 =R n o R and The definition shows that R 2 = R o R, R 3 = R 2 o R=(R o R) o R, and so on. Let R ={(1, 1), (2, 1), (3, 2), (4, 3)}. Find the powers R n, n = 2, 3, 4,... Solution: Because R 2 = R o R, we find that R 2 = {(1, 1), (2, 1 ), (3, 1), (4, 2)}. Furthermore, because R 3 = R 2 o R, R 3 = {(1, 1 ), (2, 1 ), (3, 1 ), (4, 1 )}. Additional computation shows that R 4 is the same as R 3. It also follows that R n = R 3 for n = 5, 6, 7,....

Relation Representation A relation between finite sets can be represented using a zero-one matrix. Suppose that R is a relation from A = {a 1, a 2,..., a m } to B = {b 1, b 2,..., b n }. The relation R can be represented by the matrix M R = [m ij ],where

Example

Relation Representation R is reflexive if all the elements on the main diagonal of M R are equal to 1 R is symmetric if and only if M R = (M R ) t The relation R is anti-symmetric if and only if (a,b) R and (b, a) R imply that a = b. Consequently, the matrix of an anti symmetric relation has the property that if m ij = 1 with i ≠ j, then m ji = 0. Or, in other words, either m ij = 0 or m ji = 0 when i ≠ j.

Example

Relations The Boolean operations join and meet can be used to find the matrices representing the union and the intersection of two relations. Suppose that R 1 and R 2 are relations on a set A represented by the matrices MR 1 and MR 2,respectively. Thus, the matrices representing the union and intersection of these relations are

Example

Representing Relations using Digraph A directed graph, or digraph, consists of a set V of vertices (or nodes) together with a set E of ordered pairs of elements of V called edges (or arcs). The vertex a is called the initial vertex of the edge (a, b), and the vertex b is called the terminal vertex of this edge. An edge of the form (a, a) is represented using an arc from the vertex a back to itself. Such an edge is called a loop.

Example The directed graph with vertices a, b, c, and d, and edges (a, b), (a, d), (b, b), (b, d), (c, a), (c, b), and (d, b) is displayed below

Example Draw the directed graph of the relation R = {( 1, 1 ), (1, 3), (2, 1 ), (2, 3), (2, 4), (3, 1 ), (3, 2), (4, 1 ) } on the set { 1, 2, 3, 4 }

Example What are the ordered pairs in the relation R represented by the directed graph shown below: Solution: The ordered pairs (x, y) in the relation are R = {(1, 3), ( 1, 4), (2, 1 ), (2, 2), (2, 3), (3, 1 ), (3, 3), (4, 1 ), (4, 3)}. Each of these pairs corresponds to an edge of the directed graph, with (2, 2) and (3, 3)corresponding to loops.

Algorithm Tree Relation Recursion Counting Thank You