





























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Binary relations, functions vs. relations, inverse relations, properties of relations, equivalence relations, and equivalence classes. It includes examples and problems with solutions. authored by Pramod Ganapathi from the Department of Computer Science at the State University of New York at Stony Brook.
Typology: Lecture notes
1 / 37
This page cannot be seen from the preview
Don't miss anything!
Department of Computer Science State University of New York at Stony Brook
January 24, 2021
Are these functions?
Problem Are these functions? โ rational p = rational q โ m < n โ d does not divide n โ n leaves a remainder of 5 when divided by d โ line 1 is parallel to line
2 โ person a is a parent of person b โ triangle t 1 is congruent to triangle t 2 โ edge e 1 is adjacent to edge e 2 โ matrix A is orthogonal to matrix B No! (Because an input is mapped to more than one output.) What are these mappings called? Relations!
Functions vs. relations
-10 -5 5 10
x
20
40
60
80
100
y
y = x^220 40 60 80 100 x
5
10
y x = y^2
y = x^2 y = ยฑ โ x Function? 3 7 Relation? 3 3
Functions vs. relations
-10 -5 5 10
x
5
10
y
-10 -5 5 10
x
5
10
y
y = x y โฅ x Function? 3 7 Relation? 3 3
Example: Marriage relation
Male
Female
Example: Less than
Problem A relation L : R โ R as follows. For all real numbers x and y, (x, y) โ L โ x L y โ x < y. Draw the graph of L as a subset of the Cartesian plane R ร R. Solution L = {(โ 10. 678 , 30 .23), (17. 13 , 45 .98), (100/ 9 , 200),.. .} Graph:
Male Male
Example: Inverse of a finite relation
Problem Let A = { 2 , 3 , 4 } and B = { 2 , 6 , 8 }. Let R : A to B. For all (a, b) โ A ร B, a R b โ a | b Determine R and Rโ^1. Draw arrow diagrams for both. Describe Rโ^1 in words. Solution R = {(2, 2), (2, 6), (2, 8), (3, 6), (4, 8)} Rโ^1 = {(2, 2), (6, 2), (8, 2), (6, 3), (8, 4)} For all (b, a) โ B ร A, (b, a) โ Rโ^1 โ b is a multiple of a
Example: Inverse of an infinite relation
Problem Define a relation R from R to R as follows: For all (u, v) โ R ร R, u R v โ v = 2|u|. Draw the graphs of R and Rโ^1 in the Cartesian plane. Is Rโ^1 a function? Solution Rโ^1 is not a function. Why?
Example: Relation on a set
Problem Let A = { 3 , 4 , 5 , 6 , 7 , 8 }. Define relation R on A as follows. For all x, y โ A, x R y โ 2 |(x โ y). Draw the graph of R. Solution
Reflexivity, symmetry, and transitivity
Properties Set A = { 2 , 3 , 4 , 6 , 7 , 9 } Relation R on set A is: โx, y โ A, x R y โ 3 | (x โ y)
Reflexivity. โx โ A, (x, x) โ R. Symmetry. โx, y โ A, if (x, y) โ R, then (y, x) โ R. Transitivity. โx, y, z โ A, if (x, y) โ R and (y, z) โ R, then (x, z) โ R.
Example
Problem A = { 0 , 1 , 2 , 3 }. R = {(0, 0), (0, 2), (0, 3), (2, 3)}. Is R reflexive, symmetric, and transitive? Solution
Not reflexive. e.g.: (1, 1) 6 โ R. โx โ A, (x, x) 6 โ R. Not symmetric. e.g.: (0, 3) โ R but (3, 0) 6 โ R. โx, y โ A, if (x, y) โ R, then (y, x) 6 โ R. Transitive. โx, y, z โ A, if (x, y) โ R and (y, z) โ R, then (x, z) โ R.
Example
Problem A = { 0 , 1 , 2 , 3 }. R = {(0, 1), (2, 3)}. Is R reflexive, symmetric, and transitive? Solution
Not reflexive. e.g.: (0, 0) 6 โ R. โx โ A, (x, x) 6 โ R. Not symmetric. e.g.: (0, 1) โ R but (1, 0) 6 โ R. โx, y โ A, if (x, y) โ R, then (y, x) 6 โ R. Transitive. Why? โx, y, z โ A, if (x, y) โ R and (y, z) โ R, then (x, z) โ R.