CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.

Slides:



Advertisements
Similar presentations
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Advertisements

CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Prof. Shachar Lovett Clicker frequency: CA CSE 20 Discrete math Prof. Shachar Lovett
CSE115/ENGR160 Discrete Mathematics 04/26/12 Ming-Hsuan Yang UC Merced 1.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Discussion #27 Chapter 5, Sections /15 Discussion #27 Closures & Equivalence Relations.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Basic Properties of Relations
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Review of Mathematical Notation / Terminology
Discrete Structures Chapter 5 Relations Nurul Amelina Nasharuddin Multimedia Department.
Chapter 3 Review MATH130 Heidi Burgiel. Relation A relation R from X to Y is any subset of X x Y The matrix of a Relation R is a matrix that has a 1 in.
Regular Expression (EXTRA)
Equivalence Relations: Selected Exercises
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Reflexive -- First sentence of proof is: (1) Let x  Z (2) Let (x,x)  R. (3) Let (x,x)  I (4) Let x  R.
Relations Chapter 9.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
CS106X – Programming Abstractions in C++ Cynthia Bailey Lee BFS animation slides by Keith Schwarz CS2 in C++ Peer Instruction Materials by Cynthia Bailey.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
INM175 Topic 7 1 Module INM175 Discrete Mathematics Topic 7 Set Theoretic Models.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Discrete Math for CS Binary Relation: A binary relation between sets A and B is a subset of the Cartesian Product A x B. If A = B we say that the relation.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
1 RELATIONS Learning outcomes Students are able to: a. determine the properties of relations – reflexive, symmetric, transitive, and antisymmetric b. determine.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
1 Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004 Chapter 5 Relations and Functions.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Representing Relations Using Matrices A relation between finite sets can be represented using a zero-one matrix Suppose R is a relation from A = {a 1,
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Chapter Relations and Their Properties
1 RELATIONS Learning outcomes Students are able to: a. determine the properties of relations – reflexive, symmetric, transitive, and antisymmetric b. determine.
8.4 Closures of Relations Definition: The closure of a relation R with respect to property P is the relation obtained by adding the minimum number of.
RelationsCSCE 235, Spring Introduction A relation between elements of two sets is a subset of their Cartesian products (set of all ordered pairs.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Relations Compare with function – Function: Set of ordered pairs where x’s don’t repeat x’s come from domain; y’s come from co-domain Purpose: to transform.
Chap. 7 Relations: The Second Time Around
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), (
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Section 9.3. Section Summary Representing Relations using Matrices Representing Relations using Digraphs.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 41 May 7, 2008.
English for Economic Informatics I Tomáš Foltýnek Theoretical Foundations of Informatics.
Relations and Graphs Relations and Graphs Sanjay Jain, Lecturer, School of Computing.
Section 9.1. Section Summary Relations and Functions Properties of Relations Reflexive Relations Symmetric and Antisymmetric Relations Transitive Relations.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Binary Relation: A binary relation between sets A and B is a subset of the Cartesian Product A x B. If A = B we say that the relation is a relation on.
Equivalence Relations: Selected Exercises
Relations Chapter 9.
Representing Relations
CSE 20 – Discrete Mathematics
Relations: Operations & Properties
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Equivalence Relations: Selected Exercises
Chapter 8 (Part 2): Relations
Presentation transcript:

CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License. Based on a work at Permissions beyond the scope of this license may be available at LeeCreative Commons Attribution- NonCommercial-ShareAlike 4.0 International Licensehttp://peerinstruction4cs.org

Today’s Topics: 1. Relations 2. Equivalence relations 2

1. Relations 3

Relations are graphs  Think of relations as graphs  xRy means “there in an edge x  y”  Is A. R ? B. R ? C. Both D. Neither 4

Relations are graphs  What does this relation capture? xRy means A. x>y B. x=y C. x divides y D. x+y E. None/more than one

Types of relations  A relation is symmetric if xRy  yRx.  That is, if the graph is undirected  Which of the following is symmetric A. x<y B. x divides y C. x and y have the same sign D. x  y E. None/more than one 6

Types of relations  A relation is reflexive if xRx is true for all x  That is, the graph has loops in all vertices  Which of the following is reflexive A. x<y B. x divides y C. x and y have the same sign D. x  y E. None/more than one 7

Types of relations  A relation is transitive if xRy  yRz  xRz  This is less intuitive… will show equivalent criteria soon  Which of the following is transitive A. x<y B. x divides y C. x and y have the same sign D. x  y E. None/more than one 8

Types of relations  A relation is transitive if xRy  yRz  xRz  Theorem: Let G be the graph corresponding to a relation R. R is transitive iff whenever you can reach from x to y in G then the edge x  y is in G.  Try to prove yourself first 9

Types of relations  Theorem: R is transitive iff when you can reach from x to y in G then the edge x  y is also in G.  Proof (sufficient): Assume the graph G has this property. We will show R is transitive. Let x,y,z be such that xRy and yRz hold. In the graph G we can reach from x to z via the path x  y  z. So by assumption on G x  z is also an edge in G. Hence xRz so R is transitive. 10

Types of relations  Theorem: R is transitive iff when you can reach from x to y in G then the edge x  y is also in G.  Proof (necessary) by contradiction: Assume by contradiction R is transitive but G doesn’t have this property. So, there are vertices x,y with a path x  v 1  …  v k  y in G but where there is no edge x  y. Choose such a pair x,y with minimal path length k. We divide the proof to cases.  Case 1: k=0. So x  y in G. Contradiction.  Case 2: k=1. Since R is transitive then x  v 1 and v 1  y imply x  y. Contradiction.  Case 3: k>1. Then x  v k must be in G since the path has length k-1 and we assumed the path from x to y is of minimal length. So in fact x  v k  y. Contradiction. QED 11

2. Equivalence relations 12

Equivalence relations 13  Definition: a relation is an equivalence relation if it is  Reflexive  Symmetric  Transitive  What does that actually means???

Equivalence relations  Best to explain by example  In the universe of people, xRy if x,y have the same birthday  Relfexive: xRx  Symmetric: xRy implies yRx  Transitive: if x,y have the same birthday, and y,z have the same birthday, then so do x,z. 14

Equivalence relations  An equivalence relation partitions the universe to equivalence classes  E.g. all people who were born on 1/1/2011 is one equivalence class  Reflexive: a person has the same birthday as himself… dahhh….  Symmetric: if x,y have the same birthday then so do y,x  Transitive: if x,y have the same birthday, and y,z have the same birthday, then so do x,z 15

Equivalence relations  As a graph 16

Equivalence relations  As a graph 17 Equivalence classes

Equivalence relations  Which of the following is an equivalence relation in the universe of integer numbers A. x divides y B. x*y>0 C. x+y>0 D. x+y is even E. None/more than one/other 18

Equivalence relations  Which of the following is an equivalence relation in the universe of graphs A. x,y have the same number of vertices B. x,y have the same edges C. x,y are both Eulerian D. x,y are the same up to re-labeling the vertices (isomorhpic) E. None/more than one/other 19

Equivalence relations as functions  We can see an equivalence relation as a function UniverseProperty E.g. People birthday Integerssign Graphs#vertices  An equivalence class is the set of elements mapped to the same value 20