CSE 311 Foundations of Computing I Lecture 20 Relations, Graphs, Finite State Machines Autumn 2011 CSE 3111 TexPoint fonts used in EMF. Read the TexPoint.

Slides:



Advertisements
Similar presentations
Representing Relations
Advertisements

CSE 311 Foundations of Computing I
CSE115/ENGR160 Discrete Mathematics 04/26/12 Ming-Hsuan Yang UC Merced 1.
8.3 Representing Relations Connection Matrices Let R be a relation from A = {a 1, a 2,..., a m } to B = {b 1, b 2,..., b n }. Definition: A n m  n connection.
CSE 311: Foundations of Computing Fall 2013 Lecture 23: Finite state machines and minimization.
Representing Relations Using Matrices
8.4 Closures of Relations. Intro Consider the following example (telephone line, bus route,…) abc d Is R, defined above on the set A={a, b, c, d}, transitive?
CS2210(22C:19) Discrete Structures Relations Spring 2015 Sukumar Ghosh.
CSE 311 Foundations of Computing I Lecture 19 Relations Autumn 2011 CSE 3111.
CSE 311: Foundations of Computing Fall 2014 Lecture 23: State Minimization, NFAs.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
Applied Discrete Mathematics Week 10: Equivalence Relations
Chapter 4 Relations and Digraphs
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Lecture 14 Relations CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
CSE 311 Foundations of Computing I Lecture 23 Finite State Machines Autumn 2012 CSE 3111.
CSE 311 Foundations of Computing I Lecture 21 Finite State Machines Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 21 Finite State Machines Spring
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.
8.3 Representing Relations Directed Graphs –Vertex –Arc (directed edge) –Initial vertex –Terminal vertex.
1 Closures of Relations: Transitive Closure and Partitions Sections 8.4 and 8.5.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 8 Relations 歐亞書局.
Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Relations.
CSE 311: Foundations of Computing Fall 2014 Lecture 20: Relations and Directed Graphs.
Relations and their Properties
Mathematical Preliminaries
CSE 311 Foundations of Computing I Lecture 22 Relations, Database Autumn 2012 CSE TexPoint fonts used in EMF. Read the TexPoint manual before you.
CSE 311 Foundations of Computing I Lecture 27 FSM Limits, Pattern Matching Autumn 2012 CSE
CSE 311 Foundations of Computing I Lecture 24 Finite State Machines Autumn 2012 CSE 3111.
Relations. Important Definitions We covered all of these definitions on the board on Monday, November 7 th. Definition 1 Definition 2 Definition 3 Definition.
CSCI 115 Chapter 8 Topics in Graph Theory. CSCI 115 §8.1 Graphs.
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
Discrete Structures – CNS2300
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.
4. Relations and Digraphs Binary Relation Geometric and Algebraic Representation Method Properties Equivalence Relations Operations.
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,
Chapter Relations and Their Properties
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.
CSE 311 Foundations of Computing I Lecture 24 FSM Limits, Pattern Matching Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 19 Recursive Definitions: Context-Free Grammars and Languages Spring
Section 9.3. Section Summary Representing Relations using Matrices Representing Relations using Digraphs.
Lecture 7: Relations Dr Andrew Purkiss-Trew Cancer Research UK Mathematics for Computing.
Representing Relations Using Digraphs
Aaron Bloomfield CS 202 Rosen, section 7.4
Introduction to the Theory of Computation
CSE 373, Copyright S. Tanimoto, 2001 Graphs 1 -
CSE 311 Foundations of Computing I
Mathematical Notions and Terminology
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -
Summary 3 Discrete Probability (sections )
Relations: representation and closures
Closures of Relations: Transitive Closure and Partitions
CSE 321 Discrete Structures
CSE 321 Discrete Structures
CSE 311: Foundations of Computing
CSE 321 Discrete Structures
Mathematical Background
CSE 311 Foundations of Computing I
Graphs G = (V, E) V are the vertices; E are the edges.
CSE 321 Discrete Structures
Closures of Relations Epp, section 10.1,10.2 CS 202.
Minimum Spanning Trees
Chapter 8 (Part 2): Relations
Representing Relations Using Matrices
Presentation transcript:

CSE 311 Foundations of Computing I Lecture 20 Relations, Graphs, Finite State Machines Autumn 2011 CSE 3111 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A AA

Announcements Reading assignments – 7 th Edition, Sections 9.3 and 13.3 – 6 th Edition, Section 8.3 and 12.3 – 5 th Edition, Section 7.3 and 11.3 Autumn 2011CSE 3112

Lecture highlights Autumn 2011CSE 3113 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} R 1 = R; R n+1 = R n  R

n-ary relations 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.

Relational databases Student_NameID_NumberMajorGPA Knuth CS4.00 Von Neuman CS3.78 Von Neuman Mathematics3.78 Russell Philosophy3.85 Einstein Physics2.11 Newton Mathematics3.61 Karp CS3.98 Newton Physics3.61 Bernoulli Mathematics3.21 Bernoulli Mathematics3.54

Alternate Approach Student_IDNameGPA Knuth Von Neuman Russell Einstein Newton Karp Bernoulli Bernoulli3.54 Student_IDMajor CS CS Mathematics Philosophy Physics Mathematics CS Physics Mathematics Mathematics

Database Operations Projection Join Select

Matrix representation Relation R on A={a 1, … a p } {(1, 1), (1, 2), (1, 4), (2,1), (2,3), (3,2), (3, 3) (4,2) (4,3)}

Directed graphs Autumn 2011CSE 3119 Path: v 1, v 2, …, v k, with (v i, v i+1 ) in E Simple Path Cycle Simple Cycle G = (V, E) V – vertices E – edges, order pairs of vertices

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

Paths in relations Autumn 2011CSE 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)  R n

Connectivity relation Autumn 2011CSE 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.

Properties of Relations Let R be a relation on A R is reflexive iff (a,a)  R for every a  A R is symmetric iff (a,b)  R implies (b, a)  R R is transitive iff (a,b)  R and (b, c)  R implies (a, c)  R /

Transitive-Reflexive Closure Autumn 2011CSE 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*

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 Autumn 2011 CSE s0s0 s2s2 s3s3 s1s , State01 s0s0 s0s0 s1s1 s1s1 s0s0 s2s2 s2s2 s0s0 s3s3 s3s3 s3s3 s3s3

What language does this machine recognize? Autumn 2011CSE s0s0 s2s2 s3s3 s1s