Download presentation
Presentation is loading. Please wait.
Published byStuart Norman Modified over 8 years ago
1
Week 8 - Monday
2
What did we talk about last time? Properties of functions One-to-one Onto Inverses Cardinality
4
An Arab sheikh tells his two sons to race their camels to a distant city to see who will inherit his fortune The one whose camel is slower wins After wandering aimlessly for days, the brothers ask a wise man for guidance Upon receiving the advice, they jump on the camels and race to the city as fast as they can What did the wise man say to them?
5
Consider f(x) = 3x 2 – 9 on R Does it have an inverse? What if its domain were restricted to R + ? Consider f(x) = 8x + 17 on R Does it have an inverse? What is it?
7
Cardinality gives the number of things in a set Cardinality is: Reflexive: A has the same cardinality as A Symmetric: If A has the same cardinality as B, B has the same cardinality as A Transitive: If A has the same cardinality as B, and B has the same cardinality as C, A has the same cardinality as C For finite sets, we could just count the things to determine if two sets have the same cardinality
8
Because we can't just count the number of things in infinite sets, we need a more general definition For any sets A and B, A has the same cardinality as B iff there is a bijective mapping A to B Thus, for any element in A, it corresponds to exactly one element in B, and everything in B has exactly one corresponding element in A
9
Show that the set of positive integers has the same cardinality as the set of all integers Hint: Create a bijective function from all integers to positive integers Hint 2: Map the positive integers to even integers and the negative integers to odd integers
10
A set is called countably infinite if it has the same cardinality as Z + You have just shown that Z is countable It turns out that (positive) rational numbers are countable too, because we can construct a table of their values and move diagonally across it, numbering values, skipping numbers that have been listed already 1/11/21/31/4 2/12/22/32/4 3/13/23/33/4 4/14/24/34/4
11
We showed that positive rational numbers were countable, but a trick similar to the one for integers can show that all rational numbers are countable The book gives a classic proof that real numbers are not countable, but we don't have time to go through it For future reference, the cardinality of positive integers, countable infinity, is named 0 (pronounced aleph null) The cardinality of real numbers, the first uncountable infinity (because there are infinitely many uncountable infinities), is named 1 (pronounced aleph 1)
12
Student Lecture
14
Relations are generalizations of functions In a function, an element of the domain must map to exactly one element of the co-domain In a relation, an element from one set can be related to any number (from zero up to infinity) of other elements Like functions, we're usually going to focus on binary relations We can define any binary relation between sets A and B as a subset of A x B
15
For binary relation R, x R y (x, y) R Let R be a relation from Z to Z such that (x, y) R iff x – y is even Is 1 R 3? Is 2 R 3? Is 2 R 2? Let C be a relation from R to R such that (x, y) R iff x 2 + y 2 = 1 Is (1, 0) C? Is 0 C 0? Is (-1/2, 3/2) C?
16
Consider the sets A = {2, 4, 6} and B = {1, 3, 5} Let R be the relation {(2,5), (4,1), (4,3), (6,5)} Draw the arrow diagram for R Is R a function? Let S be the relation for all (x, y) A x B, (x, y) S iff y = x + 1 Draw the arrow diagram for S Is S a function? x 2 + y 2 = 1 on real numbers is not a function for both reasons
17
We've relaxed things considerably by moving from functions to relations All relations have inverses (just reverse the order of the ordered pairs) Example Let A = {2,3,4} and B = {2,6,8} For all (x, y) A x B, x R y x | y List the ordered pairs in R List the ordered pairs in R -1
18
A directed graph describes a relationship between nodes One way to record a graph is as a matrix We can also think of a directed graph as a relation from a set to itself What's the relation for this directed graph? a a c c d d b b e e
20
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
21
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
22
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
23
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?
24
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 RtR 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
25
Let A = {0, 1, 2, 3} Let R = {(0,1), (1,2), (2,3)} Is R transitive? Then, find the transitive closure of R
26
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?
28
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
29
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
30
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)
31
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] =
33
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
34
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
36
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?
37
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
40
Finish relations Review for Exam 2
41
Work on Homework 6 Due Friday at exam Study for Exam 2 Friday in class Read Chapter 9
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.