Upload
ernest-webb
View
229
Download
0
Embed Size (px)
DESCRIPTION
Subsets When all elements in A are also elements of B : A is a “subset” of B A B B “contains” or “covers” A Otherwise, A B Any set is a subset of U is a subset of any set If A B and B A, then A = B If A B and A B then A is a “proper subset” of B A B The set of subsets of A is the “power set” of A, P(A) P(A) and A P(A) NOTE: A A and A A and A and A U
Citation preview
Set Theory ConceptsSet – A collection of “elements” (objects, members)
• denoted by upper case letters A, B, etc.• elements are lower case• brackets are used to encompass members of a set
A = {a, b, c} a A d A
• sets may be finite or infinite is the empty set, = {} is a finite set• U is the universal set, it contains all possible elements• U may be finite or infinite
Describing Sets• Two Ways:
1) Enumeration – list all elements2) Generation – general expression and condition
Example: The set of all integers between 5 and 13
{5,6,7,8,9,10,11,12,13}
{x | 5 x 13 and is integral}
{y | 4 < y < 14 and is integral}
Subsets• When all elements in A are also elements of B:
A is a “subset” of BA B
B “contains” or “covers” A Otherwise, A B Any set is a subset of U is a subset of any set
• If A B and B A, then A = B
• If A B and A B thenA is a “proper subset” of B
A B• The set of subsets of A is the “power set” of A, P(A)
P(A) and A P(A) NOTE: A A and A A and A and A U
Some Common Operations• The “Union” of A and B is A B
A B contains elements that are in set A or in set B or in both sets A and B
A B ={x | x A or x B}
• The “Intersection” of A and B is A BA B contains the common elements that are in
both sets A and BA B ={x | x A and x B}
• The “Complement” of set A is AC or AAC contains all elements in U that are not in A
A = AC = U - AAC={x | x A and x U}
Properties of SetsIdempotence Laws: A A =A, A A = ACommutative Laws: A B = B A, A B = B A Associative Laws: A (B C) = (A B) C,
A (B C) = (A B) C Absorption Laws: A (A B) = A, A (A B)=
ADistributive Laws: A (B C) = (A B) (A
C) , A (B C) = (A B) (A
C) Involution Law: A = AComplement Laws: U = , = U
A A = U, A A = Identity Laws: A = A, A U = A
A U = U, A =
DeMorgan’s Laws: (A B) = A B, (A B) = A B
Venn’s Diagram
A B
CU
Difference Operation
A B
U
A = {1,3,5,6,7,8} B = {1,2,3,4,5}
A – B = {6,7,8}B – A = {2,4}
A B = {1,3,5}
Cartesian Product• 2 elements in a fixed order is a “pair” or “ordered pair”
(a,b)• n elements in a fixed order is an “n-tuple”
(a1, a2, …. , an)(a1, a2, …. , an) = (b1, b2, …. , bn) iff ai=bi i where 1 i n
• The “cartesian product” or “direct product” of 2 sets A and Bthe set of all ordered pairs of A and B
A BEXAMPLE:
A={0, 1} B ={0, 1, 2}A B = {(0,0),(0,1),(1,0),(0,2),(1,1),(1,2)}
• “Cardinality” or “size” of set A is | A |=nA
| A B | = nA nB = 2 3 = 6
Propositional Functions• A Propositional Function, F(x,y), is Defined on A B• Ordered Pair (a,b) Substituted for (x,y) (a,b) A B• F(x,y) Can be a Proposition
(F(x,y) is either true or false, but not both) EXAMPLE:
x is less than yx weighs y poundsx divides yx is the spouse of y
• A Relation, R, is Defined Over:1) a set A2) a set B3) a proposition F(x,y)
R = (A, B, F(x,y))if F(a,b) is true then aRbif F(a,b) is false then aRb
Set Relations• If R A B , then R is a “binary relation”
EXAMPLE: R A B ai A bi Bif (ai,bi) R then ai R bi and “relation R holds”if (ai,bi) R then ai R bi “relation R does not hold”
• Inverse Relation, R -1, is all pairs in R with reverse orderR -1 = {(bj,ai)|(ai,bj) R }
• R =(A, A, F(x,y)) is an “equivalence relation” on set A if:1) aRa
(reflectivity)2) If aRb then bRa (symmetry)3) If aRb and bRc then aRc (transitivity)
a, b, c A
Equivalence Relation• Consider R = (Z, Z, F(x,y)) where Z is the set of all positive
integers and F(x,y) is the Proposition that x = y
R Z Z = {(1,1), (2,2), (3,3) ….}
• For any zi Z it is true that zi R zi
Reflectivity is Satisfied
• For any zi, zj Z, if F(zi,zj) is true then F(zj,zi) is trueSymmetry is Satisfied
• For any zi, zj,zk Z, if F(zi,zj) and F(zj,zk) then F(zj,zk)Transitivity is Satisfied
R is an Equivalence Relation over Z
Set Partitions• A Partition of A denoted by [a] satisfies:
[a] A• Consider a Set of Subsets of A
{A1, A2, …, An}• The Ai are Partitions of A if:
1) A = A1 A2 … An
2) Either Ai = Aj or Ai Aj = (disjoint subsets)
EXAMPLE• Consider A={1,2,3,…,9,10}, B1={1,3}, B2={7,8,10},
B3={2,5,6} and B4={4,9}1) A = B1 B2 B3 B4
2) Bi Bj = i j
{B1, B2, B3, B4} are Partitions of A
Equivalence Class
• R is a “binary relation” over set A• Partition A into “blocks” such that
[a]={x | a R x, x A}• Set [a] is an “equivalence class” of A over R• An arbitrary element of A is a member of exactly one
equivalence class• Set of all equivalence classes over R on A is the “quotient
set” of A wrt RA / R
• The number of equivalence classes “rank” of R
Equivalence Class Example
• R = (A, A, F(x,y))
• F(x, y) is Proposition that K=x (mod 3), K is a Constant
NOTE: F(x, y)= F(x) in this case, a unary proposition
• A ={0,1,2,3,4,5,6,7,8,9,10}
• [a1]={0,3,6,9}, [a2]={1,4,7,10}, [a3]={2,5,8}
• Each Partition is an Equivalence Class
• A / R ={{0,3,6,9},{1,4,7,10},{2,5,8}}
• Rank of R is 3
Logic Notation• “proposition” is a sentence with a clear meaning allowing
its’ evaluation of true or false• Fire is cold - FALSE• Let P and Q be propositions
P Q means that if P holds then Q holds P Q means that P is true iff Q is true, or,
P is a “necessary” and “sufficient” condition for Q
• If P Q :P is a “sufficient condition” of QQ is a “necessary condition” of P
• P Q does not necessarily mean that Q P• Q P is the “converse” of P Q • If P Q then Q P
Q P is the “contraposition” of P Q
Refinement• R1 and R2 are Equivalence Relations over A• if xR1y xR2y for x, y A then
R1 is a “refinement” of R2
R1 R2
EXAMPLE:A={011, 100, 110, 111}
R0=(A,A, F0) R1=(A, A,F1)R0 and R1 are Equivalence Relations
F0 proposition that all corresponding bits are sameF1 is proposition that right two bits are same
R0={(011,011),(100,100),(110,110),(111,111)}R1={(011,011),(011,111),(100,100),(110,110),(111,011),(111,111)}
R0 is a refinement of R1 R0 R1
Definition of a Function• A and B are sets, f is a function that maps ai A to bj B
f: A Bf(ai)=bj
ai f bj
• A is the “domain” of f• bj is the “value” of function f• bj = f(ai)B is an “image” of ai A • A Relation Rf may be Defined from f
f : A B, f(ai)= bj iff (ai, bj) Rf
• f -1 is the “inverse relation” of function f: A B• f -1 is NOT, in general, a function• f -1(bj) IS an “inverse image” of bj
f -1(bj) A
Operation
• “unary” operation is a function, f : A A
• “binary” operation is a function, f : A A A(e.g. ai * aj = ak, (ai,aj) ak)
EXAMPLEB = {0,1} a,b B
a = 1 - a (unary-complement)a b = a • b (binary-conjunction)a b = a + b - (a • b) (binary-disjunction)a b = a + b - (2 • a • b) (binary-exclusive
OR)
Ordered Relations
• R is a Binary Relation on A• For a,b,c A if the following hold:
1) aRa (Reflexive Law)2) If aRb and bRa then a=b (Anti-Symmetric Law)3) If aRb and bRc then aRc (Transitive Law)
• R is said to be a “Partially Ordered Relation”• Also, if a,b A , aRb or bRa then
R is said to be a “Total Order Relation”• Such ordered relations are denoted as
a R b rather than aRb
Ordered Sets
• R is a binary Relation on A• For a,b,c A if the following hold:
1) aRa (Reflexive Law)2) If aRb and bRa then a=b (Anti-Symmetric Law)3) If aRb and bRc then aRc (Transitive Law)
• R is said to be a “Partially Ordered Relation”• Also, if a,b A , aRb or bRa then• R is said to be a “Total Order Relation”• Such ordered relations are denoted as
a R b rather than aRb• An ordered set consists of an order relation and the set over
which it is defined A, R
Hasse Diagrams
• R is a binary Relation on A• For a,b,c A such that a R b and a b
if there is no element c such that a R c, c R b where a b c then b “covers” a
• Hasse Diagrams are useful for visualizing cover characteristics
• Covering elements appear ABOVE Covered elements and are connected by a line
• “Maximal Elements” are those which are NOT Covered
• “Minimal Elements” are those which do NOT cover any other Elements
Hasse Diagram Examples
1 is the maximal element0 is the minimal element
1
0
a b
e f
d
c
(1,1)
(0,0)
(0,1) (1,0)
(1,1) is the maximal element(0,0) is the minimal element
a and b are the maximal elementsc is the greatest lower bound of {a, b}e and f are the minimal elementsd is the least upper bound of {e, f}
Least Upper Bound, Greatest Lower Bound
Let A, R be an ordered set and let B A
• a A is Upper Bound of B if b R a, b B • a A is Lower Bound of B if a R b, b B
• If there is a minimum element in the set of the upper bounds of B, then it is the Least Upper Bound of B (denoted by a b )
• If there is a maximum element in the set of the lower bounds of B, then it is the Greatest Upper Bound of B (denoted by a • b )