CSC Discrete Math I, Spring Relations

Similar documents
Section Summary. Relations and Functions Properties of Relations. Combining Relations

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

1.4 Equivalence Relations and Partitions

Relations. Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations. Reading (Epp s textbook)

Relations Graphical View

Notes. Relations. Introduction. Notes. Relations. Notes. Definition. Example. Slides by Christopher M. Bourke Instructor: Berthe Y.

Math.3336: Discrete Mathematics. Chapter 9 Relations

COMP 182 Algorithmic Thinking. Relations. Luay Nakhleh Computer Science Rice University

14 Equivalence Relations

What are relations? f: A B

Equivalence relations

Discrete Mathematics. 2. Relations

CHAPTER 1. Relations. 1. Relations and Their Properties. Discussion

Deviations from the Mean

Relations. We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples.

Relations, Functions, and Sequences

Reading 11 : Relations and Functions

Writing Assignment 2 Student Sample Questions

Sets and Motivation for Boolean algebra

Math 2534 Solution to Test 3A Spring 2010

Relations. Definition 1 Let A and B be sets. A binary relation R from A to B is any subset of A B.

Massachusetts Institute of Technology 6.042J/18.062J, Fall 02: Mathematics for Computer Science Professor Albert Meyer and Dr.

Chapter 9: Relations Relations

Automata and Languages

1. To be a grandfather. Objects of our consideration are people; a person a is associated with a person b if a is a grandfather of b.

Math 42, Discrete Mathematics

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination I (Spring 2008)

Relations, Functions & Binary Operations

Relations. Relations. Definition. Let A and B be sets.

Chapter VI. Relations. Assumptions are the termites of relationships. Henry Winkler

Relations and Equivalence Relations

Solutions to In Class Problems Week 4, Mon.

Selected Solutions to Even Problems, Part 3

Logic, Set Theory and Computability [M. Coppenbarger]

a + b = b + a and a b = b a. (a + b) + c = a + (b + c) and (a b) c = a (b c). a (b + c) = a b + a c and (a + b) c = a c + b c.

(4.2) Equivalence Relations. 151 Math Exercises. Malek Zein AL-Abidin. King Saud University College of Science Department of Mathematics

Properties of the Integers

Diskrete Mathematik Solution 6

Relations. P. Danziger. We may represent a relation by a diagram in which a line is drawn between two elements if they are related.

Math 300: Final Exam Practice Solutions

3. R = = on Z. R, S, A, T.

MAD 3105 PRACTICE TEST 2 SOLUTIONS

Math 42, Discrete Mathematics

RED. Name: Instructor: Pace Nielsen Math 290 Section 1: Winter 2014 Final Exam

Section 7.1 Relations and Their Properties. Definition: A binary relation R from a set A to a set B is a subset R A B.

BADHAN ACADEMY OF MATHS CONTACT FOR HOMETUTOR, FOR 11 th 12 th B.B.A, B.C.A, DIPLOMA,SAT,CAT SSC 1.2 RELATIONS CHAPTER AT GLANCE

The main limitation of the concept of a. function

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

A NEW DEFINITION OF NATURAL NUMBERS And its Incidence on Teaching Mathematics Diego Pareja Heredia. Universidad del Quindío. Armenia.

Week 4-5: Binary Relations

Discrete Structures: Sample Questions, Exam 2, SOLUTIONS

Chapter 1. Sets and Numbers

arb where a A, b B and we say a is related to b. Howdowewritea is not related to b? 2Rw 1Ro A B = {(a, b) a A, b B}

1.A Sets, Relations, Graphs, and Functions 1.A.1 Set a collection of objects(element) Let A be a set and a be an elements in A, then we write a A.

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

Rela%ons and Their Proper%es. Slides by A. Bloomfield

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Outline for Today. Binary Relations. Equivalence Relations. Partial Orders. Quick Midterm Review

Chapter 2 - Relations

Chapter 1. Sets and Mappings

Math 4377/6308 Advanced Linear Algebra

Chapter 1 Preliminaries

Outline Inverse of a Relation Properties of Relations. Relations. Alice E. Fischer. April, 2018

Generating Permutations and Combinations

Relationships between elements of sets occur in many contexts. Every day we deal with

Foundations of Mathematics

Binary Relation Review Questions

MATHEMATICS. IMPORTANT FORMULAE AND CONCEPTS for. Final Revision CLASS XII CHAPTER WISE CONCEPTS, FORMULAS FOR QUICK REVISION.

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 7: Procedures for First-Order Theories, Part 1

A is a subset of (contained in) B A B iff x A = x B Socrates is a man. All men are mortal. A = B iff A B and B A. A B means A is a proper subset of B

Sets. Subsets. for any set A, A and A A vacuously true: if x then x A transitivity: A B, B C = A C N Z Q R C. C-N Math Massey, 72 / 125

ASSIGNMENT 1 SOLUTIONS

Problem 2: (Section 2.1 Exercise 10) (a.) How many elements are in the power set of the power set of the empty set?

Today. Binary relations establish a relationship between elements of two sets

Worksheet on Relations

QUASI-PREFERENCE: CHOICE ON PARTIALLY ORDERED SETS. Contents

Discrete Mathematics. Chapter 4. Relations and Digraphs Sanguk Noh

Relations --- Binary Relations. Debdeep Mukhopadhyay IIT Madras

Relations MATH Relations. Benjamin V.C. Collins, James A. Swenson MATH 2730

2 Equivalence Relations

1 Chapter 1: SETS. 1.1 Describing a set

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

5. Partitions and Relations Ch.22 of PJE.

Practice Exam 1 CIS/CSE 607, Spring 2009

CMPSCI 250: Introduction to Computation. Lecture #11: Equivalence Relations David Mix Barrington 27 September 2013

9. Quantifier-free Equality and Data Structures

Week 4-5: Generating Permutations and Combinations

9 RELATIONS. 9.1 Reflexive, symmetric and transitive relations. MATH Foundations of Pure Mathematics

Discrete Mathematics. Benny George K. September 22, 2011

CIS 375 Intro to Discrete Mathematics Exam 3 (Section M004: Blue) 6 December Points Possible

EQUIVALENCE RELATIONS (NOTES FOR STUDENTS) 1. RELATIONS

Chapter 6. Relations. 6.1 Relations

DRAFT CONCEPTUAL SOLUTION REPORT DRAFT

CHAPTER 1 SETS AND EVENTS

Tree sets. Reinhard Diestel

Nonnegative Matrices I

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Spring Based on Partee, ter Meulen, & Wall (1993), Mathematical Methods in Linguistics

CIS 375 Intro to Discrete Mathematics Exam 3 (Section M001: Green) 6 December Points Possible

BASIC MATHEMATICAL TECHNIQUES

Transcription:

CSC 125 - Discrete Math I, Spring 2017 Relations

Binary Relations Definition: A binary relation R from a set A to a set B is a subset of A B Note that a relation is more general than a function Example: Let A = {0, 1, 2} and B = {a, b} {(0, a), (0, b), (1, a), (2, b)} is a relation from A to B We can represent relations from a set A to a set B graphically or using a table

Binary Relation on a Set Definition: A binary relation R on a set A is a subset of A A or a relation from A to A Example: Let A = {a, b, c}, then R = {(a, a), (a, b), (a, c)} is a relation on A

Example Binary Relations Example: Consider these relations on the set of integers R 1 = {(a, b) a b} R 2 = {(a, b) a > b} R 3 = {(a, b) a = b a = b} R 4 = {(a, b) a = b} R 5 = {(a, b) a = b + 1} R 6 = {(a, b) a + b 3}

Reflexive Relations Definition: R is reflexive if and only if (a, a) R for every element a A Written symbolically, R is reflexive if and only if x((x, x) R) Examples: The following relations on the integers are reflexive: R 1 = {(a, b) a b} R 3 = {(a, b) a = b a = b} R 4 = {(a, b) a = b} The following relations are not reflexive: R 2 = {(a, b) a > b} (3 3) R 5 = {(a, b) a = b + 1} (3 3 + 1) R 6 = {(a, b) a + b 3} (4 + 4 3)

Symmetric Relations Definition: R is symmetric if and only if (b, a) R for all a, b A Written symbolically, R is symmetric if and only if x y((x, y) R (y, x) R) Examples: The following relations on the integers are symmetric: R 3 = {(a, b) a = b a = b} R 4 = {(a, b) a = b} R 6 = {(a, b) a + b 3} The following relations are not symmetric: R 1 = {(a, b) a b} (3 4 but 4 3) R 2 = {(a, b) a > b} (4 > 3 but 4 3) R 5 = {(a, b) a = b + 1} (4 = 3 + 1 but 3 4 + 1)

Antisymmetric Relations Definition: A relation R on set A is called antisymmetric if (a, b) R and (b, a) R, then a = b, for all a, b A Written symbolically, R is antisymmetric if and only if x y((x, y) R (y, x) R x = y) Examples: The following relations on the integers are antisymmetric: R 1 = {(a, b) a b} R 2 = {(a, b) a > b} R 4 = {(a, b) a = b} R 5 = {(a, b) a = b + 1} The following relations are not antisymmetric: R 3 = {(a, b) a = b a = b} (both (1, 1) and ( 1, 1) belong to R 3 ) R 6 = {(a, b) a + b 3} (both (1, 2) and (2, 1) belong to R 6

Transitive Relations Definition: A relation R on a set A is called transitive if whenever (a, b) R and (b, c) R, then (a, c) R, for all a, b, c A Written symbolically, R is transitive if and only if x y z((x, y) R (y, z) R (x, z) R) Examples: The following relations on the integers are transitive: R 1 = {(a, b) a b} R 2 = {(a, b) a > b} R 3 = {(a, b) a = b a = b} R 4 = {(a, b) a = b} The following relations are not transitive: R 5 = {(a, b) a = b + 1} (both (3,2) and (4,3) belong to R 5, but not (3,3)) R 6 = {(a, b) a + b 3} (both (2,1) and (1,2) belong to R 6, but not (2,2))

Combining Relations Given two relations R 1 and R 2, we can combine them using basic set operations to form new relations, such as R 1 R 2, R 1 R 2, R 1 R 2, and R 2 R 1 Example: Let A = {1, 2, 3} and B = {1, 2, 3, 4} and let R 1 = {(1, 1), (2, 2), (3, 3)} and R 2 = {(1, 1), (1, 2), (1, 3), (1, 4)} R 1 R 2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (3, 3)} R 1 R 2 = {(1, 1)} R 1 R 2 = {(2, 2), (3, 3)} R 2 R 1 = {(1, 2), (1, 3), (1, 4)}

Composition Definition: Let R 1 be a relation from a set A to a set B and R 2 be a relation from B to a set C, then the composition (or composite) or R 1 with R 2, denoted by R 2 R 1, is a relation from A to C consisting of the ordered pairs (a, c) where a A and c C and there exists an element b B where such that (a, b) R 1 and (b, c) R 2.

Powers of a Relation Definition: Let R be a binary relation on A, then the powers R n, n = 1, 2,..., are defined recursively by: R 1 = R R n+1 = R n R

Representing Relations as Zero-One Matrices A relation R from finite sets A = {a 1, a 2,..., a m } to B = {b 1, b 2,..., b n } can be represented by an m n zero-one matrix M R = [m ij ] where { 1 if (a i, b j ) R m i,j = 0 if (a i, b j ) R Note that we have induced an ordering on the elements in each set; the ordering is arbitrary but we need to be consistent

Representing Relations as Zero-One Matrices Example Let A = {a 1, a 2, a 3, a 4, a 5 } and B = {b 1, b 2, b 3 } and let R be a relation from A to B as follows: R = {(a 1, b 1 ), (a 1, b 2 ), (a 1, b 3 ), (a 2, b 1 ), (a 3, b 1 ), (a 3, b 2 ), (a 3, b 3 ), (a 5, b 1 )} The zero-one matrix representation is 1 1 1 1 0 0 M R = 1 1 1 0 0 0 1 0 0

Zero-One Matrix of a Relation on a Set Let R be a relation on a finite set A and let M R be the zero-one matrix representation of R R is reflexive if and only if the diagonal of M R is all ones R is symmetric if and only if M R is symmetric (M R = M T R ) R is antisymmetric if an only if the off-diagonal entries of M R + MR T are zero or one (but not two) R is transitive if and only if the support of MR 2 is a subset of the support of M R, where the support is the set of non-zero entries

Combining Relations with Zero-One Matrix Representations Let R 1 and R 2 be relations on a finite set A and let M R1 and M R2 be the respective zero-one matrix representations M R1 R 2 = M R1 M R2 = M R1 M R2 M R1 R 2 Let R be a relation from A to B and S be a relation from B to C and let M R and M S be the respective zero-one matrix representations M S R = M R M S

Equivalence Relations Definition: A relation on a set A is called an equivalence relation if it is reflexive, symmetric, and transitive Definition: Two elements a and b that are related by an equivalence relation are called equivalent, denoted as a b

Equivalence Relation Example Example: Suppose that R is a relation on the set of strings of English letters such that arb if and only if l(a) = l(b), where l is the length of the string To determine if R is an equivalence relation we need to show that all of the properties of an equivalence relation hold Reflexivity: Because l(a) = l(b), it follows that ara for all strings a Symmetry: Suppose that arb. Since l(a) = l(b), l(b) = l(a) also holds and bra Transitivity: Suppose that arb and brc. Since l(a) = l(b), and l(b) = l(c), l(a) = l(c) also holds and arc

Equivalence Classes Definition: Let R be an equivalence relation on a set A, then the set of all elements that are related to an element a of A is called the equivalence class of a, denoted by [a] R [a] R = {s (a, s) R} If b [a] R, then b is call a representative of this equivalence class

Equivalence Classes and Paritions Theorem 1: Let R be an equivalence relation on set A. The following statements for elements a and b of A are equivalent: arb [a] R = [b] R [a] R [b] R =

Partition of a Set Definition: A partition of a set S is a collection of disjoint nonempty subsets of S that have S as their union In other words, the collection of subsets A i where i I forms a partition of S if and only if A i for i I, A i A j = when i j, and A i = S i I

An Equivalence Relation Partitions a Set Let R be an equivalence relation on a set A. The union of all the equivalence classes of R is all of A since an element of a of A is in its own equivalence class [a] R, in other words [a] R = A a A From Theorem 1, it follows that these equivalence classes are either equal or disjoint, so [a] R [b] R = when [a] R [b] R Therefore, the equivalence classes form a partition of A, because they split A into disjoint subsets

Partial Orderings Definition: A relation R on a set S is called a paritial ordering, or partial order, if it is reflexive, antisymmetric, and transitive A set together with a partial ordering R is called a partially ordered set, or poset, and is denoted by (S, R)

Partial Ordering Example Example: Show that the greater than or equal relation ( ) is a partial ordering on the set of integers Reflexivity: a a for every integer a Antisymmetry: If a b and b a, then a = b Transitivity: If a b and b c, the a c

Comparability Definition: The elements a and b of a poset (S, ) are comparable if either a b or b a. When a and b are elements of S such that neither a b nor b a, then a and b are called incomparable Definition: If (S, ) is a poset and every two elements of S are comparable, S is called a totally ordered or linearly ordered set, and is called a total order or a linear order

Lexicographic Order Definition: Given two posets (A 1, 1 ) and (A 2, 2 ), the lexicographic ordering on A 1 A 2 is defined by specifying that (a 1, a 2 ) is less than (b 1, b 2 ), that is (a 1, a 2 ) (b 1, b 2 ), either if a 1 1 b 1 or if a 1 = b 1 and a 2 2 b 2 This definition can be extended to a lexicographic ordering of strings