1 / 29

CS322

Week 8 - Wednesday. CS322. Last time. What did we talk about last time? Cardinality Countability Relations. Questions?. Logical warmup. There is a Grand Hotel with an infinite number of rooms Their slogan is: "We're always full, but we always have room for you!"

hedwig
Download Presentation

CS322

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. Week 8 - Wednesday CS322

  2. Last time • What did we talk about last time? • Cardinality • Countability • Relations

  3. Questions?

  4. Logical warmup • There is a Grand Hotel with an infinite number of rooms • Their slogan is: "We're always full, but we always have room for you!" • Although completely full, when a single guest arrives, he or she can be accommodated by moving into Room 1 • The guest in Room 1 will move into Room 2, the guest in Room 2 will move into Room 3, and so on, with each guest in Room n moving into Room n + 1 • Unfortunately, tragedy has struck! The hotel across the street, Inn Finite, which also has a (countably) infinite number of rooms, has just burned down • Describe how all of Inn Finite's guests can be accommodated at the Grand Hotel

  5. Quick SOLHRRwCC review • To solve sequence ak = Aak-1 + Bak-2 • Find its characteristic equation t2 – At – B = 0 • If the equation has two distinct roots r and s • Substitute a0 and a1 into an = Crn + Dsn to find C and D • If the equation has a single root r • Substitute a0 and a1 into an = Crn + Dnrn to find C and D

  6. Reflexive, Symmetric, and Transitive Properties Student Lecture

  7. Properties of Relations

  8. Reflexive • We will discuss many useful properties that hold for any binary relation R on a set A (that is from elements of A to other elements of A) • Relation R is reflexiveiff for all x A, (x, x)  R • Informally, R is reflexive if every element is related to itself • R is not reflexive if there is an x A, such that (x, x)  R

  9. Symmetric • Relation R is symmetriciff for all x, y A, if (x, y)  R then (y, x)  R • Informally, R is symmetric if for every element related to another element, the second element is also related to the first • R is not symmetric if there is an x, y  A, such that (x, y)  R but (y, x)  R

  10. Transitive • Relation R is transitiveiff for all x, y, z A, if (x, y)  R and (y, z)  R then (x, z)  R • Informally, R is transitive when an element is related to a second element and a second element is related to a third, then it must be the case that the first element is also related to the third • R is not transitive if there is an x, y, z  A, such that (x, y)  R and (y, z)  R but (x, z)  R

  11. Examples • Let A = {0, 1, 2, 3} • Let R = {(0,0), (0,1), (0,3), (1,0), (1,1), (2,2), (3,0), (3,3)} • Is R reflexive? • Is R symmetric? • Is R transitive? • Let S = {(0,0), (0,2), (0,3), (2,3)} • Is S reflexive? • Is S symmetric? • Is S transitive? • Let T = {(0,1), (2,3)} • Is T reflexive? • Is T symmetric? • Is T transitive?

  12. Transitive closures • If you have a set A and a binary relation R on A, the transitive closure of R called Rt satisfies the following properties: • Rt is transitive • R Rt • If S is any other transitive relation that contains R, then Rt  S • Basically, the transitive closure just means adding in the least amount of stuff to R to make it transitive • If you can get there in R, you can get there directly in Rt

  13. Transitive closure example • Let A = {0, 1, 2, 3} • Let R = {(0,1), (1,2), (2,3)} • Is R transitive? • Then, find the transitive closure of R

  14. Examples on real sets • Let R be a relation on real numbers R such that • xRy x = y • Is R reflexive? • Is R symmetric? • Is R transitive? • Let S be a relation on real numbers R such that • xSy x < y • Is S reflexive? • Is S symmetric? • Is S transitive? • Let T be a relation on positive integers N such that • mTn 3 | (m – n) • Is T reflexive? • Is T symmetric? • Is T transitive?

  15. Equivalence Relations

  16. Partitions • A partition of a set A (as we discussed earlier) is a collection of nonempty, mutually disjoint sets, whose union is A • A relation can be induced by a partition • For example, let A = {0, 1, 2, 3, 4} • Let A be partitioned into {0, 3, 4}, {1}, {2} • The binary relation induced by the partition is: x R y x and y are in the same subset of the partition • List the ordered pairs in R

  17. Equivalence relations • Given set A with a partition • Let R be the relation induced by the partition • Then, R is reflexive, symmetric, and transitive • As it turns out, any relation R is that is reflexive, symmetric, and transitive induces a partition • We call a relation with these three properties an equivalence relation

  18. Congruences • We say that m is congruent to n modulo d if and only if d | (m – n) • We write this: • m n (mod d) • Congruence mod d defines an equivalence relation • Reflexive, because m m (mod d) • Symmetric because m n (mod d) means that n m (mod d) • Transitive because m n (mod d) and n k (mod d) mean that m k (mod d) • Which of the following are true? • 12  7 (mod 5) • 6  -8 (mod 4) • 3  3 (mod 7)

  19. Equivalence classes • Let A be a set and R be an equivalence relation on A • For each element a in A, the equivalence class of a, written [a], is the set of all elements x in A such that a R x • Example • Let A be { 0, 1, 2, 3, 4, 5, 6, 7, 8} • Let R be congruence mod 3 • What's the equivalence class of 1? • For A with R as an equivalence relation on A • If b [a], then [a] = [b] • If b [a], then [a]  [b] = 

  20. Modular Arithmetic

  21. Modular arithmetic • Modular arithmetic has many applications • For those of you in Security, you know how many of them apply to cryptography • To help us, the following statements for integers a, b, and n, with n > 1, are all equivalent • n | (a – b) • a b (mod n) • a = b + kn for some integer k • a and b have the same remainder when divided by n • a mod n = b mod n

  22. Rules of modular arithmetic • Let a, b, c, d and n be integers with n > 1 • Let a c (mod n) and b  d (mod n), then: • (a + b)  (c + d) (mod n) • (a – b)  (c – d) (mod n) • ab cd (mod n) • am cm (mod n), for all positive integers m • If a and n are relatively prime (share no common factors), then there is a multiplicative inverse a-1 such that a-1a  1 (mod n) • I'd love to have us learn how to find this, but there isn't time

  23. Partial Orders

  24. Antisymmetry • Let R be a relation on a set A • R is antisymmetriciff for all a and b in A, if a R b and b R a, then a = b • That is, if two different elements are related to each other, then the relation is not antisymmetric • Let R be the "divides" relation on the set of all positive integers • Is Rantisymmetric? • Let S be the "divides" relation on the set of all integers • Is Santisymmetric?

  25. Partial orders • A relation that is reflexive, antisymmetric, and transitive is called a partial order • The subset relation is a partial order • Show it's reflexive • Show it's antisymmetric • Show it's transitive • The less than or equal to relation is a partial order • Show it's reflexive • Show it's antisymmetric • Show it's transitive

  26. Quiz

  27. Upcoming

  28. Next time… • Review for Exam 2

  29. Reminders • Work on Homework 6 • Due Friday before midnight • Study for Exam 2 • Next Monday in class • Review on Friday

More Related