§ 每周五交作业,作业成绩占总成绩的 10% ; § 平时不定期的进行小测验,占总成绩的 20% ; § 期中考试成绩占总成绩的 20% ;期终考 试成绩占总成绩的 50% § 每周五下午 1 ; 00—3 : 00 ,答疑 § 地点:软件楼 301.

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.
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.
 期中测验时间:本周五上午 9 : 40  教师 TA 答疑时间 : 周三晚上 6 : 00—8 : 30  地点:软件楼 315 房间,  教师 TA :李弋老师  开卷考试.
Chapter 3 Relations. Section 3.1 Relations and Digraphs.
Basic Properties 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?
1 Representing Relations Part 2: directed graphs.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank and Modified By Mingwu Chen Relations.
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.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
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.
Module #18: Relations, part I
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.
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.
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.
Discrete Structures1 You Never Escape Your… Relations.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 8 Relations 歐亞書局.
Discrete Mathematics Relation.
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.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
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)
§Discrete mathematics §Discrete i.e. no continuous §Set theory, Combinatorics, Graphs, Modern Algebra(Abstract algebra, Algebraic structures), Logic, classic.
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.)
Set identities.
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 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.
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.
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 Set Theory Second Part. 2 Disjoint Set let A and B be a set. the two sets are called disjoint if their intersection is an empty set. Intersection of.
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), (
§ 第 3 周起每周一交作业,作业成绩占总成绩的 15% ; § 平时不定期的进行小测验,占总成绩的 15% ; § 期中考试成绩占总成绩的 20% ;期终考试成绩占总成绩的 50% § 张宓
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.
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.
Discrete Mathematical
Relations and Their Properties
Citra Noviyasari, S.Si, MT
Relations.
Relations Chapter 9.
Relations and Digraphs
Representing Relations
Dr. Ameria Eldosoky Discrete mathematics
CSE115/ENGR160 Discrete Mathematics 04/28/11
Relations and Their Properties
Relations and their Properties
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Chapter 8 (Part 2): Relations
Agenda Lecture Content: Relations (Relasi)
4.4 Properties of Relations
Presentation transcript:

§ 每周五交作业,作业成绩占总成绩的 10% ; § 平时不定期的进行小测验,占总成绩的 20% ; § 期中考试成绩占总成绩的 20% ;期终考 试成绩占总成绩的 50% § 每周五下午 1 ; 00—3 : 00 ,答疑 § 地点:软件楼 301

§Example : Let A and B be two sets. Then P(A)∩P(B)=P(A∩B)  Proof:(1) P (A)∩ P (B)  P (A∩B) For any X  P ( A)∩ P ( B ) (2) P (A∩B)  P (A)∩ P (B) For any X  P ( A∩B )

Example : (A ∪ B) - C=(A - C) ∪ (B - C)

§A ∪ B=A ∪ C ⇏ B=C cancellation law  。 Example:A={1,2,3},B={3,4,5},C={4,5}, B  C, But A ∪ B=A ∪ C={1,2,3,4,5} Example: A={1,2,3},B={3,4,5},C={3},B  C, But A∩B=A∩C={3} §A-B=A-C ⇏ B=C §cancellation law :symmetric difference

§The symmetric difference of A and B, write A  B, is the set of all elements that are in A or B, but are not in both A and B, i.e. A  B=(A ∪ B)-(A∩B) 。 §(A ∪ B)-(A∩B)=(A-B) ∪ (B-A)

§Theorem 1.4: if A  B=A  C, then B=C  Distributive laws and De Morgan’s laws: B∩(A 1 ∪ A 2 ∪ … ∪ A n )=(B∩A 1 ) ∪ (B∩A 2 ) ∪ … ∪ (B∩A n ) B ∪ (A 1 ∩A 2 ∩ … ∩A n )=(B ∪ A 1 )∩(B ∪ A 2 )∩ … ∩(B ∪ A n )

Chapter 2 Relations §Definition 2.1: An order pair (a,b) is a listing of the objects a and b in a prescribed order, with a appearing first and b appearing second. Two order pairs (a,b) and (c, d) are equal if only if a=c and b=d. §{a,b}={b,a} , §order pairs: (a,b)  (b,a) unless a=b. §(a,a)

§Definition 2.2: The ordered n-tuple (a 1,a 2,…,a n ) is the ordered collection that has a 1 as its first element, a 2 as its second element, …, and a n as its nth element.Two ordered n-tuples are equal is only if each corresponding pair of their elements ia equal, i.e. (a 1,a 2,…,a n )=(b 1,b 2,…,b n ) if only if a i =b i, for i=1,2, …,n.

§Definition 2.3: Let A and B be two sets. The Cartesian product of A and B, denoted by A×B, is the set of all ordered pairs ( a,b) where a  A and b  B. Hence  A × B={(a, b)| a  A and b  B} §Example: Let A={1,2}, B={x,y},C={a,b,c}. §A×B={(1,x),(1,y),(2,x),(2,y)}; §B×A={(x,1),(x,2),(y,1),(y,2)}; §B×A  A×B  commutative laws ×

§A×C={(1,a),(1,b),(1,c),(2,a),(2,b),(2,c) }; §A×A={(1,1),(1,2),(2,1),(2,2)} 。 §A×  =  ×A=  §Definition 2.4: Let A 1,A 2,…A n be sets. The Cartesian product of A 1,A 2,…A n, denoted by A 1 ×A 2 ×…×A n, is the set of all ordered n-tuples (a 1,a 2,…,a n ) where a i  A i for i=1,2, … n. Hence  A 1 × A 2 × … × A n = {(a 1,a 2,…,a n )|a i  A i,i= 1,2,…,n}.

§Example:A×B×C={(1,x,a),(1,x,b),(1,x,c),(1,y,a), (1,y,b), (1,y,c),(2,x,a),(2,x,b),(2,x,c),(2,y,a),(2,y,b), (2,y,c)} 。 §If A i =A for i=1,2, …,n, then A 1 ×A 2 ×…×A n by A n. §Example : Let A represent the set of all students at an university, and let B represent the set of all course at the university. What is the Cartesian product of A×B? §The Cartesian product of A×B consists of all the ordered pairs of the form (a,b), where a is a student at the university and b is a course offered at the university. The set A×B can be used to represent all possible enrollments of students in courses at the university

§students a,b,c, courses:x,y,z,w §(a,y),(a,w),(b,x),(b,y),(b,w) , (c,w) §R={(a,y),(a,w),(b,x),(b,y),(b,w)}  R  A × B, i.e. R is a subset of A × B §relation

2.2 Binary relations  Definition 2.5: Let A and B be sets. A binary relation from A to B is a subset of A × B. A relation on A is a relation from A to A. If (a,b)  R, we say that a is related to b by R, we also write a R b. If (a,b)  R, we say that a is not related to b by R, we also write a ℟ b. we say that empty set is an empty relation.

§Definition 2.6: Let R be a relation from A to B. The domain of R, denoted by Dom(R), is the set of elements in A that are related to some element in B. The range of R, denoted by Ran(R), is the set of elements in B that are related to some element in A. §Dom R  A,Ran R  B 。

§Example: A={1,3,5,7},B={0,2,4,6}, §R={(a,b)|a<b, where a  A and b  B} §Hence R={(1,2),(1,4),(1,6),(3,4),(3,6),(5,6)} §Dom R={1,3,5}, Ran R={2,4,6} §(3,4)  R, §Because 4 ≮ 3, so (4,3)  R §Table §R={(1,2),(1,4),(1,6),(3,4), (3,6),(5,6)}

§A={1,2,3,4},R={(a,b)| 3|(a-b), where a and b  A} §R={(1,1),(2,2),(3,3), (4,4),(1,4),(4,1)} §Dom R=Ran R=A 。 §congruence mod 3 §congruence mod r  {(a,b)| r|(a-b) where a and b  Z, and r  Z + }

 Definition 2.7 : Let A 1,A 2,…A n be sets. An n-ary relation on these sets is a subset of A 1 × A 2 × … × A n.

2.3 Properties of relations §Definition 2.8: 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,a)  R for every a  A. §A={1,2,3,4} §R 1 ={(1,1),(2,2),(3,3)} ? §R 2 ={(1,1),(1,2),(2,2),(3,3),(4,4)} ? §Let A be a nonempty set. The empty relation  A×A is not reflexive since (a,a)  for all a  A. However  is irreflexive

 Definition 2.9: A relation R on a set A is symmetric if whenever a R b, then b R a. A relation R on a set A is asymmetric if whenever a R b, then b ℟ a. A relation R on a set A is antisymmetric if whenever a R b and b R a, then a=b. §If R is antisymmetric, then a ℟ b or b ℟ a when a  b. §A={1,2,3,4} §S 1 ={(1,2),(2,1),(1,3),(3,1)}? §S 2 ={(1,2),(2,1),(1,3)}? §S 3 ={(1,2),(2,1),(3,3)} ?

§A relation is not symmetric, and is also not antisymmetric §S 4 ={(1,2),(1,3),(2,3)} antisymmetric, asymmetric §S 5 ={(1,1),(1,2),(1,3),(2,3)} antisymmetric, is not asymmetric §S 6 ={(1,1),(2,2)} antisymmetric, symmetric, is not asymmetric §A relation is symmetric, and is also antisymmetric

§Definition 2.10: A relation R on set A is transitive if whenever a R b and b R c, then a R c. §A relation R on set A is not transitive if there exist a,b, and c in A so that a R b and b R c, but a ℟ c. If such a, b, and c do not exist, then R is transitive §T 1 ={(1,2),(1,3)} transitive §T 2 ={(1,1)} transitive §T 3 ={(1,2),(2,3),(1,3)} transitive §T 4 ={(1,2),(2,3),(1,3),(2,1),(1,1)} ?

§Example : Let R be a nonempty relation on a set A. Suppose that R is symmetric and irreflexive. Show that R is not transitive. §Proof: Suppose R is transitive. §Matrix or pictorial represented

§Definition 2.11: Let R be a relation from A={a 1,a 2, …,a m } to B={b 1,b 2, …,b n }. The relation can be represented by the matrix M R =(m i,j ) m×n, where m i,j =1? a i is related b j m i,j =0? a i is not related b j

§Example: A={1,2,3,4}, R={(1,1),(2,2),(3,3), (4,4),(1,4),(4,1)}, Matrix: §Example : A={2,3,4},B={1,3,5,7}, < §R={(2,3),(2,5), (2,7),(3,5),(3,7),(4,5),(4,7)}, §Matrix: §Let R be a relation on set A. R is reflexive if all the elements on the main diagonal of M R are equal to 1 §R is irreflexive if all the elements on the main diagonal of M R are equal to 0 §R is symmetric if M R is a symmetric matrix. §R is antisymmetric if m ij =1 with i  j, then m ji =0

§Directed graphs, or Digraphs 。 §Definition 2.12: Let R be a relation on A={ a 1,a 2, …,a n }. Draw a small circle (point) for each element of A and label the circle with the corresponding element of A. These circles are called vertices. Draw an arrow, called an edge, from vertex a i to vertex a j if only if a i R a j. 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: LetA={1, 2, 3, 4, 5}, R={(1,1),(2,2),(3,3),(4,4), (5,5),(1,4),(4,1),(2,5),(5,2)}, digraph

§Exercise: P11 35 §P114 17,35 §P123 24, 26, §P135 20,31,33