Docsity

Discrete Mathematics: Relations, Lecture notes of Discrete Mathematics

Partial preview of the text

Download Discrete Mathematics: Relations and more Lecture notes Discrete Mathematics in PDF only on Docsity!

Discrete Mathematics

(Relations)

Pramod Ganapathi

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

M 1

M 2

M 3

M 4

F 1

F 2

F 3

F 4

F 5

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:

Inverse of a relation

Male Male

  • Example: Congruence modulo
  • M
  • M
  • M
  • M
  • F
  • F
  • F
  • F
  • F
  • M Female
  • M
  • M
  • M
  • F
  • F
  • F
  • F
  • F

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.