Week 2 Relations Discrete Math Marie Demlov - - PowerPoint PPT Presentation

week 2 relations
SMART_READER_LITE
LIVE PREVIEW

Week 2 Relations Discrete Math Marie Demlov - - PowerPoint PPT Presentation

Binary Relations Exercises Week 2 Relations Discrete Math Marie Demlov http://math.feld.cvut.cz/demlova February 27, 2020 Marie Demlova: Discrete Math Operations with Relations Binary Relations Relations on a Set Exercises Equivalence


slide-1
SLIDE 1

Binary Relations Exercises

Week 2 Relations

Discrete Math Marie Demlová http://math.feld.cvut.cz/demlova February 27, 2020

Marie Demlova: Discrete Math

slide-2
SLIDE 2

Binary Relations Exercises Operations with Relations Relations on a Set Equivalence Relations

Binary Relations

A relation (more precisely a binary relation) from a set A into a set B is any set of ordered pairs R ⊆ A × B. If A = B we speak about a relation on a set A. Examples. ◮ To be a subset. Objects are subsets of a given set U; a subset X is related to a subset Y if X is a subset of Y . ◮ To be greater or equal. Objects are numbers; a number n is related to a number m if n is greater than or equal to m. ◮ To be a student of a study group. Objects are first year students and study groups; a student a is related to a study group number K if student a belongs to study group K. ◮ The sine function. Consider real numbers; a number x is related to a number y if y = sin x.

Marie Demlova: Discrete Math

slide-3
SLIDE 3

Binary Relations Exercises Operations with Relations Relations on a Set Equivalence Relations

Operations with Relations

Set operations Let R and S be two relations from a set A into a set B. ◮ The intersection of relations R and S is R ∩ S ; ◮ The union of R and S is R ∪ S ; ◮ The complement of R is R = (A × B) \ R . Inverse Relation. Given R a relation from A into B. Then the inverse relation of the relation R is R −1 from B into A, defined x R −1y if and only if y R x.

Marie Demlova: Discrete Math

slide-4
SLIDE 4

Binary Relations Exercises Operations with Relations Relations on a Set Equivalence Relations

Operations with Relations

Composition of Relations. Given R a relation from A into B and S a relation from B into

  • C. Then the composition R ◦ S (sometimes also called the

product), is the relation from A into C defined by: a (R ◦ S) c iff there is b ∈ B such that a R b and b S c. Proposition. The composition of relations is associative. I.e., if R is a relation from A to B, S is a relation from B to C, and T is a relation from C to D then R ◦ (S ◦ T) = (R ◦ S) ◦ T .

Marie Demlova: Discrete Math

slide-5
SLIDE 5

Binary Relations Exercises Operations with Relations Relations on a Set Equivalence Relations

Operations with Relations

Proposition. The composition of relations is not commutative. It is not the case that R ◦ S = S ◦ R holds for all relations R and S .

  • Example. Let A be the set of all people in the Czech Republic.

Consider the following two relations R , S defined on A: a R b iff a is a sibling of b and a = b. c S d iff c is a child of d. Then R ◦ S = S ◦ R .

Marie Demlova: Discrete Math

slide-6
SLIDE 6

Binary Relations Exercises Operations with Relations Relations on a Set Equivalence Relations

Relations on a Set

Properties of relations on a set. We say that relation R on A is ◮ reflexive if for every a ∈ A it is a R a; ◮ symmetric if for every a, b ∈ A it holds that: a R b implies b R a; ◮ antisymmetric if for every a, b ∈ A it holds that: a R b and b R a imply a = b; ◮ transitive if for every a, b, c ∈ A it holds that: if a R b and b R c then a R c.

Marie Demlova: Discrete Math

slide-7
SLIDE 7

Binary Relations Exercises Operations with Relations Relations on a Set Equivalence Relations

Equivalence Relations

A relation R on A is equivalence if it is reflexive, symmetric and transitive. Given an equivalence relation R on A. An equivalence class of R corresponding to a ∈ A is the set R [a] = {b ∈ A | a R b}. Example 1. Then relation R is an equivalence on Z: m R n if and only if m − n is divisible by 12, (m, n ∈ Z). For R from Example 1 there are twelve distinct equivalence classes, namely R [i], i = 0, 1, . . . , 11.

Marie Demlova: Discrete Math

slide-8
SLIDE 8

Binary Relations Exercises Operations with Relations Relations on a Set Equivalence Relations

Equivalence Relations

Properties of the Set of Equivalence Classes. Let R be an equivalence on A. The set { R [a] | a ∈ A} has the following properties: ◮ Every a ∈ A belongs to R [a]; so { R [a] | a ∈ A} = A. ◮ Equivalence classes R [a] are pairwise disjoint. That is, if R [a] ∩ R [b] = ∅, then R [a] = R [b].

  • Partition. Let A be a non-empty set. A set S of non-empty

subsets of A is a partition of A if the following hold:

  • 1. Every a ∈ A belongs to some member of S, i.e. S = A.
  • 2. The sets in S are pairwise disjoint. I.e., if X ∩ Y = ∅ then

X = Y for all X, Y ∈ S.

Marie Demlova: Discrete Math

slide-9
SLIDE 9

Binary Relations Exercises Operations with Relations Relations on a Set Equivalence Relations

Equivalence Relations

Proposition. Let S be a partition of A. Then the relation R S defined by: a R Sb if and only if a, b ∈ X for some X ∈ S is an equivalence on A. If we start with an equivalence R , form the corresponding partition into classes of R , and finally we make the equivalence relation corresponding to the partition, we get the equivalence R . If we start with a partition, then form corresponding equivalence, and finish with the partition into classes of the equivalence, we get the original partition.

Marie Demlova: Discrete Math

slide-10
SLIDE 10

Binary Relations Exercises

Exercises

Exercise 1. Write the following relations on a set A as sets of ordered pairs: a) A is the set of all subsets of the set {1, 2}, relation R is “to be a proper subset”. This means that for X, Y ∈ A we have X R Y if and only if X ⊆ Y and X = Y . b) A = {2, 4, 5, 8, 45, 60}, R is the relation of divisibility; i.e. m R n if and only if m divides n.

Marie Demlova: Discrete Math

slide-11
SLIDE 11

Binary Relations Exercises

Exercises

Exercise 2. A relation R on a closed interval A = [0, 4] is given by: x R y if and only if x2 + y2 + 7 ≤ 4x + 4y. Decide a) whether 2( R ◦ R )2 and b) whether 0 (R−1 ◦ R) 3. Exercise 3. A relation R on a closed interval A = [0, 1] is given by: x R y if and only if y = 2|x − 1

2|. Sketch in a plane (as a set of

  • rdered pairs) the relations R , R −1 and R ◦ R −1.

Marie Demlova: Discrete Math

slide-12
SLIDE 12

Binary Relations Exercises

Exercises

Exercise 4. Give the properties of the following relations on the set of all natural numbers N: a) m R n if and only if m divides n; b) m R n if and only if m + n ≥ 50; c) m R n if and only if m + n is even; d) m R n if and only if m · n is even; e) m R n if and only if m = nk for some k ∈ N; f) m R n if and only if m + n is a multiple of 3; g) m R n if and only if m > n.

Marie Demlova: Discrete Math

slide-13
SLIDE 13

Binary Relations Exercises

Exercises

Exercise 5. In the following examples S is a relation on a set A and x, y are elements of set A. Decide whether S is reflexive, symmetric, antisymmetric, transitive. Is it an equivalence, an order relation? a) A is the set of all complex numbers, x S y iff |x| = |y|. b) A is the set of all complex numbers, x S y iff |x| < |y|. c) A is the set of all real numbers, x S y iff x − y is a rational number. d) A is the set of all triangles of a given plane, two triangles are related in S iff they are congruent. e) A is the set of all triangles of a given plane, two triangles are related in S iff they are similar. f) A is the set of all subsets of a set B, two subsets X, Y of the set B are related in S iff they have the same cardinality; i.e., iff there exists an injective mapping of X onto Y .

Marie Demlova: Discrete Math

slide-14
SLIDE 14

Binary Relations Exercises

Exercises

Exercise 6. Given two relations R and S from a set A into a set B. Decide whether the following is true: a) (R ∪ S)−1 = R−1 ∪ S−1 ; b) (R ∩ S)−1 = R−1 ∩ S−1 .

Marie Demlova: Discrete Math

slide-15
SLIDE 15

Binary Relations Exercises

Exercises

Exercise 7. Given two relations R and S on a set A. Decide whether it is true: a) If R and S are reflexive, then so is R ◦ S . b) If R and S are symmetric, then so is R ◦ S . c) If R and S are antisymmetric, then so is R ◦ S . d) If R and S are transitive, then so is R ◦ S .

Marie Demlova: Discrete Math