Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Discrete Mathematics: Relations, Lecture notes of Discrete Mathematics

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

2021/2022

Uploaded on 05/11/2023

stefan18
stefan18 ๐Ÿ‡บ๐Ÿ‡ธ

4.2

(35)

279 documents

1 / 37

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Discrete Mathematics
(Relations)
Pramod Ganapathi
Department of Computer Science
State University of New York at Stony Brook
January 24, 2021
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25

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.