Download presentation
Presentation is loading. Please wait.
Published byDonna Price Modified over 9 years ago
1
§ 每周五交作业,作业成绩占总成绩的 10% ; § 平时不定期的进行小测验,占总成绩的 20% ; § 期中考试成绩占总成绩的 20% ;期终考 试成绩占总成绩的 50% § 每周五下午 1 ; 00—3 : 00 ,答疑 § 地点:软件楼 301
2
§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 )
3
Example : (A ∪ B) - C=(A - C) ∪ (B - C)
4
§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
5
§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)
7
§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 )
8
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)
9
§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.
10
§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 ×
11
§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}.
12
§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
13
§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
14
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.
15
§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 。
16
§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)}
18
§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 + }
19
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.
20
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
21
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)} ?
22
§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
23
§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)} ?
24
§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
25
§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
26
§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
27
§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.
28
§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
29
§Exercise: P11 35 §P114 17,35 §P123 24, 26, §P135 20,31,33
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.