The main limitation of the concept of a. function

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

CSC Discrete Math I, Spring Relations

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

Relations Graphical View

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

Chapter 6. Relations. 6.1 Relations

Worksheet on Relations

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

Relations, Functions, and Sequences

1.4 Equivalence Relations and Partitions

Automata and Languages

Binary Relation Review Questions

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

1. (B) The union of sets A and B is the set whose elements belong to at least one of A

Reading 11 : Relations and Functions

Tree sets. Reinhard Diestel

Deviations from the Mean

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

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

Solutions to In Class Problems Week 4, Mon.

Binary Relations Part II

Chapter 2 - Relations

Relations, Functions & Binary Operations

Writing Assignment 2 Student Sample Questions

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

Part IA Numbers and Sets

Foundations of algebra

EQUIVALENCE RELATIONS (NOTES FOR STUDENTS) 1. RELATIONS

MATH 61-02: PRACTICE PROBLEMS FOR FINAL EXAM

Preference, Choice and Utility

Problem Set #1 solutions

ASSIGNMENT 1 SOLUTIONS

Discrete Mathematics: Lectures 6 and 7 Sets, Relations, Functions and Counting Instructor: Arijit Bishnu Date: August 4 and 6, 2009

5. Partitions and Relations Ch.22 of PJE.

In mathematics there are endless ways that two entities can be related

Math 2534 Solution to Test 3A Spring 2010

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.

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

Lecture 4.3: Closures and Equivalence Relations

Sets and Motivation for Boolean algebra

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Axioms of Kleene Algebra

Sets. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing Spring, Outline Sets An Algebra on Sets Summary

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

Exclusive Disjunction

Combinatorics. But there are some standard techniques. That s what we ll be studying.

Section 20: Arrow Diagrams on the Integers

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

Set Operations. Combining sets into new sets

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

Mathematical Logic Part Three

can only hit 3 points in the codomain. Hence, f is not surjective. For another example, if n = 4

LOGIC AND SET THEORY - HOMEWORK Question 1. n + 1 Unknown - either n or n 1, depending on whether { } A

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Cardinality and ordinal numbers

(x 1, y 1 ) = (x 2, y 2 ) if and only if x 1 = x 2 and y 1 = y 2.

CHAPTER 4 CLASSICAL PROPOSITIONAL SEMANTICS

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

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

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

At least one of us is a knave. What are A and B?

Today s topics. Binary Relations. Inverse Relations. Complementary Relations. Let R:A,B be any binary relation.

1 Reducability. CSCC63 Worksheet Reducability. For your reference, A T M is defined to be the language { M, w M accepts w}. Theorem 5.

1. Foundations of Numerics from Advanced Mathematics. Mathematical Essentials and Notation

Binary Relations Part Two

CHAPTER THREE: RELATIONS AND FUNCTIONS

Linear Algebra March 16, 2019

14 Equivalence Relations

Basic counting techniques. Periklis A. Papakonstantinou Rutgers Business School

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

Chapter12. Relations, Functions, and Induction

Notes for Science and Engineering Foundation Discrete Mathematics

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

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Solving Systems of Linear Equations

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

2. Prime and Maximal Ideals

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

Discrete Mathematics. 2. Relations

Set theory. Math 304 Spring 2007

Discrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland

What are relations? f: A B

Lecture 3: Sizes of Infinity

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Relations --- Binary Relations. Debdeep Mukhopadhyay IIT Madras

Cartesian Products and Relations

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

MA554 Assessment 1 Cosets and Lagrange s theorem

Math 300: Final Exam Practice Solutions

106 CHAPTER 3. TOPOLOGY OF THE REAL LINE. 2. The set of limit points of a set S is denoted L (S)

Chapter 1: Introduction to Vectors (based on Ian Doust s notes)

Week 4-5: Generating Permutations and Combinations

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

Solutions Parabola Volume 49, Issue 2 (2013)

ABOUT THE CLASS AND NOTES ON SET THEORY

The complex projective line

Scott Taylor 1. EQUIVALENCE RELATIONS. Definition 1.1. Let A be a set. An equivalence relation on A is a relation such that:

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

CITS2211 Discrete Structures (2017) Cardinality and Countability

Transcription:

Relations

The main limitation of the concept of a A function, by definition, assigns one output to each input. This means that a function cannot model relationships between sets where some objects on each side are related to several objects on the other side. On the right is a visualization of such a situation. function

Relations Let s study an example of a relation to understand the concept and how it generalizes the idea of a function. There are three people: John, Jane and Jim. John is 5 6 tall; Jane 6 1 and Jim is 6 5. Then there is the is taller than relation: Jim is taller than Jane and taller than John, and Jane is taller than John. This relation is visualized on the right side in two ways. The relation is NOT a function from A to B because John in A does not have an output, and Jim has two of them. Is taller than.. John Jane Jim John Jane X Jim X X

The Connection with the Cartesian Product The table representation of the is taller than relation on the previous page is our clue for what kind of mathematical object a relation is. We can think of the Cartesian product A B as the set of all cells of a table where the elements of A identify the rows, and the elements of B identify the columns. A relation is defined by the X s in that table. Therefore, a relation from A to B is a subset of A B.

The Formal Definition A relation R: A B is a subset of A B. We may write (a, b) R to indicate that a is related to b, or arb. If A = B, then we just call R a relation on A. If A = John, Jane, Jim and R is the is taller than relation on A introduced earlier, then R can be formally defined as R = { Jane, John, Jim, Jane, Jim, John }

Another Example of a Relation Let A = {1,2,3,4,5} and B = {1,2,3,4}. Let R be the less than or equal relation from A to B. Represent R by a table, then write it in formal set notation. Solution: the table is on the right. The set representation is 1 X X X X 2 X X X 3 X X 4 X 5 R = { 1,1, 1,2, 1,3, 1,4, 2,2, 2,3, 2,4, 3,3, 3,4, 4,4 }

Composition of Relations Recall that if g: A B and f: B C are functions, then the function f g: A C defined by f g x = f(g x ) for all x A is called the composition of f with g. Informally speaking, f g is the function we obtain by concatenating arrows: x g y f z means x f g z. We use the same approach to defining composition for two relations. Given relations R: A B and S: B C, S R: A C is the relation defined by identifying all arrow paths that lead from elements of A to elements of C. Formally, a S R c precisely if arb and bsc for some b B.

Example of a Composition of Relations Suppose A = {1,2,3}, B = {7,8}, C = {5}, and What is S R in set notation? R = 1,7, 3,8 S = { 7,5, 8,5 } Solution: 1R7 and 7S5 means 1 S R 5. 1 is not R related to anything else in B, and 7 is not S related to anything else in C, so 1 is not S R related to anything in C except 5. Likewise, 3R8 and 8S5 means 3 R S 5, and that is the only relationship between 3 and any element in C. The number 2 in A is not R related to anything in B, so 2 can also not be S R related to anything in C. Therefore, S R = { 1,5, 3,5 }.

Possible Properties of Relations on a Set: Reflexivity, Symmetry and Transitivity There are three special properties that a relation R on a set S may have: 1. Reflexivity: R is called reflexive iff every element of S is R related to itself: a S ara 2. Symmetry: R is called symmetric iff elements are always related both ways or not at all: a, b S(aRb bra) 3. Transitivity: R is called transitive iff indirectly related elements are always directly related: a, b, c S(aRb brc arc) If R has all three properties, it is called an equivalence relation. A fourth property is worth mentioning: R is called anti-symmetric iff the only symmetric relationships are possibly the trivial ones: a, b S(aRb bra a = b). Equivalently, R is anti-symmetric iff no nontrivial symmetric pairs exist: a, b S a b arb bra. Anti-symmetry is NOT the negation of symmetry. A relation may be neither, or both.

Visualizing the Properties It is helpful to have an image of some of the properties discussed on the previous page. While relations may be defined on infinite sets, we will consider only a relation R defined on a finite set S. Such a relation can be visualized as a table in which each cell represents an element of S S. If and only if the cell contains an X, then the corresponding element is in R. The diagonal of the relation is the set of pairs a, a with a S. (If S is infinite, imagine the table as being doubly infinite.) There is no good visualization for transitivity.

Visualizing Reflexivity Reflexivity means that the diagonal in the table is completely filled. Reflexivity says nothing about the off-diagonal elements. In the examples on the right, yellow marks the boxes that must be checked for reflexivity. 1 X 2 X 3 X 4 X reflexive 1 X X 2 X X 3 X 4 X X X not reflexive 1 X X 2 3 4 X not reflexive 1 X X X X 2 X X X X 3 X X X X 4 X X X X reflexive Four examples of reflexive or not reflexive relations R on the set {1,2,3,4}.

Visualizing Symmetry Symmetry means that the crosses must form pairs across the diagonal. Symmetry says nothing about the diagonal elements. They may or may not be checked. Unlike reflexivity, symmetry does not require any particular boxes, or any at all, to be checked. On this page, therefore, yellow is only used in nonsymmetric examples to highlight which boxes would have to be checked for symmetry. 1 2 3 4 symmetric 1 X X 2 X X X 3 X 4 X X not symmetric 1 X X X 2 3 X X 4 X 1 2 3 4 X symmetric not symmetric Four examples of symmetric or not symmetric relations R on the set {1,2,3,4}.

Visualizing Anti-Symmetry Anti-symmetry means that there can t be two checked boxes that lie in exactly opposite positions relative to the diagonal. Anti-Symmetry says nothing about the diagonal elements. They may or may not be checked. 1 2 3 4 1 X X 2 X 3 X X 4 X X Again, Anti-symmetry does not require any particular boxes, or any at all, to be checked. On this page, yellow represents symmetric pairs that prevent anti-symmetry. Anti-symmetry could be created by eliminating one, or both of each yellow pair. anti-symmetric 1 X X 2 X X X 3 X 4 X not anti-symmetric 1 X 2 X X 3 anti-symmetric 4 X X not anti-symmetric Four examples of anti-symmetric or not antisymmetric relations R on the set {1,2,3,4}.

The Relationship Between Symmetry and Anti-Symmetry Anti-Symmetry is not the negation of Symmetry. As far as the off-diagonal elements only are concerned, the two properties are the extremes of a spectrum. With symmetry, all off-diagonal elements come in symmetric pairs. With antisymmetry, none of them do. There are lots of shades of gray in between. Some offdiagonal elements may have a symmetric partner, others may not. Relations may therefore be neither symmetric nor anti-symmetric. Neither symmetry nor anti-symmetry make any requirements on the diagonal. Thus, if there are only diagonal elements in a relation, the relation is (trivially) both symmetric and anti-symmetric. 1 X 2 3 X 4 X The relation has only diagonal elements and is therefore both symmetric and anti-symmetric. 1 X 2 X X 3 X X 4 X The relation has both off-diagonal symmetric pairs (green) and off-diagonal elements that lack a symmetric partner (yellow) and is therefore neither symmetric nor anti-symmetric.

Using Combinatorics to Count Relations with Given Properties (1) To further solidify our understanding of the properties of relations, let us consider the problem of counting how may relations R there are on a set S with n elements that have one or several of the properties we discussed. Let us start by considering that each such relation corresponds to a unique choice of cells in a table that has n 2 elements. Each box may be marked or unmarked by an X. Therefore, by the multiplication principle, there are 2 n2 relations on S. Observe the order of operations here power towers like 2 n2 are rightassociative, which means they are evaluated from right to left (from the top down): 2 n2 = 2 (n2 ) There is a very good reason for this convention. Since (x a ) b = x ab, a leftassociative power tower is redundant as a notation, since it can always be reasonably expressed as a single exponentiation. For example: (10 10 ) 10 = 10 100 1 2 3 4 Example: S={1,2,3,4} has 4 elements. The table that represents each relation R on S has 4 2 = 16 cells (green). There are 2 42 = 2 16 = 65536 possible relations on S. The right-associative power tower cannot, at least not if you wish to avoid writing very large numbers: 10 1010 = 10 10000000000.

Using Combinatorics to Count Relations with Given Properties (2) Let us now count the number of relations on a set S with n elements that have specific properties. Reflexivity requires the diagonal to be checked. There are n diagonal cells. Thus, we only have complete freedom of choice over n 2 n cells. Thus, the number of reflexive relations on a set S with n elements is 2 n2 n. Symmetry requires the cells below the diagonal to be a mirror image of those above. The diagonal itself is subject to free choice. There are therefore only σn k=1 k = n(n+1) cells whose contents we can 2 freely choose. Thus, the number of symmetric relations on a set S with n elements is 2 n(n+1) 2. In the visualization on the right, green marks cells whose content can be freely chosen. 1 X 2 X 3 X 4 X choosing a reflexive relation 1 2 3 4 choosing a symmetric relation

Using Combinatorics to Count Relations with Given Properties (3) Reflexivity and symmetry combined leave us free to choose above the diagonal only. There are σ n 1 n 1 n k=1 k = many such cells. 2 Thus, the number of reflexive and symmetric relations on a set S with n elements is 2 n(n 1) 2. In the case of anti-symmetry, the diagonal is unconstrained, but for non-trivial symmetric pairs, we have 3 possibilities: just one of them may be checked, or none. Therefore, the number of anti-symmetric relations on a set S with n elements is 2 n 3 n(n 1) 2. Transitive relations are hard to count. We will not address this problem here. In the visualization on the right, green marks cells whose content can be freely chosen. Pink marks cells with a possible restriction. 1 X 2 X 3 X 4 X choosing a reflexive and symmetric relation 1 2 3 4 choosing an anti-symmetric relation. Pink cells must be empty if the corresponding symmetric cell is checked, and is unconstrained otherwise.

Standard Relations on the Real Numbers and their Properties < (the less than relation on real numbers) is not reflexive, not symmetric, anti-symmetric and transitive. (the less than or equal relation on real numbers) is reflexive, not symmetric, antisymmetric and transitive. = (the equality relation on real numbers) is reflexive, symmetric, anti-symmetric and transitive. It is an equivalence relation. Notice that this relation is both symmetric and anti-symmetric because it only contains the diagonal. Relations on R: < = Reflexive Symmetric Anti-Symmetric Transitive Equivalence (the nonequality relation on real numbers) is not reflexive, symmetric, not antisymmetric and not transitive.

Explanation of the concept of Equivalence Relation The common-sense meaning of equivalence is as good as, at least as far as a certain purpose is concerned. Here are two examples of equivalence in real life: People are legally equivalent we are all individuals, but the same under the law. Two $20 bills are different objects, but they are the same for purposes of payment. This common sense notion of equivalence is obviously reflexive: every object is equivalent to itself. It is also naturally symmetric: if I m as good as you, then you re as good as me. It is also naturally transitive: if Bob is as good as Jane, and Jane is as good as Joe, then Bob is as good as Joe.

Another example of an equivalence relation Let s prove that the following is an equivalence relation on the integers: arb iff b a is even. R is reflexive because for all integers a, a a = 0 is even. R is symmetric because for all integers a, b, if b a is even, then by definition, b a = 2n for some integer n, and then a b = b a = 2n is even as well. R is transitive because for all integers a, b, c, if b a is even, and c b is even, then by definition, b a = 2n for some integer n and c b = 2k for some integer k. By adding the two equations, we get b a + c b = c a = 2n + 2k = 2 n + k so c a is even.

Squaring Relations If R: S S is a relation on a set S, then we can compose R with itself: R R = R 2. Let us ponder the meaning of this relation. By definition, two elements of a, c S are R 2 related if they are indirectly R related through a third element b S: ar 2 c means arb and brc for some b S. This means that R 2 contains all the indirect R - relationships with one degree of separation. Example: let S be the set of cities in the world that have an airport. Let R be the relation on S where two cities are related iff there is a direct flight between them. Then two cities are R 2 related if you can fly between them with exactly one stop.

Squaring the Less Than Relation < is the less than relation on the real numbers. What is < 2? By definition, a < 2 c exactly when a < b and b < c for some real number b. But when that is the case a < c by transitivity of the < relation. Conversely, if a < c, then we can find a real number b such that a < b < c. This is one of the fundamental properties of the real numbers. Therefore, a < 2 c. We just proved that a c(a < c a < 2 c). Therefore, the two relations are equal: < 2 = <. The same reasoning applies to the relation on the real numbers. In the same way as above, we can prove that 2 =.

Squaring the Non-Equality Relation is the non-equal relation on the real numbers. What is 2? By definition, a 2 c exactly when a b and b c for some real number b. This means that any two real numbers a, c are in the 2 relationship, since for any two such numbers, you can always find a third one that is equal to neither of them. Therefore, 2 = R R = R 2.

Generalization It was the transitivity of the < relation that caused all squared relationships to be original relationships as well. This leads us to the following Theorem: If R is a transitive relation on S, then R 2 R. The proof is very simple: suppose (a, c) R 2, i.e. ar 2 c. By definition of the square relation, that means that arb and brc for some b S. Since R is transitive, arc. Hence (a, c) R.

Can we get the opposite inclusion? The theorem on the previous page suggests the question of what condition might guarantee that R R 2. It turns out that reflexivity is a sufficient condition for that (though not a necessary one, as the example of the < relation on the real numbers show.) Theorem: If R is a reflexive relation on S, then R R 2. Proof: suppose a, b R, i.e. arb. Since R is reflexive, brb. Therefore, by definition of R 2, ar 2 b and therefore a, b R 2. Corollary: If R is reflexive and transitive, then R = R 2. This theorem makes it easy to determine, for example, that the equality relation squared is the equality relation: (= 2 ) = =.