Presentation is loading. Please wait.

Presentation is loading. Please wait.

Week 8 - Wednesday.  What did we talk about last time?  Cardinality  Countability  Relations.

Similar presentations


Presentation on theme: "Week 8 - Wednesday.  What did we talk about last time?  Cardinality  Countability  Relations."— Presentation transcript:

1 Week 8 - Wednesday

2  What did we talk about last time?  Cardinality  Countability  Relations

3

4  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  To solve sequence a k = Aa k-1 + Ba k-2  Find its characteristic equation t 2 – At – B = 0  If the equation has two distinct roots r and s  Substitute a 0 and a 1 into a n = Cr n + Ds n to find C and D  If the equation has a single root r  Substitute a 0 and a 1 into a n = Cr n + Dnr n to find C and D

6 Student Lecture

7

8  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 reflexive iff 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  Relation R is symmetric iff 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  Relation R is transitive iff 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  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  If you have a set A and a binary relation R on A, the transitive closure of R called R t satisfies the following properties:  R t is transitive R  RtR  Rt  If S is any other transitive relation that contains R, then R t  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 R t

13  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  Let R be a relation on real numbers R such that  x R y  x = y  Is R reflexive?  Is R symmetric?  Is R transitive?  Let S be a relation on real numbers R such that  x S y  x < y  Is S reflexive?  Is S symmetric?  Is S transitive?  Let T be a relation on positive integers N such that  m T n  3 | (m – n)  Is T reflexive?  Is T symmetric?  Is T transitive?

15

16  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  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  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  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

21  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 1. n | (a – b) 2. a  b (mod n) 3. a = b + kn for some integer k 4. a and b have the same remainder when divided by n 5. a mod n = b mod n

22  Let a, b, c, d and n be integers with n > 1  Let a  c (mod n) and b  d (mod n), then: 1. (a + b)  (c + d) (mod n) 2. (a – b)  (c – d) (mod n) 3. ab  cd (mod n) 4. a m  c m (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 -1 a  1 (mod n)  I'd love to have us learn how to find this, but there isn't time

23

24  Let R be a relation on a set A  R is antisymmetric iff 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 R antisymmetric?  Let S be the "divides" relation on the set of all integers  Is S antisymmetric?

25  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

27

28  Review for Exam 2

29  Work on Homework 6  Due Friday before midnight  Study for Exam 2  Next Monday in class  Review on Friday


Download ppt "Week 8 - Wednesday.  What did we talk about last time?  Cardinality  Countability  Relations."

Similar presentations


Ads by Google