CS/EE 5740/6740:Computer Aided Design of Digital Circuits
Chris J. Myers
Lecture 3: Sets, Relations, andFunctions
Reading: Chapter 3.1
∅
Set Notation
| |V Cardinality (number of members) of set V
v V∈ Element is a member of set v V
v V∉ Element is not a member of set v V
S V⊆ Set is a subset of set S V
The empty set (a member of all sets)
′S The complement of set S
VS
U
U The universe: ′ = −S U S
Power Sets
2V The power set of set (the set of allsubsets of set
VV
| | | |2 2V V= The cardinality of a power set is apower of 2
2V S S V= ⊆{ | }
Power Sets
V = { , , }012
2
0 1 2
01 0 2 12
012
V = ∅{
}
,
{ } ,{ } ,{ } ,
{ , } ,{ , } ,{ , } ,
{ , , }
3-member set
1 subset with 0 members
3 subsets with 1 members
3 subsets with 2 members
1 subset with 3 members
| | | |2 2 2 83�
V V= = =
Power sets are Boolean Algebras
Cartesian Products
• The Cartesian Product of sets and isdenoted
• Suppose , then
A B×BA
A B a b= ={ , , } , { , }012
A B a b a b a b× = { ( , ),( , ),( , ),( , ),( , ),( , )}0 0 1 1 2 2
A = { , , }012 Set is unordered( ) denotes Ordered Set
A( , )1 b
Binary Relations
• The Cartesian Product of sets and isdenoted
• consists of all possible orderedpairs such that and
• A subset is called a BinaryRelation
• Graphs, Matrices, and Boolean Algebrascan be viewed as binary relations
A B×BA
A B×( , )a b a A∈ b B∈
R A B⊆ ×
Binary Relations as Graphs or Matrices
1 0�
0�
1 1 1
Rectangular Matrix
A a c= { , } B b d f= { , , }
E ab cb cd cf A B= ⊆ ×{ , , , }
a b
c d
fa
b
c
d f
Bipartite Graph
1 1 1 1
0 1 0 1
0 0 1 1
0 0 0 1
Square Matrix
a
cb
d
V a b c d= { , , , }
E ab ac ad bd cd aa bb cc dd V V= ∪ ⊆ ×{ , , , , } { , , , }
a
c
b
d
Directed Graph
Binary Relations as Graphs or Matrices
If , we say that is the domainof the relation , and that is the range.
Notation for Binary Relations
R A B⊆ × ABR
If , we say that the pairis in the relation , or .
( , )a b R∈R aRb
Example: “Less than or Equal”
A B
R A B
= =⊆ × = ≤
{ , , , } ,
" "
012 �
≤ ≤ ≤ ≤≤ ≤ ≤
≤ ≤≤
0
0 0
0 0 0
0
1
2
3
0 1 2 3
Example: “a times b = 120”
V
R V V u v u v
R
=⊆ × = × ==
{ , , , } ,
{ ( , )| }
{ ( , ),( , ),( , ),( , ),( , ),( , )}
012
12
112 2 6 3 4 4 3 6 2 121
1
12
2 3
46
Properties of Binary Relations
• A binary relation can be– reflexive, and/or
– transitive, and/or
– symmetric, and/or
– antisymmetric
• We illustrate these properties on the nextfew slides
R V V⊆ ×
Reflexive BinaryRelations
A binary relation is reflexive if and only if for every vertex
1 1 1 1
0 1 0 1
0 0 1 1
0 0 0 1
a
c
b
d
a
cb
d
V a b c d= { , , , }
R V V
v V vRv
⊆ ×∈ ⇒
R V V⊆ ×( , )v v R∈
v V∈
Non-ReflexiveBinary Relations
1 1 1 1
0 1 0 1
0 0 1 1
0 0 0 0
a
c
b
d
a
cb
d
V a b c d= { , , , }
R V V
v V vRv
⊆ ×∃ ∈ ∋ ¬
Non-Reflexiviety implies thatthere exists such that .
v V∈( , )v v R∉
Transitive Binary Relations
a
b� c�
d�
A binary relation is transitive if and onlyif every path is triangulated by adirect edge.
( , )u v
( , )u v
e
If and
and then
u v w V uRv
vRw uRw
, , , ,
, .
∈
Non-Transitive Binary Relations
A binary relation is not transitive if thereexists a path from to that is nottriangulated by a direct edge.
R V V
u v w V
uRv vRw vRv
⊆ ×∃ ∈
¬, , ,
, ,
such that
but
a
b� c�
d�
e
( , )u vu v
A binary relation is symmetric if and onlyif every edge isreciprocated by a edge
Symmetric Binary Relations
( , )u v
( , )v u
R V V
u v R v u R
uRv vRu
⊆ ×∈ ⇒ ∈
⇒( , ) ( , )
( )
1
12
2 3
46
A binary relation is non-symmetric if thereexists an edge notreciprocated by anedge
Non-Symmetric Binary Relations
( , )u v
( , )v u
R V V
u v R v u R
⊆ ×∃ ∈ ∉( , ) ( , )such that
ed
cb
a
Antisymmetric Binary Relations
∀ ∈ ⇒ =( , )�
, ( , )�
( )�
u v R
u R
v v R
u v u
A binary relation is anti-symmetric if and onlyif no edge isreciprocated by aedge
( , )u v( , )v u
Not antisymmetric if any such edge is reciprocated.
v u=
ed
cb
a
Equivalence Relations
Note R is reflexive, symmetric, and transitive
a
b�
c�
d�
eed
cb
a
The Path Relation
This graph defines pathrelation * →
ed
cb
a
G V E=( , )
* →
a a b c d eb c d ec c ed c ee c e
*
*
*
*
*
{ , , , , }{ , , }{ , }{ , }{ , }
→
→
→
→
→
* →Relation is sometimes called “Reachabilit y”
Equivalence Relations
This graph defines pathrelation This graph defines R
NOT an equivalencerelation
An equivalencerelation
* →
ed
cb
a
ed
cb
a
R u v v u u vG V R
= → →
={ ( , )| , }* *
( , )G V E=( , )
The Cycle Relation
This graph defines pathrelation *← →
ed
cb
a
ed
cb
a
C u v v uG V R
= ← →
={ ( , )| }*
( , )G V E=( , )
*← →
These are called the “StronglyConnected Components” of G
Functions
• A function f is a binary relation from set A(called the domain) to B (called the range)
• But, it is required that each a in A beassociated with exactly 1 b in B
• For functions, it cannot be true that both(a,b) in R and (a,c) in R, b different from c
Image and Preimage
• Consider a function f(x) : A -> B:
• Given a doman C A, the set
IMG(f,C) = { y B | x C s.t. y=f(x)}
is called the image of C under the mapping f.
• Given a range C B, the set
PRE(f,C) = { x A | y C s.t. y=f(x)}
is called the preimage of C under f.
⊆
⊆
∃
∃
∈∈
∈ ∈
Properties of Functions
• A function f is one-to-one (or injective), ifx=y implies f(x)=f(y).
• A function f is onto (or surjective) if, forevery y B, there exists an element x A,such that f(x)=y.
• A function that is both one-to-one and ontois called bijective, and is invertible.
∈∈
Other Binary Relations
• Compatibilit y Relations (Ch.: 8 FSM Minimization)•Reflexive•Symmetric•Not transitive
•Partial Orders (Includes Lattices, Boolean Algebras)•Reflexive•Transitive•Antisymmetric
The Binary Relation of Relationsto Synthesis/Verification
Equivalence Relations
Partial Orders
Compatibili ty Relations
Sequential Logic (no DCs)
Sequential Logic (with DCs)
*DC�
=don�
’ t c� a� re�
Combinational Logic (no DCs)=> (0,1) Boolean Algebra
Combinational Logic (with DCs)=> Big Boolean Algebras