Title: Mathematics for Computer Science
1Mathematics for Computer Science
- Lecture 6 Relations
- Leon van der Torre
2Slides
- Slides can be found on the internet
- These slides are based on MIT open courseware,
by A. Meyer
BECS - Bachelor of Engineering in Computer
Science
3Binary relation R from A to B
codomain
domain
graph(R)
4Example
Classes
Students
6.042 6.003 6.012
is taking
5Example
Arithmetic Expressions
values
12 Sqrt(9) 50/10 - 3
3 5 2
evaluates to
6Example
Cities
Cities
Boston Providence New York
Boston Providence New York
direct bus connection
7Example
direct bus connection
Cities
Boston Providence New York
8Relation Abstraction
(Binary) Relation domain set A codomain
set B graph subset of A ? B
9 Asymmetry
Binary relation, R, on set A, is asymmetric iff
aRb implies ?(bRa) for all a,b ? A
10 Transitivity
Binary relation, R, on set A, is transitive
aRb and bRc implies aRc for all a,b,c ? A.
11Strict Partial Orders
- Binary relation, R, on set A,
- is a strict partial order iff
- it is transitive and
- asymmetric
12Irreflexivity
- If R is a strict partial order, then
- ?(aRa)
- for all a? A
13Weak Partial Orders
same as strict except aRa for all a ?
A (reflexivity)
14Ordering Relations
- on the Integers
- lt on the Reals
- ? on Sets (subset)
- ? on Sets (proper subset)
15Partial Orders
- y ltlt x (much less than)
- (say, y 2 ? x)
- ? 3 ltlt 4
? 4 ltlt 3
16Representing Partial Orders
- The subset relation, ?
- on sets is the canonical
- example of weak partial order
17(Proper) Subset Relation
1
18Partial Order divides
- a divides b (a b) iff
- ka b for some k??
19Partial Order divides
210
2
12
1
20Subset Relation
1
21 Divides Subset
22Subset Relation
15?1,3,5,15
3 ?1,3
1 ?1
23Properties of ?
A ? B and B ? C implies A ? C Transitive
A ? B implies ?(B ? A) for A ? B Antisymmetric
24 A/Antisymmetry
- minor difference
- whether aRa is allowed
25Total Order on A
- Partial Order, R, such that
aRb or bRa for all a?b ?A
26Strict Total Order
- a lt b or b lt a
- (for numbers a ? b)
27Weak Total Order
- a ? b or b ? a
- (for all a, b)
28Homework
- Outils mathématiques pour l'informaticien
- Section 3.1,3.4,3.6
- Section 5.1