Mathematically speaking Functions Powersets Languages by Pavel Gladyshev
Mathematically speaking… Functions, Powersets, Languages by Pavel Gladyshev
Tuple • Ordered sequence of objects • Same object can appear in a tuple several times • Elements of a tuple are referred to with subscripts:
Relation A collection of links between elements of two or more sets: A R B a 1 b 2 c 3
Inverse Relation A R B B R-1 A a 1 a b 1 2 c 2 b 3 3 c
Relation • Formally defined as a set of tuples • The inverse relation
Relation as a predicate • Relation can be viewed as predicate:
Some classes of relations • Relation is reflexive if and only if – For all x in X it holds that x. Rx • Relation is transitive if and only if – For all x, y, and z in X if x. Ry and y. Rz then x. Rz • Relation is symmetric if and only if – For all x, y in X if x. Ry then y. Rx
Cartesian product of two sets A and B • Set of all pairs whose first element is from A and second element is from B
Example
Observe that any relation between A and B is a subset of A R B a 1 b 2 c 3
Function Special kind of relation Set B (Range of the function) a 1 b 2 c 3 Set A (Domain of the function) Each object in the domain is linked to at most one object in the Range!
Function declaration Function Domain Range
Function Application
Total vs. Partial function Total – defined on every element of X Partial – defined for some elements of X
Injective function Each element in X is linked to a distinct element in Y
Inverse function X Y Y X a 1 a b 1 2 c 2 b 3 3 c If the original function is injective, then its inverse is also function.
Powerset – set of all subsets
Inverse of non-injective function • For a non-injective function it is possible to define a kind of “inverse” that maps every element y of Y into a subset of elements of X for which f(x) = y
“Inverse” of non-injective function
Language • Suppose that we have a set • The set of all tuples of length 2 is • The set of all tuples of length 3 is • The set of all tuples of length n is
Language (contd. ) • Set of all tuples made of elements of • Set A is called Alpabeth • Language L is a subset of tuples from A*
Set Paradoxes and Constructivism
Assignment • Formally define the notion of hard disk drive. • Specifically try to define the following concepts: 1. Set of all bytes on HDD 2. Set of all sectors on HDD 3. Set of all keywords made from bytes on HDD
- Slides: 23