Reminders: –Test3 is scheduled for Friday, April 25 Email was sent that included a proposed schedule –HW 8 is due Wednesday, April 9 in class Pascal’s.

Slides:



Advertisements
Similar presentations
Chapter 2 Revision of Mathematical Notations and Techniques
Advertisements

Section 7.5: Equivalence Relations Def: A relation R on a set A is called an equivalence relation if it is reflexive, symmetric, and transitive. Ex: Let.
Discrete Mathematics Relations
Copyright © Cengage Learning. All rights reserved.
Instructor: Hayk Melikya
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Section 1.6: Sets Sets are the most basic of discrete structures and also the most general. Several of the discrete structures we will study are built.
Section 7.4: Closures of Relations Let R be a relation on a set A. We have talked about 6 properties that a relation on a set may or may not possess: reflexive,
The Engineering Design of Systems: Models and Methods
Basic Properties of Relations
Math 3121 Abstract Algebra I
CSE115/ENGR160 Discrete Mathematics 04/24/12 Ming-Hsuan Yang UC Merced 1.
SET.   A set is a collection of elements.   Sets are usually denoted by capital letters A, B, Ω, etc.   Elements are usually denoted by lower case.
1 Section 7.1 Relations and their properties. 2 Binary relation A binary relation is a set of ordered pairs that expresses a relationship between elements.
Section 7.6: Partial Orderings Def: A relation R on a set S is called a partial ordering (or partial order) if it is reflexive, antisymmetric, and transitive.
Partially Ordered Sets (POSets)
Relations Chapter 9.
Section 1.8: Functions A function is a mapping from one set to another that satisfies certain properties. We will first introduce the notion of a mapping.
Section 4.3: Permutations and Combinations Def: A permutation of a set of distinct objects is an ordered arrangement of these objects. Ex: {a, b, c, d}
The Integers and Division
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
1 Relations and Their Properties Epp, section ??? CS 202 Aaron Bloomfield.
April 10, 2002Applied Discrete Mathematics Week 10: Relations 1 Counting Relations Example: How many different reflexive relations can be defined on a.
Ordered Sets. Relations. Equivalence Relations 1.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Unit Unit 04 Relations IT DisiciplineITD1111 Discrete Mathematics & Statistics STDTLP1 Unit 4 Relations.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFunctions.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
April 14, 2015Applied Discrete Mathematics Week 10: Equivalence Relations 1 Properties of Relations Definition: A relation R on a set A is called transitive.
1 Relations and Their Properties Rosen, section 7.1 CS/APMA 202 Aaron Bloomfield.
Relations, Functions, and Countability
Relations and their Properties
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
ELEMENTARY SET THEORY.
Section 3.3: Mathematical Induction Mathematical induction is a proof technique that can be used to prove theorems of the form:  n  Z +,P(n) We have.
Section 4.4 Properties of Relations. Order Relations Draw an arrow diagram for the relation R defined on the set {1,2,3,4} such that
Relations. Important Definitions We covered all of these definitions on the board on Monday, November 7 th. Definition 1 Definition 2 Definition 3 Definition.
CS 103 Discrete Structures Lecture 19 Relations. Chapter 9.
Problem Statement How do we represent relationship between two related elements ?
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Lecture 4 Infinite Cardinals. Some Philosophy: What is “2”? Definition 1: 2 = 1+1. This actually needs the definition of “1” and the definition of the.
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
Section 3.2: Sequences and Summations. Def: A sequence is a function from a subset of the set of integers (usually the set of natural numbers) to a set.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
RelationsCSCE 235, Spring Introduction A relation between elements of two sets is a subset of their Cartesian products (set of all ordered pairs.
Set Theory Concepts Set – A collection of “elements” (objects, members) denoted by upper case letters A, B, etc. elements are lower case brackets are used.
Relations and Functions ORDERED PAIRS AND CARTESIAN PRODUCT An ordered pair consists of two elements, say a and b, in which one of them, say a is designated.
ORDERED SETS. RELATIONS COSC-1321 Discrete Structures 1.
Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and B = {a,b} {( 0, a), (
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
“It is impossible to define every concept.” For example a “set” can not be defined. But Here are a list of things we shall simply assume about sets. A.
Section 9.1. Section Summary Relations and Functions Properties of Relations Reflexive Relations Symmetric and Antisymmetric Relations Transitive Relations.
Sets, Permutations, and Combinations. Lecture 4-1: Sets Sets: Powerful tool in computer science to solve real world problems. A set is a collection of.
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
The Relation Induced by a Partition
Relations and Their Properties
Chapter 2 Sets and Functions.
Relations and Their Properties
Relations Chapter 9.
Set, Combinatorics, Probability & Number Theory
Applied Discrete Mathematics Week 10: Relations
RELATION KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS )
Relations and Their Properties
Mathematical Background 1
Mathematical Background 1
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Presentation transcript:

Reminders: –Test3 is scheduled for Friday, April 25 was sent that included a proposed schedule –HW 8 is due Wednesday, April 9 in class Pascal’s Office Hours are cancelled (semester) –Me: M,T 3:30-5pm & W 3:30-4:30pm - Ols 228D –Emmanuel: R 7-8pm & F 3-4pm – Ols 011 (  25 th ) Return Test 2: –Avg: 70, Median: 74 – –< 50 scores are headed in the direction of failing –Be sure to review material that gave you trouble –Lower right hand corner has current letter grade

Section 7.1: Relations and Their Properties Def: Let A and B be sets. A binary relation from A to B is a subset of A  B. Remark: Note that this definition is identical to the definition of a map from A to B. Hence a binary relation from A to B is the same as a map from A to B. Ex: Let A = {a, b, c} and B = {1, 2, 3}. Then A  B = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3), (c, 1), (c, 2), (c, 3)}. So, in particular, {(a, 3), (c, 1), (c, 2), (c, 3)} is a binary relation from A to B. We say that “a is related to 3” or “a R 3” since (a, 3)  R.

Ex: Let A be the set of all cities in the world and B be the set of the 50 states in the USA. Define the relation R by R = {(a, b) | city a is in state b}. Then (Charlottesville, Virginia), (Portland, Oregon), and (New York, New York) are all members of R. (Charlottesville, Utah) is not a member of R. Note that some cities such as Reykjavik, which is the capital of Iceland, won’t appear as the first member of any pair in R even though Reykjavik is in the set A. This is because Reykjavik is not a city in any of the 50 states of the USA. Further note that (Richmond, Virginia) and (Richmond, Ohio) are both members of R. Strictly speaking, even though the two cities are labeled with the same name, they are different cities. [Such inconsistencies are why I usually stay away from RWE.

Relations on a Set Terminology: Let A be a set. Then we can form a binary relation from A to A. Instead of calling such a relation “a binary relation from A to A” we instead say that R is a “relation on A”. Ex: Let A = {1, 2, 3, 4} and define R = {(a, b) | a divides b}. Then R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}. Ex: If A is a finite set with |A| = n, how many different relations are there on A? Since a relation on A is simply a subset of A  A, then we are really asking “how many subsets are there of A  A” or |P(A  A)|? Well |A  A| = n*n = n 2 so |P(A  A)| = 2 |A  A| = 2 n 2.

Properties of Relations on a Set Def: A relation R on a set A is called reflexive if (a, a)  R for every element a  A. Ex: Let A = {1, 2, 3, 4} and define R = {(a, b) | a divides b}. We saw that R was reflexive since every number divides itself. In fact we could let A = Z + and define R the same way and R would be reflexive. However this is a different relation than the previous relation. Indeed, this relation has infinite cardinality! Ex: Let A = {x, y, z} and R = {(x, x), (x, y), (y, y), (z, y)}. This relation is not reflexive since (z, z)  R. Ex: Let A be a set. Then R =  is a relation on A called the empty relation. The empty relation is only reflexive when A = .

Def: A relation R on a set A is called symmetric if (b, a)  R whenever (a, b)  R. Ex: Let A = {1, 2, 3, 4} and define R = {(a, b) | a divides b}. R is not symmetric. For example, (1, 2)  R but (2, 1)  R. Ex: Let A = {w, x, y, z} and R = {(w, x), (x, w), (y, y), (y, z), (z, y)} This relation is symmetric. It satisfies the above criterion. Note that symmetry is a different kind of requirement than reflexivity. Reflexivity requires that certain pairs must be in R, namely all pairs of the form (a, a) for every element in A. However symmetry only requires that if a pair (a, b) is in R, then the pair (b, a) must also be in R. But it is not required that pairs of the form (a, b) are in R unless the pair (b, a) is in R. Simply stated, you must have both pairs or neither. Ex: The empty relation is always symmetric regardless of A.

Def: A relation R on a set A is called antisymmetric if whenever (b, a)  R and (a, b)  R then a = b. Ex: Let A = {1, 2, 3, 4} and define R = {(a, b) | a divides b}. R is antisymmetric because the only way that it is possible that both a divides b and b divides a is if they are the same number. Ex: Let A = Z and define R = {(a, b) | a divides b}. R is not antisymmetric because 1 divides -1 and -1 divides 1 but 1  -1. Note that antisymmetry and symmetry are not opposites. It is possible for a relation to possess both properties (such as the empty relation), neither property (such as {(1, 2), (2, 1), (1, 3)} over {1, 2, 3}), or to have either one of the properties but not the other.

Def: A relation R on a set A is called irreflexive if for every a  A (a, a)  R. That is, no element is related to itself. Ex: Let A = {1, 2, 3, 4} and define R = {(a, b) | a divides b}. R not irreflexive because 1 divides 1 for example. Ex: Let A = Z and define R = {(a, b) | a > b}. R is irreflexive because no integer is greater than itself. Note that irreflexivity and reflexivity are not opposites. It is possible for a relation to possess neither property (if some elements of A are related to themselves but others are not). However, it is not possible for a relation to possess both properties (unless the relation is on the empty set). Def: A relation R on a set A is called asymmetric if it is both antisymmetric and irreflexive. That is, the relation can not have both (a, b) and (b, a) even if a = b.

Def: A relation R on a set A is called transitive if whenever (a, b) is in R and (b, c) is in R, then (a, c) is in R. Ex: Let A = Z + and define R = {(a, b) | a divides b}. R is transitive because if a | b and b | c then a | c. [Theorem] Ex: Let A = Z and define R = {(a, b) | a > b}. R is transitive because if a > b and b > c then a > c. Note that transitivity, like symmetry, is possessed by a relation unless the stated condition is violated. So unless you can find pairs (a, b) and (b, c) which are in R while (a, c) is not, then the relation is transitive. In particular, the empty relation is always transitive because it has no pairs to violate the condition. Ex: How many reflexive relations are there on a finite set A? We are forced to include all pairs of the form (a, a). This leaves n(n – 1) pairs which may or may not be in a reflexive relation. So there are 2 n(n – 1) reflexive relations on a set of size n.

Anthology of Relations on a Finite Set Ex: A = . Then A  A = . So there is only one relation on the empty set, namely the empty relation R = . [Properties?] Reflexive Irreflexive Symmetric Antisymmetric Asymmetric Transitive Ex: A = {1}. Then A  A = {(1, 1)}. First, R = . [Properties?] Not Reflexive Irreflexive Symmetric Antisymmetric Asymmetric Transitive Ex: A = {1}. Then A  A = {(1, 1)}. Now, R = {(1, 1)}. [Props?] Reflexive Not Irreflexive Symmetric Antisymmetric Not Asymmetric Transitive

Relation PropertyReflexIrrefSymmAntiAsymTrans {}XXXXX {(1, 1)}XXX {(1, 2)}XXXX {(2, 1)}XXXX {(2, 2)}XXX {(1, 1), (1, 2)}XX {(1, 1), (2, 1)}XX {(1, 1), (2, 2)}XXXX {(1, 2), (2, 1)}XX {(1, 2), (2, 2)}XX {(2, 1), (2, 2)}XX {(1, 1), (1, 2), (2, 1)}X {(1, 1), (1, 2), (2, 2)}XXX {(1, 1), (2, 1), (2, 2)}XXX {(1, 2), (2, 1), (2, 2)}X {(1, 1), (1, 2), (2, 1), (2, 2)}XXX

Combining Relations If we have two relations R and S from A to B then they are both subsets of A  B so they can be combined in the same way that sets can via union, intersection, difference, etc. Ex: Let A and B both be the set of real numbers and consider R = {(x, y) | x y}. Then R  S = {(x, y) | x y} = {(x, y) | x  y} R  S = {(x, y) | x y} =  R – S = R (since R and S are disjoint). We also have another natural way to combine two relations which corresponds to our notion of composition when dealing with functions. It is called composition of relations.

Def: Let R be a relation from A to B and S be a relation from B to C. The composite of R and S is the relation consisting of ordered pairs (a, c), where a  A, c  C, and for which there exists an element b  B such that (a, b)  R and (b, c)  S. The composite of R and S is denoted S  R. [Note the order]. Remark: We gave the general definition above, but we will be most concerned with the situation where A = B = C. That is where we are composing two relations over the same set A. Ex: Let A = {0, 1, 2, 3, 4} and consider the relations R and S over A where R = {(1, 1), (1, 4), (2, 3), (3, 1), (3, 4)} and S = {(1, 0), (2, 0), (3, 1), (3, 2), (4, 1)}. What is S  R? S  R = {(1, 0), (1, 1), (2, 1), (2, 2), (3, 0), (3, 1)}. R  S = {(3, 1), (3, 4), (3, 3), (4, 1), (4, 4)}. Note that clearly R  S  S  R. The composite is not commutative.

Ex: If we have a relation R over a set A, we can compose R with itself using the general definition. So R  R contains all pairs (a, c) where a  A, c  A, and there exists some b  A such that (a, b)  R and (b, c)  R. The composure of R with itself is denoted R 2. Remark: Note that we can only compose a relation with itself if it is a relation over a set. We can’t compose a relation with itself if it is a general relation from A to B with A  B. Ex: Let A = {0, 1, 2, 3, 4} and consider the relations R where R = {(1, 1), (1, 4), (2, 3), (3, 1), (3, 4)}. What is R  R? R  R = {(1, 1), (1, 4), (2, 1), (2, 4), (3, 1), (3, 4)}. Note that we could continue this process indefinitely. That is we might ask what is R  R 2 ? This we denote as R 3. As you can see R is not necessarily a subset of R 2.

Def: Let R be a relation on the set A. The powers R n of R are defined recursively as: R 1 = R R n + 1 = R n  R Ex: Let A = {1, 2, 3, 4} and R = {(1, 1), (2, 1), (3, 2), (4, 3)}. R 2 = R  R = {(1, 1), (2, 1), (3, 1), (4, 2)}. R 3 = R 2  R = {(1, 1), (2, 1), (3, 1), (4, 1)}. R 4 = R 3  R = {(1, 1), (2, 1), (3, 1), (4, 1)}. It turns out that R n = R 3 for all n > 2. The powers of R have a special relationship to the property of transitivity. This is stated as a theorem: Theorem: The relation R on a set A is transitive if and only if R n  R for all n  Z +.

Proof: As an “if and only if” theorem we need to prove the implication in both directions. We first prove: If R n  R for all n  Z + then R is transitive. So assume R n  R for all n  Z +. Then in particular, R 2  R. Now we want to show that R is transitive. So let a, b, c  A such that (a, b)  R and (b, c)  R. We need to show that (a, c)  R. But since (a, b)  R and (b, c)  R then (a, c)  R 2 by the definition of composite. Since R 2  R then (a, c)  R 2 implies that (a, c)  R. So R is transitive. Now we show that if R is transitive then R n  R for all n  Z +. So assume R is transitive. Let P(n) be R n  R. We use M.I. Base: P(1) means R 1  R. That is R  R which is true. Ind: Let k  Z + and assume P(k). That is R k  R. Now we must show R k + 1  R. So let (a, b)  R k + 1. Then there is some x  A such that (a, x)  R and (x, b)  R k. So (x, b)  R since R k  R. But since R is transitive then (a, b)  R. So R k + 1  R. 

We will not cover section 7.2 because it is more appropriate to a class on Databases. One thing that is important in section 7.2 is simply the fact that the concept of a relation can be extended beyond binary relations to represent a relationship on n sets. Def: Let A 1, A 2, …, A n be sets. An n-ary relation on these sets is a subset of A 1  A 2  …  A n. N-ary relations and their properties are used as the basis for what are called Relational Databases. Ex: The school keeps databases relating each student with his/her SSN, major, GPA, etc. Such a database kept in a relational database structure would include n-tuples like (Johnathan Jones, , Anthropology, 2.54, … )