DOC PREVIEW
UNL CSCE 235 - Relations

This preview shows page 1-2-3-4-28-29-30-31-57-58-59-60 out of 60 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 60 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

RelationsOutlineIntroductionRelations: RepresentationRelations on a SetPropertiesProperties: ReflexivityReflexivity: ExamplesProperties: SymmetrySymmetry versus AntisymmetrySymmetric Relations: ExampleProperties: TransitivityTransitivity: Examples (1)Transitivity: Examples (2)More PropertiesSlide 16Combining RelationsCombining Relations: ExampleComposite of RelationsPowers of RelationsPowers of Relations: ExamplePowers of Relations & TransitivitySlide 23Representing Relations0-1 Matrices (1)0-1 Matrix (2)0-1 Matrix (3)0-1 Matrix (4)Matrix Representation: ExampleUsing the Matrix Representation (1)Using the Matrix Representation (2)Slide 32Matrix Representation: Combining RelationsSlide 34Composing Relations: ExampleComposite Relations: RnDirected Graphs Representation (1)Definition: Directed Graphs (2)Directed Graphs Representation (2)Using the Digraphs Representation (1)Using the Digraphs Representation (2)Slide 42Closures: DefinitionsReflexive ClosureSymmetric ClosureTransitive ClosureWarshall’s Algorithm: Key IdeasWarshall’s AlgorithmWarshall’s Algorithm: ExampleSlide 50Equivalence RelationEquivalence Class (1)Equivalence Class (2)Partitions Partitions (1)Partitions (2)Partitions: Visual InterpretationEquivalence Relations: Example 1Equivalence Relations: Example 2Equivalence Relations: Example 3Equivalence Relations: Example 4RelationsSection 8.1, 8.3—8.5 of RosenFall 2008CSCE 235 Introduction to Discrete StructuresCourse web-page: cse.unl.edu/~cse235Questions: [email protected] 235, Fall 20082Outline•Relation: –Definition, representation, relation on a set•Properties–Reflexivity, symmetry, antisymmetric, irreflexive, asymmetric•Combining relations–, , \, composite of relations•Representing relations–0-1 matrices, directed graphs•Closure of relations–Reflexive closure, diagonal relation, Warshall’s Algorithm,•Equivalence relations:–Equivalence class, partitions,RelationsCSCE 235, Fall 20083Introduction•A relation between elements of two sets is a subset of their Cartesian products (set of all ordered pairs•Definition: A binary relation from a set A to a set B is a subset R  AB ={ (a,b) | aA, bB}•Relation versus function– In a relation, each aA can map to multiple elements in B–Relations are more general than functions•When (a,b)R, we say that a is related to b.•Notation: aRb, aRb $aRb$, $a\notR b$RelationsCSCE 235, Fall 20084Relations: Representation•To represent a relation, we can enumerate every element of R•Example–Let A={a1,a2,a3,a4,a5} and B={b1,b2,b3}–Let R be a relation from A to B defined as followsR={(a1,b1),(a1,b2),(a1,b3),(a3,b1),(a3,b2),(a3,b3),(a5,b1)}•We can represent this relation graphicallya1a2a3a4b1b2b3A Ba5RelationsCSCE 235, Fall 20085Relations on a Set•Definition: A relation on the set A is a relation from A to A and is a subset of AA•Example: The following are binary relations on NR1={ (a,b) | a  b }R2={ (a,b) | a,bN, a/bZ }R3={ (a,b) | a,bN, a-b=2 }•Question: Give some examples of ordered pairs (a,b) N2 that are not in each of these relationsRelationsCSCE 235, Fall 20086Properties•We will study several properties of relations–Reflexive–Symmetric–Transitive –Antisymmetric–AsymmetricRelationsCSCE 235, Fall 20087Properties: Reflexivity•In a relation on a set, if all ordered pairs (a,a) for every aA appears in the relation, R is called reflexive•Definition: A relation R on a set A is called reflexive ifaA (a,a)RRelationsCSCE 235, Fall 20088Reflexivity: Examples•Recall the relations below, which is reflexive?R1={ (a,b) | a  b }R2={ (a,b) | a,bN, a/bZ }R3={ (a,b) | a,bN, a-b=2 }•R1 is reflexive since for every aN, a  a •R2 is reflexive since a/a=1 is an integer •R3 is not reflexive since a-a=0 for every aNRelationsCSCE 235, Fall 20089Properties: Symmetry•Definitions: –A relation R on a set A is called symmetric ifa,bA ( (b,a)R  (a,b)R )–A relation R on a set A is called antisymmetric ifa,bA [(a,b)R  (b,a)R  a=b]RelationsCSCE 235, Fall 200810Symmetry versus Antisymmetry•In a symmetric relation aRb  bRa•In an antisymmetric relation, if we have aRb and bRa hold only when a=b•An antisymmetric relation is not necessarily a reflexive relation•A relation can be –both symmetric and antisymmetric –or neither –or have one property but not the other•A relation that is not symmetric is not necessarily asymmetricRelationsCSCE 235, Fall 200811Symmetric Relations: Example•Consider R={(x,y)R2|x2+y2=1}, is R–Reflexive?–Symmetric?–Antisymmetric?•R is not reflexive since for example (2,2)R2•R is symmetric because x,yR, xRyx2+y2=1  y2+x2=1  yRx•R is not antisymmetric because (1/3,8/3)R and (8/3,1/3)R but 1/38/3RelationsCSCE 235, Fall 200812Properties: Transitivity•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a,b,cA ((aRb)(bRc))  aRcRelationsCSCE 235, Fall 200813Transitivity: Examples (1)•Is the relation R={(x,y)R2| xy} transitive?•Is the relation R={(a,b),(b,a),(a,a)} transitive?Yes, it is transitive because xRy and yRz  xy and yz  xz  xRz No, it is not transitive because bRa and aRb but bRbRelationsCSCE 235, Fall 200814Transitivity: Examples (2)•Is the relation {(a,b) | a is an ancestor of b} transitive?•Is the relation {(x,y)R2| x2y} transitive?Yes, it is transitive because aRb and bRc  a is an ancestor of b and b is an ancestor of c  a is an ancestor of c  aRc No, it is not transitive because 2R4 and 4R10 but 2R10RelationsCSCE 235, Fall 200815More Properties•Definitions–A relation on a set A is irreflexive ifaA (a,a)R–A relation on a set A is asymmetric ifa,bA ( (a,b)R  (b,a)  R )•Lemma: A relation R on a set A is asymmetric if and only if–R is irreflexive and–R is antisymmetricRelationsCSCE 235, Fall 200816Outline•Relation: –Definition, representation, relation on a set•Properties–Reflexivity, symmetry, antisymmetric, irreflexive, asymmetric•Combining relations–, , \, composite of relations•Representing relations–0-1 matrices, directed graphs•Closure of relations–Reflexive closure, diagonal relation, Warshall’s Algorithm,•Equivalence relations:–Equivalence class,


View Full Document

UNL CSCE 235 - Relations

Documents in this Course
Logic

Logic

77 pages

Proofs

Proofs

82 pages

Induction

Induction

85 pages

Proofs

Proofs

52 pages

Sets

Sets

8 pages

Recursion

Recursion

16 pages

Proofs

Proofs

82 pages

Functions

Functions

71 pages

Recursion

Recursion

50 pages

Functions

Functions

54 pages

Graphs

Graphs

56 pages

Induction

Induction

32 pages

Relations

Relations

60 pages

Graphs

Graphs

10 pages

Recursion

Recursion

80 pages

Recursion

Recursion

81 pages

Functions

Functions

16 pages

Recursion

Recursion

16 pages

Sets

Sets

52 pages

Load more
Download Relations
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Relations and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Relations 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?