INM175 Topic 7 1 Module INM175 Discrete Mathematics Topic 7 Set Theoretic Models.

Slides:



Advertisements
Similar presentations
Functions Reading: Epp Chp 7.1, 7.2, 7.4
Advertisements

Chapter 2 Revision of Mathematical Notations and Techniques
CSC401 – Analysis of Algorithms Lecture Notes 14 Graph Biconnectivity
Chapter 3 Relations. Section 3.1 Relations and Digraphs.
The Engineering Design of Systems: Models and Methods
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
CS 310 – Fall 2006 Pacific University Theoretical Computer Science CS 310 Chadd Williams Office Mon 3:00 – 4:00 PM 202 Strain.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank and Modified By Mingwu Chen Relations.
CS 310 – Fall 2006 Pacific University Theoretical Computer Science CS 310 Chadd Williams Office Mon 10:30-11:30 am 202 Strain.
Relations binary relations xRy on sets x  X y  Y R  X  Y Example: “less than” relation from A={0,1,2} to B={1,2,3} use traditional notation 0 < 1,
Theory and Applications
Discussion #26 Chapter 5, Sections /15 Discussion #26 Binary Relations: Operations & Properties.
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE The trees.
Applied Discrete Mathematics Week 10: Equivalence Relations
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Logics for Data and Knowledge Representation Introduction to Algebra Chiara Ghidini, Luciano Serafini, Fausto Giunchiglia and Vincenzo Maltese.
Relations: Operations & Properties. Power Sets Set of all subsets of a set A. –A = {1,2} –P(A) = 2 A = { {}, {1}, {2}, {1,2} } We note that each element.
Foundations of Discrete Mathematics Chapter 3 By Dr. Dalia M. Gil, Ph.D.
Chapter 4 Relations and Digraphs
INTRODUCTION TO THE THEORY OF COMPUTATION INTRODUCTION MICHAEL SIPSER, SECOND EDITION 1.
Mathematical Preliminaries Strings and Languages Preliminaries 1.
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.
CSCI 115 Chapter 7 Trees. CSCI 115 §7.1 Trees §7.1 – Trees TREE –Let T be a relation on a set A. T is a tree if there exists a vertex v 0 in A s.t. there.
R. Johnsonbaugh, Discrete Mathematics 5 th edition, 2001 Chapter 2 The Language of Mathematics.
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
1 Annoucement n Skills you need: (1) (In Thinking) You think and move by Logic Definitions Mathematical properties (Basic algebra etc.) (2) (In Exploration)
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
Mathematical Induction
Language: Set of Strings
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Relations.
Discrete Mathematics Relation.
MATH 224 – Discrete Mathematics
CHAPTER 3 FUZZY RELATION and COMPOSITION. 3.1 Crisp relation Product set Definition (Product set) Let A and B be two non-empty sets, the product.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
COSC 2007 Data Structures II Chapter 14 Graphs I.
Mathematical Preliminaries
Relations. Important Definitions We covered all of these definitions on the board on Monday, November 7 th. Definition 1 Definition 2 Definition 3 Definition.
THEORY OF COMPUTATION Komate AMPHAWAN 1. 2.
Basic Structures: Sets, Functions, Sequences, and Sums.
1 Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004 Chapter 5 Relations and Functions.
4. Relations and Digraphs Binary Relation Geometric and Algebraic Representation Method Properties Equivalence Relations Operations.
Unit II Discrete Structures Relations and Functions SE (Comp.Engg.)
2007 D iscrete The foundations C ounting theory N umber theory G raphs & trees structure s
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Relations.
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
Relations and Functions ORDERED PAIRS AND CARTESIAN PRODUCT An ordered pair consists of two elements, say a and b, in which one of them, say a is designated.
Introduction to Graph Theory By: Arun Kumar (Asst. Professor) (Asst. Professor)
Theory of Computing Topics Formal languages automata computability and related matters Purposes To know the foundations and principles of computer science.
Theory of Computing Topics Formal languages automata computability and related matters Purposes To know the foundations and principles of computer science.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 41 May 7, 2008.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
“It is impossible to define every concept.” For example a “set” can not be defined. But Here are a list of things we shall simply assume about sets. A.
English for Economic Informatics I Tomáš Foltýnek Theoretical Foundations of Informatics.
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.
Review: Discrete Mathematics and Its Applications
Introduction to the Theory of Computation
Formal Modeling Concepts
Cartesian product Given two sets A, B we define their Cartesian product is the set of all the pairs whose first element is in A and second in B. Note that.
MATH 224 – Discrete Mathematics
CSNB 143 Discrete Mathematical Structures
CS201: Data Structures and Discrete Mathematics I
Computing Fundamentals 1 Lecture 7 Relations
Review: Discrete Mathematics and Its Applications
Mathematical Background 1
Mathematical Background 1
Introduction to Relations and Functions
Biconnectivity SEA PVD ORD FCO SNA MIA 5/23/ :21 PM
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Presentation transcript:

INM175 Topic 7 1 Module INM175 Discrete Mathematics Topic 7 Set Theoretic Models

INM175 Topic 7 2 Some Useful Constructions in Set Theory (for the modeler) Relational Join_ & _ : ( (X  Y)  (X  Z)  (X  (Y  Z) ) (or direct product) x (R & S) (y, z)  xRy  xSz Corresponding Function (of a relation) cf: (X  Y)  (X  Y) y  cf(R)(x)  xRy The first line in each definition gives the signature of the operator being defined. This includes the number and signatures of its parameters and whether it is to be written infix, prefix or postfix The second line gives its semantics. This consists of the application of the operator to variables universally quantified over its domain and a predicate defining the criteria for membership in the result, subjected to a case analysis if necessary.

INM175 Topic 7 3 Modelling LIST in Set Theory Sequence (or list) Seq X : N +  X  s: Seq X dom(s) = [1..#s] Catenation (of lists) _ ^ _ : ((Seq X)  (Seq X))  (Seq X) i  #s  (s^t) i = s i i > #s  (s^t) i = t ( i - #s ) Extract (from list) extract: N +  (Seq X )  (Seq X ) i>j  (extract i s) j = s j i  j  (extract i s) j = s (succ j) The signature in the last definition is said to be Curried (after the logician Haskell B. Curry). Instead of taking two arguments and delivering a result, extract takes one argument and delivers a function that takes the next argument before delivering the final result.

INM175 Topic 7 4 Directed Graphs A simple directed graph is just a homogeneous relation. By separately identifying the edges and vertices, we can generalise our model of directed graph (or DG) to the 4-tuple (sequence of four sets), DG = whereV is the set of edges; E is the set of vertices; andin, out: E  V map each edge to the vertices that it goes to and comes from, respectively. (Note that this is the just structure that we used in our ‘airline timetable’ example earlier.)

INM175 Topic 7 5 Reachability Now we can derive from the tuple the relation next, that maps each vertex to those that are ‘one step ahead’, thus next: V  V next = in ° out -1 and we can use transitive closure to derive the relation reachable, which maps each vertex to those that can be ‘reached’ from it, along some ‘path’ of contiguous edges, thus: reachable : V  V reachable = next +

INM175 Topic 7 6 Directed Acyclic Graphs Cycles in graphs are paths that lead from a vertex to itself. A directed acyclic graph (or DAG) is a DG in which, from every vertex, no path returns to that vertex. Clearly, a DG is acyclic iff no vertex is reachable from itself, that is, its reachability relation and the identity relation on its vertices are disjoint reachable  Id(V) = . The roots of a DAG are those vertices that no edges enter roots:  V roots = dom(next) - ran(next) The leaves of a DAG are those that no edges leave leaves:  V leaves = ran(next) - dom(next)

INM175 Topic 7 7 Forests and Trees We can also read a DAG backwards, by deriving from its 4-tuple the relation that maps each vertex to its predecessors, thus: pred : V  V pred = out ° in -1 = next -1 A DAG is a forest when no vertex has more than one predecessor, i.e. pred: V  V ‘Family trees’ are forests, because the family has more that one ‘ancestor’! A forest with a single root is called a tree. A DAG is a tree when #roots = 1 The directory structure in your computer is a tree, at the root of which is the name of a ‘volume’ (such as ‘C:\’ in Windows, or ‘\’ in Unix).

INM175 Topic 7 8 Adjacency and Connectivity The adjacency relation maps each vertex to those that are ‘one step away’ in either direction. It is the union of next and pred adj: V  V adj = next  pred (think of this as the original graph with the arrowheads removed) The transitive closure of adjaceny gives the relation that maps each vertex to those that are connected to it by paths of any length in either direction connected: V  V connected = adj +

INM175 Topic 7 9 Connected Graphs connected is an equivalence relation. (You should check that assertion for yourself!) So the quotient of the set of vertices by connected will partition the set of vertices into equivalence classes, all the vertices in each of which are connected to each other but not to any vertex in any other set. This quotient tells us whether the original graph had any ‘islands’: that is, zones which were entirely disconnected from the rest. A connected graph has no islands, so satisfies the predicate V/connected = {V}

INM175 Topic 7 10 Subtyping and Inheritance The definition of directed graph has been extended by adding constraints. Trees are restricted forests, which are restricted directed acyclic graphs, which are restricted directed graphs. If we call the class of all trees TREE, etc., we have TREE  FOREST  DAG  DG and similarly for connected and undirected graphs. These are examples of subtyping, or inheritance, which you will meet much more of in object-oriented design.

INM175 Topic 7 11 Quick Revision of Set Theory the empty set{} or  Definition by extension eg A = {1, 2, 3}, B = {5, 12, 13, 3, 2} membership  eg 2  A, 2  B, 5  B non-membership  but 5  A Definition by comprehension{x  X | P(x)} where P is some property that each member of the set X may or may not possess. eg S = {b  B | even(b)} = {2, 12} cardinality  the number of elements in a set eg  = 0,  A = 3,  B = 5 subset  X  Y if and only if every member of X is a member of Y, or formally:  x((x  X)  (x  Y)) proper subset  X  Y  (X  Y)  (X  Y)

INM175 Topic 7 12 Some Set Operators  x union  x  (X  Y)  (x  X)  (x  Y) eg A  B = {1,2,3,5,12,13} intersection  x  (X  Y)  (x  X)  (x  Y) eg A  B = {2,3} difference-x  (X-Y)  (x  X)  (x  Y) eg A-B = {1} and B-A = {5, 12, 13} complement the difference between a set and the current Universe of Discourse eg S = B-S = {5, 13, 3} powerset  X = {s | s  X} eg  X = { ,{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}}

INM175 Topic 7 13 Products and Relations Cartesian product  (x,y)  (X  Y)  (x  X)  (y  Y) Relation  (X  Y) =  (X  Y ) X  Y denotes the set of all relations from X to Y i.e. any relation R of signature X  Y is a subset of X  Y. If a pair (x,y)  R, we may write xRy. Given any relation R: X  Y domaindomdom R = {x  X |  y:Y xRy} range ran cod(R) = {y  Y |  x:X xRy } inverse -1 (y,x)  R -1  (x,y)  R

INM175 Topic 7 14 More Relational Operators Given any X’  X image[ _ ]y  R[X’]   x  X’ xRy Given any relation S: Y  Z composition  (x,z)  S  R   y:Y xRy  ySz Given any Z  X domain restriction  R  Z = R  (Z  Y)

INM175 Topic 7 15 Properties of Relations Given a set X and a relation R: X  X, R is Reflexive if  x:X xRx Irreflexive if  x:X¬ xRx i.e. R  (Id X) =  Symmetric if  x,y:X xRy  yRx Antisymmetric if  x,y:X xRy  yRx  x=y Transitive if  x,y,z:X xRy  yRz  xRz Some Special Relations and their properties Equivalence relations arereflexive, symmetric and transitive. Partial Orders are reflexive, transitive and antisymmetric. Strict Orders are irreflexive, transitive and antisymmetric.

INM175 Topic 7 16 Functions A relation F: X  Y is a function if  x:X  y,z:Y xFy  xFz  y = z We indicate that such a relation is a function by writing F: X  Y If dom F =  X, the function F is total and we write F : X  Y Some Properties of Functions Surjective ( onto ) F [dom X] = Y Injective ( one-to-one ) F -1  Y  X Bijective ( one-to-one and onto ) surjective and injective F XY