Take X and Y to be the set of real numbers This subset specifies the relation y >= x Y x=y X This subset specifies the relation x2 + y2 <=1 Y x2 + y2 =1 X Relation Tables Student Info Name UF_ID Major GPA John 1111-2221 Math 3.9 Mary 2222-1111 CS 3.2 Helen 2333-5555 CS 3.9 Jean 5555-1234 Chemistry 3.8 A simple example of a database Columns are attributes and each row is an element in a Cartesian product AxBxCxD (what are them?) Equivalence Relation A relation is an equivalence relation if it is reflexive, symmetric and transitive. = is an equivalent relation > and < are not equivalence relation The relation (a, b and n are integers) a Ξ b (mod n) is an equivalence relation. a Ξ b (mod n) reads “a is congruent to b module n” (or a = b mod n). a Ξ b (mod n) if a- b divides n or a, b have the same remainder upon dividing by n. It is reflexive, symmetric and transitive. a Ξ a (mod n) a Ξ b (mod n) -> b Ξ a (mod n) a Ξ b (mod n) and b Ξ c (mod n) -> a Ξ c (mod n) Example R={ {1, 1}, {2, 1}, {3, 2}, {4, 3} } R2 = { {1, 1}, {2, 1}, {3, 1}, {4, 2} } R3 = { {1, 1}, {2, 1}, {3, 1}, {4, 1} } R4 = ? U Theorem: The relation R is transitive if and only if Rn R for all n=1, 2, 3, … Proof: “if” part. (a, b), (b, c) are in R, then (a, c) is in R also. “only if” use induction. Suppose Rn is in R for n < = k Rn + 1 = Rn o R will be in R o R which is in R.
© Copyright 2025 Paperzz