1 / 16

CSE 311 Foundations of Computing I

CSE 311 Foundations of Computing I. Lecture 20 Relations, Graphs, Finite State Machines Autumn 2011. TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A. Announcements. Reading assignments 7 th Edition, Sections 9.3 and 13.3

gandhi
Download Presentation

CSE 311 Foundations of Computing I

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. CSE 311 Foundations of Computing I Lecture 20 Relations, Graphs, Finite State Machines Autumn 2011 CSE 311 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAA

  2. Announcements • Reading assignments • 7thEdition, Sections 9.3 and 13.3 • 6th Edition, Section 8.3 and 12.3 • 5th Edition, Section 7.3 and 11.3 CSE 311

  3. Lecture highlights Let A and B be sets, A binary relation from A to B is a subset of A  B S  R = {(a, c) |  b such that (a,b) R and (b,c) S} R1 = R; Rn+1 = Rn R CSE 311

  4. n-ary relations Let A1, A2, …, An be sets. An n-ary relation on these sets is a subset of A1A2 . . . An.

  5. Relational databases

  6. Alternate Approach

  7. Database Operations Projection Join Select

  8. Matrix representation Relation R on A={a1, … ap} {(1, 1), (1, 2), (1, 4), (2,1), (2,3), (3,2), (3, 3) (4,2) (4,3)}

  9. Directed graphs • G = (V, E) • V – vertices • E – edges, order pairs of vertices • Path: v1, v2, …, vk, with (vi, vi+1) in E • Simple Path • Cycle • Simple Cycle CSE 311

  10. Representation of relations Directed Graph Representation (Digraph) {(a, b), (a, a), (b, a), (c, a), (c, d), (c, e) (d, e) } b c a d e

  11. Paths in relations Let R be a relation on a set A. There is a path of length n from a to b if and only if (a,b) Rn CSE 311

  12. Connectivity relation Let R be a relation on a set A. The connectivity relation R* consists of the pairs (a,b) such that there is a path from a to b in R. CSE 311

  13. Properties of Relations Let R be a relation on A R is reflexiveiff (a,a)  R for every a  A R is symmetriciff (a,b)  R implies (b, a) R R is transitiveiff (a,b) R and (b, c) R implies (a, c)  R /

  14. Transitive-Reflexive Closure Add the minimum possible number of edges to make the relation transitive and reflexive The transitive-reflexive closure of a relation R is the connectivity relation R* CSE 311

  15. Finite state machines States Transitions on inputs Start state and finals states The language recognized by a machine is the set of strings that reach a final state 1 0 0 1 1 1 s0 s1 s2 s3 0 0,1 CSE 311

  16. What language does this machine recognize? 1 s0 s1 1 0 0 0 0 1 s2 s3 1 CSE 311

More Related