Sets and Functions
Sets and Functions
Mathematical
Backgrounds of KR
Let’s make a list
Created a domain
Created mappings from the domain
– Mobile(x)
– Alive(x)
Curly braces
– e.g. {1, 97, 63, 12}
Order is not considered
– e.g. {12, 63, 97, 1} is equivalent to the previous
What about very large sets?
Union
A B = {x | x A or x B}
Intersection
A B = {x | x A and x B}
Compliment
-A = {x | x U and not x A}
Difference
A-B = {x | x A and not x B}
Subset
A B = If x A, then x B
Other set operators (uncommon?)
Proper subset
– A is a proper subset of B if A B and there is at
least one element of B that is not in A
Superset
– A is a superset of B if B is a subset of A
Disjoint sets
– Two sets A and B are said to be disjoint if they
have no common elements
Identities
Idempotency. A A is identical to A, and A A is also identical to A.
Commutativity. A B is identical to B A, and A B is identical to B A.
Associativity. A (B C) is identical to (A B) C, and A (B C) is
identical to (A B) C.
Distributivity. A (B C) is identical to (A B) (A C), and A (B C) is
identical to (A B) (A C).
Absorption. A (A B) is identical to A, and A (A B) is also identical to A.
Double complementation. - -A is identical to A.
De Morgan's laws. -(A B) is identical to -A -B. and -(A B) is identical to -
A -B.
Defining complex sets
AxB
– Is the set of all possible ordered pairs with the first
element of each pair taken from A and the second
element from B
If A is the set {1,2} and B is the set {x,y,z}
AxB = {<1,x>,<1,y>,<1,z>,<2,x>,<2,y>,<2,z>}
Functions
f: A B
Also written as f(x)
A is the domain of f
B is the range of f
x is the input or argument
f(x) is the output or image
Onto functions