Professional Documents
Culture Documents
Definition
Let A and B be sets. The Cartesian Product is the set of all ordered pairs where the first coordinates are in A and the second coordinates are in B. Notation
AB = { (a,b) aA and bB }
CARTESIAN PRODUCT
Cartesian product of 3 or more sets (n-fold product)
AB C = { (a, b, c) aA, bB and cC }
CARTESIAN PRODUCT
Theorems
1. A (BC)=(AB)(AC) 2. A (BC)=(AB)(AC) 3. A= 4. (AB)(CD)=(AC) (BD) 5. (AB)(CD) (AC) (BD)
Product rule
if |A| = m and |B| = n, then |AB| = m*n if |C| = k, |ABC| = m*n*k
RELATIONS
Definition
A relation on two sets A and B is a subset of AB. A relation is specified by an open sentence such as a is less than b or a + b = 5. Examples
1. Let R be the relation from A = { 1, 2, 3, 4 } to B= { 1,3,5 } which is defined by x is less than y . R = { ( x,y ) x is less than y } = { (1,3), (1,5), (2,3), (2,5), (3,5) , (4,5) } 2. Let R be the relation from E = { 2, 3, 4, 5 } to F = { 3, 6, 7, 10 } which is defined by x|y
RELATIONS
binary relation: relation defined on two sets that are
not necessarily distinct
RELATIONS
domain of a binary relation
set whose elements are all as such that (a,b) R. ( a is related to b or aRb )
RELATIONS
Properties of relations
reflexive. aRa for all a A (every element is related to itself) irreflexive: ab A, aRb ab (every element is not related to itself) symmetric: ab A, aRb bRa antisymmetric: ab A, (aRb bRa) a = b transitive: if aRb bRc then aRc for all a,b,c A
RELATIONS
Properties of relations: Example
Let R be the relation on the set of natural numbers: x is related to y such that x y Reflexive. every natural number is itself Not Symmetric. if x y, y is not necessarily x Antisymmetric: x y y x x = y Transitive: x y y z x z
EQUIVALENCE RELATION
Definition
A binary relation R on a set S is an equivalence relation if R is reflexive, symmetric and transitive. The set on which an equivalence relation is defined can be partitioned into disjoint sets by equivalence classes. A partition of a set S is a collection of nonempty disjoint subsets whose union equals S. For an equivalence relation on a set S if x S [x] denotes the set of all members of S related to x; [x] is called an equivalence class of x.
EQUIVALENCE RELATION
Examples
R on N defined by xRy if x+y is even
R is reflexive, symmetric and transitive. (verify this) R is an equivalence relation Equivalence classes (partition of N)
Hasse diagram: depicts the partial ordering of the set on which the relation is defined
R on { 1, 3, 6, 18 } where xRy if x | y
FUNCTIONS
Definition
A function/mapping, f: A B, is an assignment of an element of set B to every element of another set A. The element of B mapped to an element of A is unique. When a vertical line intersects at a single point in a graph on the x-y plane, the graph represents a function. For a function f: A B
A is the domain, B is the range
Relational operations
Database operations used to update or query information to or from a relational database (implemented in relational databases via SQL)
FUNCTIONS
Examples
f(x) = 4x + 5 f(x) = sin x f(x) = x2 Let A = { 1, 2, 3, 4 }
FUNCTIONS
A 1 f B a b c d A 1 2 3 4 B a b c d f(1) = a f(1) = b
B = { a, b, c, d }
f(4) = d
2 3 4
f: A B = { (1, a), (2, c), (3, d), (4,d) } f(1) = a f(2) = c f(3) = d
Not a function!
FUNCTIONS
Kinds of functions
one-to-one (injective) functions
every element of B is mapped to a unique element of A (a horizontal line intersects at a single point in the graph A f B A 1 2 3 4 f B a b c d 1 2 3 4 a b c d e
FUNCTIONS
Kinds of functions
onto (surjective) functions
every element of B must be mapped to an element of A A 1 2 3 4 f B a b c d A 1 2 3 4 f B a b c d
FUNCTIONS
Kinds of functions
Bijective function
function that is 1-1 and onto (implies a one to one correspondence between pairs) A 1 2 3 4 f B a b c d NOT one-to-one, NOT onto d is mapped to 2 elements f(3) = d = f(4) b is not mapped to any element
FUNCTIONS
Examples
f(x) = 4x + 5 one-to-one f(x) = sin x NOT one-to-one f(x) = x2 NOT one-to-one function that maps the set of countries in the world to the set of capital cities: 1-1 and onto
FUNCTIONS
Inverse of a function f: A B
f -1 : B A Examples
Given f(x) = 4x + 5, f -1(y) = (y-5 )/4 Given f(x) = 2x, then f -1(y) = log 2 y Given A = { 1, 2, 3, 4 } B = { a, b, c, d } and f = { (1, a), (2, c), (3, b), (4, d) } f -1 = { (a, 1), (b, 3), (c, 2), (d, 4) } f -1 (a) = 1, f -1 (b) = 3, f -1 (c) = 2, f -1 (d) = 4
FUNCTIONS
A function f is invertible if its inverse f -1 is also a function
f -1 is also a function if an only if f is one-to-one Examples
the previous examples are invertible (the functions defined are one-to-one)
FUNCTIONS
Composite functions
fg (x) = f (g(x)) gf (x) = g (f(x)) Example: Let f(x) = x2
g(x) = x + 3
fg (2) = f (2+3) = f(5) = 52 = 25 gf (2) = g (2)2 = g (4) = 4+3 = 7 fg (x) = f (x+3) = (x+3)2 = x2 + 6x + 9 gf (x) = g (x)2 = x2 + 3