Dr. Ameria Eldosoky Discrete mathematics

Slides:



Advertisements
Similar presentations
Equivalence Relations
Advertisements

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
Discrete Mathematics Lecture # 16 Inverse of Relations.
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?
Ch. 8: Relations 8.1 Relations and their Properties.
CSE115/ENGR160 Discrete Mathematics 05/03/11 Ming-Hsuan Yang UC Merced 1.
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,
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.
Relations Chapter 9.
Exam 2 Review 8.2, 8.5, 8.6, Thm. 1 for 2 roots, Thm. 2 for 1 root Theorem 1: Let c 1, c 2 be elements of the real numbers. Suppose r 2 -c 1.
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
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.
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.
Digraphs and Relations Warm Up. The Divisibility Relation Let “|” be the binary relation on N×N such that a|b (“a divides b”) iff there is an n ∈ N such.
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
Relations and their Properties
§ 每周五交作业,作业成绩占总成绩的 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 & Their Properties: Selected Exercises.
Relations & Their Properties: Selected Exercises.
Discrete Mathematics Lecture # 15 Types of Relations (contd.)
Chapter 8 Equivalence Relations Let A and B be two sets. A relation R from A to B is a subset of AXB. That is, R is a set of ordered pairs, where the first.
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,
1 RELATIONS Learning outcomes Students are able to: a. determine the properties of relations – reflexive, symmetric, transitive, and antisymmetric b. determine.
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.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 41 May 7, 2008.
Section 9.1. Section Summary Relations and Functions Properties of Relations Reflexive Relations Symmetric and Antisymmetric Relations Transitive Relations.
Discrete Mathematics Lecture # 13 Applications of Venn Diagram.
Chapter8 Relations 8.1: Relations and their properties.
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
The Relation Induced by a Partition
Discrete Mathematical
Relations and Their Properties
Citra Noviyasari, S.Si, MT
Chapter 5 Relations and Operations
Relations.
Set Theory.
Equivalence Relations
Relations Chapter 9.
Lecture # 14 Types of Relations
Relations and Digraphs
RELATION KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS )
Dr. Ameria Eldosoky Discrete mathematics
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,
8.5 Equivalence Relations
Relations and Their Properties
8.1 Relations and Their Properties
Applied Discrete Mathematics Week 5: Boolean Algebra
8.5 Equivalence Relations and 8.6 Partial Ordering
Introduction to Sets.
2/18/2019 §7.1 Binary Relations (2nd pass) and §7.2 n-ary Relations Longin Jan Latecki Slides adapted from Kees van Deemter who adopted them from Michael.
2/25/2019 §7.1 Binary Relations (2nd pass) and §7.2 n-ary Relations Longin Jan Latecki Slides adapted from Kees van Deemter who adopted them from Michael.
Properties of Relations
9.5 Equivalence Relations
Equivalence Relations
7/30/2019 §7.1 Binary Relations (2nd pass) and §7.2 n-ary Relations Longin Jan Latecki Slides adapted from Kees van Deemter who adopted them from Michael.
Chapter 8 (Part 2): Relations
Lecture # 16 Inverse of Relations
Relations 12/7/2019.
4.4 Properties of Relations
Presentation transcript:

Dr. Ameria Eldosoky Discrete mathematics

Relations and functions

Relations Relation Let A and B be nonempty sets. A relation R from A to B is a subset of A × B. If R ⊆ A× B and (a, b) ∈ R, we say that a is related to b by R, write a R b, if a is not related to b by R, we write a b. If A and B are equal. We say that If R ⊆ A× A is a related on A, instead of a relation from A to A.

Relations Example 1 Let A ={1, 2, 3} and B={r, s}. Then we define R={(1, r), (2, s), (3, r)} is a relation from A to B. Example 2 Let A and B be sets of real numbers. We define the following relation R(equals) from A to B Y O X

Example 3 Example 4 Relations Let A={1, 2, 3, 4}. Define the following relation R (less than) on A a R b if and only if a<b Then R= { (1,2) (1,3) (1,4) (2, 3) (2,4) (3,4) } Example 4 Let A=Z+, the set of all positive integers. Define the following relation R on A: a R b if and only if a divides b Then 4 R 12, 6 R 30, but 5 7 .

Relations Example 5 Let A be the set of all people in the world. We define the following relation R on A: a R b if any only if there is a sequence a0, a1, a2, …,an of people such that a0=a, an=b and ai-1 knows ai, i=1,2,…,n (n will depend on a and b)

Relations Example 6 Let A=R, the set of real numbers. We define the following relation R on A x R y if and only if x and y satisfy the equation x2/4+y2/9=1 O X Y (0,3) (2,0)

Sets arising from relations Let R ⊆ A× B be a relation from A to B. a) The domain of R Denoted by Dom(R), is the set of all first elements in the pairs that make up R. (Dom(R) ⊆ A ) b) The range of R Denoted by Ran(R), is the set of all second elements in the pairs that make up R. (Ran(R) ⊆ B )

R-relative set of x Relations If R is a relation from A to B and x ∈ A, we define R(x), the R-relative set of x, to be the set of all y in B with the property that x is R-related to y. R(x) = {y ∈ B | x R y} If A1 ⊆A, then R(A1), the R-relative set of A1, is the set of all y in B with the property that x is R-related to y for some x in A1. R(A1) = {y ∈ B | x R y for some x in A1}

Relations Example 13 Let A={a, b, c, d} and let R={(a,a), (a,b), (b,c), (c,a), (d,c), (c,b)}. Then R(a) = {a, b} R(b)={c} If A1={c, d}, Then R(A1)= {a, b, c}

Relations Theorem 1 Let R be a relation from A to B, and let A1 and A2 be subsets of A, then (a) If A1 ⊆ A2, then R(A1) ⊆ R(A2) (b) R(A1 U A2 ) = R(A1) U R(A2) (c) R (A1 ∩ A2 ) ⊆ R(A1 ) ∩ R(A2)

(a) If A1 ⊆ A2, then R(A1) ⊆ R(A2) Proof: Relations (a) If A1 ⊆ A2, then R(A1) ⊆ R(A2) Proof: If y ∈ R(A1), then x R y for some x in A1, since A1 ⊆ A2, x ∈A2, thus y ∈ R(A2) and therefore R(A1) ⊆ R(A2)

(b) R(A1 U A2 ) = R(A1) U R(A2) Relations Proof : If y ∈ R(A1 U A2 ), then x R y for some x in A1 U A2, then x in A1 or A2. If x in A1 , y ∈ R(A1); if x in A2 . y ∈ R(A2). In either cases, y ∈ R(A1) U R(A2) , therefore R(A1 U A2 ) ⊆ R(A1) U R(A2) (2) R(A1) U R(A2) ⊆ R(A1 U A2 ) A1 ⊆ A1 U A2 , then R(A1) ⊆ R(A1 U A2 ) A2 ⊆ A1 U A2 , then R(A2) ⊆ R(A1 U A2 ) Thus R(A1) U R(A2) ⊆ R(A1 U A2 ) Therefore, we obtain R(A1 U A2 ) = R(A1) U R(A2)

Note: R(A1) ∩ R(A2) ⊆ R (A1 ∩ A2) Relations (c) R (A1 ∩ A2) ⊆ R(A1) ∩ R(A2) Proof: If y ∈ R (A1 ∩ A2 ) , then x R y for some x in A1 ∩ A2, since x is in both A1 and A2 , it follows that y is in both R(A1) and R(A2) ; that is, y ∈ R(A1 ) ∩ R(A2). Therefore R (A1 ∩ A2) ⊆ R(A1) ∩ R(A2) Note: R(A1) ∩ R(A2) ⊆ R (A1 ∩ A2)

Relations Theorem 2 Let R and S be relations from A to B, If R(a) =S(a) for all a in A, then R=S Proof: If a R b, then b ∈ R(a). Therefore, b ∈ S(a) and a S b. A completely similar argument shows that, if a S b, then a R b. Thus R=S.

Properties of Relations Reflexive & Irreflexive A relation R on a set A is reflexive if (a, a)∈ R for all a ∈A. A relation R on a set A is irreflexive if a R a for all a∈ A reflexive irreflexive Dom(R) =Ran(R) =A

Properties of Relations Theorem 2 Let R be a relation on a set A, then (a) Reflexivity of R means that a∈R(a) for all a in A. (b) Symmetry of R means that a∈R(b) iff b∈R(a). (c) Transitivity of R means that if b∈R(a) and c∈R(b), then c∈R(a).

Properties of Relations Example 1 (a) Δ = {(a,a) | a ∈A} Reflexive (b) R = {(a,b)∈A×A | a ≠ b} Irreflexive (c) A={1,2,3} and R={(1,1), (1,2)} not Reflexive ((2,2) not in R), not Irreflexive ((1,1) in R) (d) A is a nonempty set. R=Ø ⊆ A×A, the empty relation. not Reflexive, Irreflexive

Properties of Relations Symmetric, Asymmetric & Antisymmetric Symmetric: if a R b, then b R a Asymmetric: if a R b, then b R a (must be irreflexive) Antisymmetric: if a ≠ b, a R b or b R a ( if a R b and b R a, then a=b ) not Symmetric: some a and b with a R b, but b R a not Asymmetric: some a and b with a R b, but b R a not Antisymmetric : some a and b with a ≠ b, but both a R b and b R a

Properties of Relations Example 2 Let A=Z, the set of integers, and let R={ (a,b) ∈A×A | a < b } Is R symmetric, asymmetric, or antisymmetric? Solution: not symmetric: if a<b then b<a is not true. asymmetric: if a<b, then b<a must be true Antisymmetric: if a ≠ b, then a<b or b<a must be true

Properties of Relations Example 4 Let A={1,2,3,4} and let R={(1,2), (2,2), (3,4), (4,1)} R is not symmetric, since (1,2) ∈ R, but (2,1) ∈ R. R is not asymmetric, since (2,2) ∈ R R is antisymmeric, since if a ≠ b, either (a, b) ∈ R or (b,a) ∈ R

Properties of Relations Example 5 Let A=Z+, the set of positive integers, and let R={(a,b) ∈A×A | a divides b } Is R symmetric, asymmetric, or antisymmetric? Solution: not symmetric: 3 | 9 but 9 | 3 not asymmetric: 2 | 2 antisymmetric: if a | b and b | a, then a=b (Section 1.4)

Properties of Relations Example 9 Let A=Z+, and R={(a,b) ∈A×A | a divides b } Is R transitive? Solution: Suppose that a R b and b R c, so that a | b and b | c. It then does follow that a | c Thus R is transitive.

Properties of Relations Example 10 Let A ={1,2,3,4} and let R={(1,2),(1,3),(4,2)} Is R transitive? Solution: Since there are no elements a, b and c in A such that a R b and b R c, but a R c, R is transitive.

Operations on Relations Let R and S be relations from a set A to a set B R and S are subsets of A×B. We can use set operations on the relations R and S Relations: (three representations) 1. the set of ordered pairs (finite or infinite) 2. digraph (finite) 3. matrix (finite)

Operations on Relations Complementary relation if and only if a R b The intersection R ∩ S a (R ∩ S) b means that a R b and a S b The union R U S a (R U S) b means that a R b or a S b

Operations on Relations Inverse Let R be a relation from A to B, the relation R-1 is a relation from B to A (reverse order from R) denoted by b R-1 a if and only if a R b Note: (R-1) -1=R Dom(R-1) = Ran (R) Ran(R-1) = Dom(R)

Operations on Relations Example 1 Let A={1,2,3,4} and B= {a,b,c}. We Let R={(1,a), (1,b), (2,b),(2,c),(3,b),(4,a)} and S= {(1,b),(2,c),(3,b),(4,b)} Compute: (a) (b) R ∩ S (c) R U S (d) R-1 Solution: A×B = { (1,a), (1,b), (1,c), (2,a), (2,b), (2,c), (3,a), (3,b), (3,c), (4,a), (4,b), (4,c) }

Operations on Relations Example 1 R∩S = { (1,b), (3,b), (2,c) } R∪S = { (1,a), (1,b), (2,b), (2,c), (3,b), (4,a), (4,b) } R-1= { (a,1), (b,1), (b,2), (c,2), (b,3), (a,4) }

Operations on Relations Example 2 Let A=R. Let R be the relation ≤ on A and let S be ≥ Then the complement of R is the relation >, since a ≤ b means a>b Similarly, the complement of S is the relation <. On the other hand, R-1=S, since for any number a and b a R-1 b if and only if b R a if and only if b ≤ a if and only if a ≥ b if and only if a S b R ∩ S : “=” R U S : A×A

Operations on Relations Theorem 1 Suppose that R and S are relations from A to B (a) If R ⊆ S, then R-1 ⊆ S-1. (b) If R ⊆ S, then S ⊆ R (c) (R∩S) -1 =R -1 ∩ S -1 and (R U S) -1 = R -1 U S -1 (d) (R∩S) = R U S and R U S = R ∩ S

Operations on Relations Theorem 2 Let R and S be relations on a set A (a) If R is reflexive, so is R-1 (b) If R and S are reflexive, then so are R∩S and R U S (c) R is reflexive if and only if R is irrflexive