- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
MORE EXAMPLES
Example 5.1.3: E(·, ·) eats E(· domain = A × A, where A = animal . For instance, E(wolves, rabbits). Example 5.1.4: The relation Q from the set {1, 2, 3} to the set {A,B,C}, with the orderedpairs model Q = {(1,A), (1,B), (2, C), (3,A), (3, C)} has the lists-of-relatives model 1 : A,B 2:C 3 : A,C and the matrix model
TRANSITIVITY PROPERTY OF RELATIONS
A relation R on a set A is transitive if whenever (a,b) and (b,c) ∈ R ,then (a,c) ∈ R , for all a,b,c ∈A. Example 7.1.1, continued: ≤ domain = R × R, where R = real numbers. TRANSITIVE, since x≤y∧y≤z⇒x≤z Example 7.1.2, continued: B(·, ·) brother of domain = P × P, where P = all persons. QUESTION: Is your brother’s brother your brother? YES or NO
∈
R
Example 5.1.11: M(·, ·) mother of domain = P × P, where P = all persons. NONTRANSITIVE, vacuously. Example 5.1.12: ancestor of domain = P × P, where P = all persons. TRANSITIVE Example 5.1.13: TRANSITIVE A={1,2,3,4},R={(3,4)}
Example 20 Example 21 Let R be the relations on the set of all people such that (a,b) ∈R if
person a is a parent of person b. RoR
DEF7: Let R be a relation on set A. Then the powers of R are defined inductively: R1 =R Rn+1 = Rn ° R EXAMPLE 22 Theorem1 The relation R on a set A is transitive if and only if Rn ⊆ R EXERCISES 28,30,31
Example 5.1.9, continued: B(·, ·) brother of domain = P × P, where P = all persons. NON-ANTISYMMETRIC Example 5.1.10, continued: M(·, ·) mother of domain = P × P, where P = all persons. ANTISYMMETRIC.
Example 5.1.5, continued: B(·, ·) brother of domain = P × P, where P = all persons. QUESTION: If George is Bill’s brother, does that imply that Bill is George’s brother? YES or NO
Chapter 5
Relations
5.1 RELATIONS AND THEIR PROPERTIES 5.5 EQUIVALENCE RELATIONS
Outline
1.Relations
a binary relation from A to B a relation on the set A
5.1 RELATIONS AND THEIR PROPERTIES
DEF: Binary Relation Let A and B be sets. A binary relation from A to B is a subset of A×B. A× The notation a R b means that (a,b)∈R.
Relations on a set
DEF2: A relation on the set A is a relation from A to A. A relation on a set A is a subset of A× A Ex4 Let A be the set {1,2,3,4}, which ordered pairs are in the relation R={(a,b)|a divides b} Ex5 pp 473
EXAMPLE 19
COMPOSITION OF BINARY RELATIONS
DEF: Let R be a relation from A to B and S a relation from B to C. Their composition S ° R is the relation on A × C that is true for any pair (a, c) such that (∃b ∈ B)[R(a, b) ∧ S(b, c)]
ANTISYMMETRY PROPERTY OF RELATIONS
A binary relation R is antisymmetric if and only if (∀x, y)[R(x, y) ∧ R(y, x) → x = y] Example 7.1.2, continued: ≤ domain = R × R, where R = real numbers. ANTISYMMETRIC, since x≤y∧y≤x⇒x=y
Functions as relations
Function :let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A Relations are a genralization of functions.
Ex 6 How many relations are there on a set with n elements? Solution: Since A×A has n2 elements A× when A has n elements, and a set with m elements has 2m subsets, 2n there are subsets of A×A . A×
2
REFLEXIVE PROPERTY of RELATIONS
A binary relation R on a set A is reflexive if and only if (a,a) ∈ R for every element a ∈A Example ≤ domain = R × R, where R = real numbers. REFLEXIVE, since (∀x ∈ R)[x ≤ x]. Example B(·, ·) brother of domain = P × P, where P = all persons. NONREFLEXIVE, since B(Joseph, Joseph) is false.
COMBINING RELATIONS
Since relations from A to B are subsets of A×B, two relations from A to B A× can be combined in any way two sets can be combined. 1. R1∪R2 R1∩R2 R1-R2
• E.g., a < b means (a,b)∈ < E.g.,
.
Example 5.1.1: (a,b) where a is a a,b) student entolled in course b. Example 5.1.2 (a,b) belosngs to (a,b) R if city a is in province b e.g. (shenzhen, Guangdong) ∈R (shenzhen, (chengdu, Guangdong) chengdu,
Example 13,14 in book.
Example 5.1.14 Is the divides relation on the set of positive intergers transive? Example 5.1.15 How many reflexive relations are there on a set with n elements?
Example 5.1.6, continued: E(·, ·) eats domain = A × A, where A = animal species. There are some symmetric pairs, such as ants and anteaters. Nonetheless, NONSYMMETRIC, since there also exist nonsymmetric paபைடு நூலகம்rs.
Example 5.1.7: Some familial relationships are symmetric: spouse, sibling, cousin.