1 / 29

CSE 321 Discrete Structures

CSE 321 Discrete Structures. Winter 2008 Lecture 22 Binary Relations. TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A. Relations. Key idea in many domains Discussion will be terminology heavy Concepts from today: transitivity, composition.

Télécharger la présentation

CSE 321 Discrete Structures

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE 321 Discrete Structures Winter 2008 Lecture 22 Binary Relations TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAA

  2. Relations Key idea in many domains Discussion will be terminology heavy Concepts from today: transitivity, composition

  3. Definition of Relations Let A and B be sets, A binary relation from A to B is a subset of A  B Let A be a set, A binary relation on A is a subset of A  A

  4. Relation Examples Examples: Explicit relation on small set Relations on integers Pre-requisite relation Has taken

  5. Properties of Relations Let R be a relation on A R is reflexiveiff (a,a)  R for every a  A R is symmetriciff (a,b)  R implies (b, a) R R is antisymmetriciff (a,b)  R and a  b implies (b,a)  R / R is transitiveiff (a,b) R and (b, c) R implies (a, c)  R

  6. Combining Relations Let R be a relation from A to B Let S be a relation from B to C The composite of R and S, S  R is the relation from A to C defined S  R = {(a, c) |  b such that (a,b) R and (b,c) S}

  7. Examples (a,b) Parent: b is a parent of a (a,b) Sister: b is a sister of a What is Parent  Sister? What is Sister  Parent? S  R = {(a, c) |  b such that (a,b) R and (b,c) S}

  8. Examples Using the relations: Parent, Child, Brother, Sister, Sibling, Father, Mother express Uncle: b is an uncle of a Cousin: b is a cousin of a

  9. Powers of a Relation R2 = R  R = {(a, c) |  b such that (a,b) R and (b,c) R} R0 = {(a,a) | a  A} R1 = R Rn+1 = Rn R

  10. How is Anderson related to Bernoulli?

  11. From the Mathematics Geneology Project Erhard Weigel Gottfried Leibniz Jacob Bernoulli Johann Bernoulli Leonhard Euler Joseph Lagrange Jean-Baptiste Fourier Gustav Dirichlet Rudolf Lipschitz Felix Klein C. L. Ferdinand LindemannHerman Minkowski Constantin CaratheodoryGeorg Aumann Friedrich Bauer Manfred Paul Ernst MayrRichard Anderson

  12. Transitivity and Composition R is transitive if and only if Rn R for all n  1

  13. n-ary relations Let A1, A2, …, An be sets. An n-ary relation on these sets is a subset of A1A2 . . . An.

  14. Relational databases

  15. Alternate Approach

  16. Database Operations Projection Join Select

  17. Representation of relations Directed Graph Representation (Digraph) {(a, b), (a, a), (b, a), (c, a), (c, d), (c, e) (d, e) } b c a d e

  18. Matrix representation Relation R from A={a1, … ap} to B={b1, . . . bq} {(1, 1), (1, 2), (1, 4), (2,1), (2,3), (3,2), (3, 3) }

  19. Matrix operations How do you tell if a relation is reflexive from its adjacency matrix? How do you tell if a relation is symmetric from its adjacency matrix? Suppose R has matrix MR and S has Matrix MS. What are the matrices for R S and R S?

  20. Matrix multiplication Standard (, +) matrix multiplication. A is a m  n matrix, B is a n  p matrix C = A  B is a m  p matrix defined:

  21. And-OR Matrix multiplication A is a m  n boolean matrix, B is a n  p boolean matrix C = A  B is a m  p matrix defined:

  22. Matrices and Composition MS R = MR MS R = {(a, a), (a, c), (b, a), (b, b)} S = {(b, a), (b, c), (c, a), (c, c)}

  23. Closures • Reflexive Closure • Symmetric Closure

  24. Transitive Closure • R = {(1, 2), (2, 3), (3, 4)}

  25. Transitive closure

  26. Equivalence Relations Definition: A relation on a set A is called an equivalence relation if it is reflexive, symmetric, and transitive. Are these equivalence relations? • Congruence Mod m on Z+. R = {(a,b) | a  b mod m} • The ‘divides’ relation on Z+. R = {(a,b) | a|b}

  27. Equivalence classes • R = {(a,b) | a  b mod 3}, Domain: Z+

  28. Partial Orderings Definition: A relation R on a set S is called a partial ordering if it is reflexive, antisymmetric, and transitive. A set S together with a partial ordering R is called a partially ordered set, or poset. Are these posets? • (Z, ≥) • (Z+, |)

  29. Total Orderings Definition: If (S, R) is a poset and every two elements of S are comparable, S is called a totally (linearly) ordered set, and R is called a total (linear) order. Are these posets totally ordered? • (Z, ≥) • (Z+, |)

More Related