每周三交作业,作业成绩占总成绩的15%; 平时不定期的进行小测验,占总成绩的 15%; 期中考试成绩占总成绩的20%;期终考试成绩占总成绩的50% zhym@fudan.edu.cn 张宓 13212010027@fudan.edu.cn BBS id:abchjsabc 软件楼1039 杨侃 10302010007@fudan.edu.cn liy@fudan.edu.cn 李弋
A∪B=A∪C ⇏ B=C cancellation law 。 Example:A={1,2,3},B={3,4,5},C={4,5}, BC, But A∪B=A∪C={1,2,3,4,5} Example: A={1,2,3},B={3,4,5},C={3},BC, But A∩B=A∩C={3} A-B=A-C ⇏B=C cancellation law :symmetric difference
The symmetric difference of A and B, write AB, is the set of all elements that are in A or B, but are not in both A and B, i.e. AB=(A∪B)-(A∩B) 。 (A∪B)-(A∩B)=(A-B)∪(B-A)
Theorem 1.4: if AB=AC, then B=C Distributive laws and De Morgan’s laws: B∩(A1∪A2∪…∪An)=(B∩A1)∪(B∩A2)∪…∪(B∩An) B∪(A1∩A2∩…∩An)=(B∪A1)∩(B∪A2)∩…∩(B∪An)
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 (a1,a2,…,an) is the ordered collection that has a1 as its first element, a2 as its second element,…, and an as its nth element.Two ordered n-tuples are equal is only if each corresponding pair of their elements ia equal, i.e. (a1,a2,…,an)=(b1,b2,…,bn) if only if ai=bi, for i=1,2,…,n.
Definition 2. 3: Let A and B be two sets 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 aA and bB. Hence A×B={(a, b)| aA and bB} 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×AA×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 A1,A2,…An be sets. The Cartesian product of A1,A2,…An, denoted by A1×A2×…×An, is the set of all ordered n-tuples (a1,a2,…,an) where aiAi for i=1,2,…n. Hence A1×A2×…×An={(a1,a2,…,an)|aiAi,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 Ai=A for i=1,2,…,n, then A1×A2×…×An by An. 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)} RA×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 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 aA and bB} 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 bA} Dom R=Ran R=A。 congruence mod 3 congruence mod r {(a,b)| r|(a-b) where a and bZ, and rZ+}
Definition 2. 7:Let A1,A2,…An be sets Definition 2.7:Let A1,A2,…An be sets. An n-ary relation on these sets is a subset of A1×A2×…×An.
2.3 Properties of relations Definition 2.8: A relation R on a set A is reflexive if (a,a)R for all aA. A relation R on a set A is irreflexive if (a,a)R for every aA. A={1,2,3,4} R1={(1,1),(2,2),(3,3)} ? R2={(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 aA. 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, then b℟a unless a=b. If R is antisymmetric, then a ℟ b or b ℟ a when ab. A={1,2,3,4} S1={(1,2),(2,1),(1,3),(3,1)}? S2={(1,2),(2,1),(1,3)}? S3={(1,2),(2,1),(3,3)} ?
A relation is not symmetric, and is also not antisymmetric S4={(1,2),(1,3),(2,3)} antisymmetric, asymmetric S5={(1,1),(1,2),(1,3),(2,3)} antisymmetric, is not asymmetric S6={(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 T1={(1,2),(1,3)} transitive T2={(1,1)} transitive T3={(1,2),(2,3),(1,3)} transitive T4={(1,2),(2,3),(1,3),(2,1),(1,1)} ?
Example:Let R be a nonempty relation on a set A 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={a1,a2,…,am} to B={b1,b2,…,bn}. The relation can be represented by the matrix MR=(mi,j)m×n, where mi,j=1? ai is related bj mi,j=0? ai is not related bj
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 MR are equal to 1 R is irreflexive if all the elements on the main diagonal of MR are equal to 0 R is symmetric if MR is a symmetric matrix. R is antisymmetric if mij=1 with ij, then mji=0
Directed graphs, or Digraphs。 Definition 2.12: Let R be a relation on A={ a1,a2,…,an}. 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 ai to vertex aj if only if ai R aj . 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
2.4 Operations on Relations R1∪R2 R1∩R2 R1-R2
1.Inverse relation Definition 2.13: Let R be a relation from A to B. The inverse relation of R is a relation from B to A, we write R-1, defined by R-1= {(b,a)|(a,b)R}
Theorem 2.1:Let R,R1, and R2 be relation from A to B. Then (2)(R1∪R2)-1=R1-1∪R2-1; (3)(R1∩R2)-1=R1-1∩R2-1; (4)(A×B)-1=B×A; (5)-1=; (7)(R1-R2)-1=R1-1-R2-1 (8)If R1R2 then R1-1R2-1
Theorem 2. 2:Let R be a relation on A Theorem 2.2:Let R be a relation on A. Then R is symmetric if only if R=R-1. Proof: (1)If R is symmetric, then R=R-1。 RR-1 and R-1R。 (2)If R=R-1, then R is symmetric For any (a,b)R, (b,a)?R
Exercise: P13 42 43 47 48 P126 17,37 P134 24, 26, P146 1,2,12, 21,31 P167 1,8,9,11