1 / 26

Relations

Relations. Van Gogh. Discrete Structures (CS 173) Madhusudan Parthasarathy, University of Illinois. Midterm 1. Oct 1 in class Skills list on website, under exams Practice midterm and practice problems will also be up soon. Last Class: Sets. A set is an unordered collection of objects.

jensen
Download Presentation

Relations

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. Relations Van Gogh Discrete Structures (CS 173) Madhusudan Parthasarathy, University of Illinois

  2. Midterm 1 • Oct 1 in class • Skills list on website, under exams • Practice midterm and practice problems will also be up soon.

  3. Last Class: Sets A set is an unordered collection of objects grandfather Madonna mother father Beethoven sister my friend me

  4. Last Class: Sets Family grandfather Madonna mother father Beethoven sister my friend me

  5. Today’s class: Relations grandfather parent Madonna mother father Beethoven parent sister my friend sibling me

  6. Today’s class • How to represent relations • Properties and types of relations: reflexive, symmetric, transitive, partial order, etc. • Practice proofs with relations

  7. Representing relations A relation on a set is a set of ordered pairs of elements from i.e. • Consider relation to stand for “parent” on the set of people • mother me • = {(grandfather, mother), (mother, me), (father, me), (mother, sister), (father, sister)} • Relation stands for “sibling” • {(sister, me), (me, sister)} grandfather parent mother father parent sister sibling me

  8. Relations with numbers “less than” 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 “divides” “congruent mod 3”

  9. Application: Relational Databases, SQL • A database can be seen as a relation (or sets of relations) • Represented as tables • Query languages (like SQL) • SELECT statements combine relations to get new relations • SELECT * FROM Book WHERE price > 100.00 ORDERBY title; • Uses JOINs, etc. Uses Boolean connectives, etc. • http://en.wikipedia.org/wiki/SQL

  10. Reflexivity Reflexive: all elements relate to self Irreflexive: no elements relate to self ( means “”) Is irreflexive the negation of reflexive? No!

  11. Symmetry Symmetric: Antisymmetric: equivalent:

  12. Transitivity Transitive: Example of a relation that is transitive? Not transitive?

  13. Practice identifying relation properties Never both ways if not same If one way then both None to self All to self if x->y->z, x->z Antisymmetric Symmetric Irreflexive Transitive Reflexive

  14. Practice identifying relation properties Never both ways if not same If one way then both None to self All to self if x->y->z, x->z Antisymmetric Symmetric Irreflexive Transitive Reflexive “less than” “divides” “congruent mod k” “is square of”

  15. Disproof of transitive Claim: “is square of” is not transitive. Definition: Relation on set is transitive iff

  16. Proof of antisymmetric Claim: “is square of” is antisymmetric. Definition: Relation on set is antisymmetric if , or equivalently

  17. Types of relations Partial order: reflexive, antisymmetric, transitive

  18. Types of relations Linear order: partial order (reflexive, antisymmetric, transitive) in which every pair of elements is comparable:

  19. Types of relations Strict partial order: irreflexive, antisymmetric, transitive

  20. Types of relations Equivalence relation: reflexive, symmetric, transitive

  21. Equivalence example Relation on : iff contains all points on the unit circle

  22. Proof of equivalence Claim: “congruent mod k” is an equivalence relation Definition: An equivalence relation is reflexive, symmetric, and transitive

  23. The subset relation What kind of ordering is the subset () relation sets?

  24. Types of relations Antisymmetric Symmetric Irreflexive Transitive Reflexive Partial Order Strict Partial Order Linear Order Equivalence Relation

  25. Things to remember • How to illustrate a relation graphically • Be able to identify basic properties of relations: reflexivity, symmetry, transitivity • Types of relations: partial order, strict partial order, linear order • When proving (or disproving) a property of a relation, write down definition of relation and property

  26. See you next week! • Functions and more functions

More Related