slides

advertisement
CSE 20
DISCRETE MATH
Prof. Shachar Lovett
http://cseweb.ucsd.edu/classes/wi15/cse20-a/
Clicker
frequency:
CA
Todays topics
• Equivalence relations
• Section 6.2 in Jenkyns, Stephenson
(Binary) Relations
• Model a relation between two families of objects
• Formally:
• U universe set
• Relation: 𝑅 ⊆ π‘ˆ × π‘ˆ
• For π‘₯, 𝑦 ∈ π‘ˆ we write: π‘₯𝑅𝑦 as a shorthand for "(π‘₯, 𝑦) ∈ 𝑅“
• Example 1: x<y, formally…
• U=N
• “π‘₯ < 𝑦” represents the relation 𝑅 =
π‘₯, 𝑦 : π‘₯, 𝑦 ∈ 𝑁, π‘₯ < 𝑦
• Example 1: x<y, formally…
• U = P(N)
• “π‘₯ ⊂ 𝑦” represents the relation 𝑅 = { π‘₯, 𝑦 : π‘₯, 𝑦 ∈ 𝑃(𝑁), π‘₯ ⊂ 𝑦}
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 ∀π‘₯, 𝑦, 𝑧,
π‘₯𝑅𝑦 ∧ 𝑦𝑅𝑧 → π‘₯𝑅𝑧
• An equivalence relation is a relation which satisfies all of
them
Examples of equivalence relations
• U=Z (integers)
• xRy = “x=y”
Prove that R is an equivalence relation
Examples of equivalence relations
• U=Z (integers)
• xRy = “|x|=|y|” (absolute value of x = absolute value of y)
Prove that R is an equivalence relation
Examples of equivalence relations
• U=“all students in this class”
• xRy = “x and y have the same birthday”
Prove that R is an equivalence relation
Examples of equivalence relations
• U=Z (integers)
• xRy = “x+y is even”
Prove that R is an equivalence relation
What is so special about equivalence
relations?
• Equivalence relations describe a partition of the universe
U to equivalence classes
Equivalence classes
• Let 𝑃1 , 𝑃2 , … , 𝑃𝑛 be a partition of U
• For π‘₯ ∈ π‘ˆ, define πΆπ‘™π‘Žπ‘ π‘  π‘₯ to be the (unique!) part that x
belongs to
• Equivalently, define πΆπ‘™π‘Žπ‘ π‘ : π‘ˆ → {1, … , 𝑛} and equivalence
classes are defined by all elements with same image
𝑃𝑖 = {π‘₯ ∈ π‘ˆ: πΆπ‘™π‘Žπ‘ π‘  π‘₯ = 𝑖}
• Theorem: let 𝑅 ⊆ π‘ˆ × π‘ˆ be an equivalence relation. Then
there is a mapping πΆπ‘™π‘Žπ‘ π‘ : π‘ˆ → 𝐢 such that
∀π‘₯, 𝑦 ∈ π‘ˆ, π‘₯𝑅𝑦 ⇔ πΆπ‘™π‘Žπ‘ π‘  π‘₯ = πΆπ‘™π‘Žπ‘ π‘ (𝑦)
Equivalence classes: example 1
• U=Z (integers)
• xRy = “x=y”
Class(x)=
A. x
B. y
C. U
D. “x=y”
E. Other
Equivalence classes: example 2
• U=Z (integers)
• xRy = “|x|=|y|”
Class(x)=
A. x
B. |x|
C. “x=y”
D. “|x|=|y|”
E. Other
Equivalence classes: example 3
• U=“all students in this class”
• xRy = “x and y have the same birthday”
Class(x)=
A. x
B. Birthday of x
C. “x=y”
D. “|x|=|y|”
E. Other
Equivalence classes: example 4
• U=Z (integers)
• xRy = “x+y is even”
Class(x)=???
Figure this out in your groups
Equivalence classes: proof
• Theorem: let 𝑅 ⊆ π‘ˆ × π‘ˆ be an equivalence relation. Then
there is a mapping πΆπ‘™π‘Žπ‘ π‘ : π‘ˆ → 𝐢 such that
∀π‘₯, 𝑦 ∈ π‘ˆ, π‘₯𝑅𝑦 ⇔ πΆπ‘™π‘Žπ‘ π‘  π‘₯ = πΆπ‘™π‘Žπ‘ π‘ (𝑦)
Proof:
For each π‘₯ ∈ π‘ˆ, define: Class π‘₯ = {𝑦 ∈ π‘ˆ: π‘₯𝑅𝑦}
(and so 𝐢 = πΆπ‘™π‘Žπ‘ π‘  π‘₯ : π‘₯ ∈ π‘ˆ ⊂ 𝑃(π‘ˆ) )
We need to show that
∀π‘₯, 𝑦 ∈ π‘ˆ, π‘₯𝑅𝑦 ⇔ πΆπ‘™π‘Žπ‘ π‘  π‘₯ = πΆπ‘™π‘Žπ‘ π‘ (𝑦)
Equivalence classes: proof (contd)
For each π‘₯ ∈ π‘ˆ, define: Class π‘₯ = {𝑦 ∈ π‘ˆ: π‘₯𝑅𝑦}
(⇐) Assume Class π‘₯ = πΆπ‘™π‘Žπ‘ π‘ (𝑦). We will show xRy.
By definition: we need to show 𝑦 ∈ πΆπ‘™π‘Žπ‘ π‘ (π‘₯).
But 𝑦 ∈ πΆπ‘™π‘Žπ‘ π‘  𝑦 since R is reflexive (and so 𝑦𝑅𝑦)) and
since we assume Class π‘₯ = πΆπ‘™π‘Žπ‘ π‘ (𝑦) then also 𝑦 ∈
πΆπ‘™π‘Žπ‘ π‘ (π‘₯).
Equivalence classes: proof (contd)
For each π‘₯ ∈ π‘ˆ, define: Class π‘₯ = {𝑦 ∈ π‘ˆ: π‘₯𝑅𝑦}
(⇒) Assume xRy. We need to show Class π‘₯ = πΆπ‘™π‘Žπ‘ π‘ (𝑦).
We will first show πΆπ‘™π‘Žπ‘ π‘  𝑦 ⊆ πΆπ‘™π‘Žπ‘ π‘ (π‘₯). Let 𝑧 ∈ πΆπ‘™π‘Žπ‘ π‘  𝑦 .
Then y𝑅𝑧. Since R is transitive, π‘₯𝑅𝑦 ∧ 𝑦𝑅𝑧 imply that x𝑅𝑧.
So 𝑧 ∈ πΆπ‘™π‘Žπ‘ π‘ (π‘₯).
Since R is symmetric, we also have yRx. The same
argument as above (with the roles of x,y reversed) then
implies that πΆπ‘™π‘Žπ‘ π‘  π‘₯ ⊆ πΆπ‘™π‘Žπ‘ π‘ (𝑦). So: πΆπ‘™π‘Žπ‘ π‘  π‘₯ = πΆπ‘™π‘Žπ‘ π‘ (𝑦).
Next class
• Modular arithmetic
• Section 6.2 in Jenkyns, Stephenson
• Review session for midterm 2
Download