# slides ```CSE 20
DISCRETE MATH
Prof. Shachar Lovett
http://cseweb.ucsd.edu/classes/wi15/cse20-a/
Clicker
frequency:
CA
Todays topics
• Relations
• Section 6.1 in Jenkyns, Stephenson
(Binary) Relations
• Model a relation between two families of objects
• Examples:
• 𝑥 &lt; 𝑦 for integer numbers
• A ⊂ 𝐵 for subsets of integers
(Binary) Relations
• Model a relation between two families of objects
• Formally:
• U universe set
• Relation: 𝑅 ⊆ 𝑈 &times; 𝑈
• For 𝑥, 𝑦 ∈ 𝑈 we write: 𝑥𝑅𝑦 as a shorthand for &quot;(𝑥, 𝑦) ∈ 𝑅“
• Example 1: x&lt;y, formally…
• U=N
• “𝑥 &lt; 𝑦” represents the relation 𝑅 =
𝑥, 𝑦 : 𝑥, 𝑦 ∈ 𝑁, 𝑥 &lt; 𝑦
• Example 1: x&lt;y, formally…
• U = P(N)
• “𝑥 ⊂ 𝑦” represents the relation 𝑅 = { 𝑥, 𝑦 : 𝑥, 𝑦 ∈ 𝑃(𝑁), 𝑥 ⊂ 𝑦}
Relations are graphs
• Think of relations as directed graphs
• U=nodes of graphs
• xRy means “there in an edge xy”
• Is
R
B.
R
C. Both
D. Neither
A.
?
?
Relations are graphs
• What does this relation captures?
xRy means
2
A. x&gt;y
B. x=y
3
1
C. x divides y
D. x+y
E. None/more than one
4
6
5
Three important properties of relations
• There are several important properties of relations
• We will focus on the most important three
• A relation R is symmetric if ∀𝑥, 𝑦 ∈ 𝑈, 𝑥𝑅𝑦 ⇔ 𝑦𝑅𝑥
• A relation R is reflexive if ∀𝑥 ∈ 𝑈, 𝑥𝑅𝑥
• A relation R is transitive if ∀𝑥, 𝑦, 𝑧 ∈ 𝑈, (𝑥𝑅𝑦 ∧ 𝑦𝑅𝑧) → 𝑥𝑅𝑧
Symmetric relations
• A relation is symmetric if ∀𝑥, 𝑦 ∈ 𝑈, 𝑥𝑅𝑦 ⇔ 𝑦𝑅𝑥
• As a graph, it is undirected
• Which of the following is symmetric
A.
B.
C.
D.
E.
x&lt;y
x divides y
x and y have the same sign
xy
None/more than one
Types of relations
• A relation is reflexive if ∀𝑥 ∈ 𝑈, 𝑥𝑅𝑥
• As a graph, it has loops in all vertices
• Which of the following is reflexive
A. x&lt;y
B. x divides y
C. x and y have the same sign
D. xy
E. None/more than one
Types of relations
• A relation is transitive if ∀𝑥, 𝑦, 𝑧 ∈ 𝑈, (𝑥𝑅𝑦 ∧ 𝑦𝑅𝑧) → 𝑥𝑅𝑧
• This is less intuitive, when viewed as a graph…
• Which of the following is transitive
A. x&lt;y
B. x divides y
C. x and y have the same sign
D. xy
E. None/more than one
• Let U=P(N) (all subsets of integers)
•R=⊆
• Is R symmetric?
A. Yes
B. No
• Let U=P(N) (all subsets of integers)
•R=⊆
• Is R reflexive?
A. Yes
B. No
• Let U=P(N) (all subsets of integers)
•R=⊆
• Is R transitive?
A. Yes
B. No
• Let U=P(N)
• R = ⊊ (ie xRy = “x is proper subset of y”)
• Is R symmetric / reflexive / transitive?
A. Yes,Yes,Yes
B. No,No,No
C. Yes,Yes,No
D. No,No,Yes
E. Other
• Let U=P(N)
• R = ⊈ (ie xRy = “x is NOT a subset of y”)
• Is R symmetric / reflexive / transitive?
A. Yes,Yes,Yes
B. No,No,No
C. Yes,Yes,No
D. No,No,Yes
E. Other