1 / 17

Discrete Structure

Discrete Structure. Li Tak Sing( 李德成 ). Equivalence relations. Any binary relation that is reflexive, symmetric, and transitive is called an equivalence relation. Sample equivalence relations. R is over N, xRy means x+y is even R is over real number, xRy means sin(x)=sin(y). Examples.

helene
Download Presentation

Discrete Structure

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Discrete Structure Li Tak Sing(李德成)

  2. Equivalence relations • Any binary relation that is reflexive, symmetric, and transitive is called an equivalence relation.

  3. Sample equivalence relations • R is over N, xRy means x+y is even • R is over real number, xRy means sin(x)=sin(y)

  4. Examples • Let R be defined on N by xRy iff |x-y| is odd. Show that R is not an equivalance relation on N. • Given the relation over the integers defined by a~b iff |a|=|b|, either prove that ~ is an equivalence relation or prove that ~ not an equivalence relation.

  5. Intersection property of equivalence • If E and F are equivalence relations on the set A, then EF is an equivalence relation on A.

  6. Kernel relations • If f is a function with domain A, then the relation ~ defined by x~y iff f(x)=f(y)is an equivalence relation on A, and it is called the kernel relation of f.

  7. Equivalence classes • Let R be an equivalence relation on a set S. If aS, then the equivalence class of a, denoted by [a], is the subset of S consisting of all elements that are equivalent to a. In other words, we have [a]={x S | xRa}

  8. Example of equivalence class • a~b iff a+b is even • a~b iff sin(a)=sin(b) • a~b iff a and b are studying the same course

  9. Property of equivalences • Let S be a set with an equivalence relation R. If a, b S, then either [a]=[b] or [a][b]=. • Proof. If [a][b], and [a][b]  , there is an element c so that c[a] and c[b]. So we have aRc and cRb, therefore aRb. Now, for any x [a] , xRa. Since aRb, therefore we have xRb which implies that x [b]. Therefore, [a][b]. Similarly, we have [b][a].

  10. Partitions • By a partition of a set we mean a collection of nonempty subsets that are disjoint from each other and whose union is the whole set. • If R is an equivalence relation on the set S, then the equivalence classes form a partition of S. Conversely, if P is a partition of a set S, then there is an equivalence relation on S whose equivalence classes are sets of P.

  11. Refinement of a partition • Suppose that P and Q are two partitions of a set S. If each set of P is a subset of a set in Q, then P is a refinement of Q. The finest of all partitions on S is the collection of singleton sets. The coarsest of all partitions of S is the set S itself.

  12. Example • aRb iff ab (mod 2) • aSb iff ab (mod 4)

  13. Example • Given the following set of words. {rot, tot, root, toot, roto, toto, too, to otto}. • Let f be the funtion that maps word to its set of letters. For kernel relation of f, describe the equivalence classes. • Let f be the function that maps a word to its bag of letters. For the kernel relation of f, describe the equivalence classes.

  14. Kruskai's algorithm for minimal spanning trees • In the spanning tree problems, we can define a relation R so that aRb if there is a path between a and b. The algorithm is:

  15. Kruskal's Algorithm • Sort the edges of the graph by weight, and let L be the sorted list. • Let T be the minimal spanning tree and initialize T:=. • For each vertex v of the graph, create the equivalence class [v]={v} • while there are 2 or more equivalence classes do Let {a,b} be the edge at the head of L; L:=tail(L); if [a][b] then T:=T{{a,b}}; Replace the equivalence classes [a] and [b] by [a] [b] fi • od

  16. Spanning trees

  17. Spanning trees

More Related