Re: Function
Date: Tue, 15 Jan 2008 10:52:28 -0500
Message-ID: <2008011510522875249-kirakun_at_earthlinknet>
On 2008-01-15 09:26:01 -0500, mAsterdam <mAsterdam_at_vrijdag.org> said:
> vldm10 wrote: >> I think it will be good to have two definitions for the functions in >> your glossary. >> Definition1 A function from A to B is a rule that assigns, to each >> member of set A, exactly one member of set B. >> >> And second definition is similar to Jan's suggestion, but slightly >> changed: >> Definition2 >> A function from A to B is a relation between A and B that associates >> each element of A with exactly one element of B. >> >> First definition says that a function do something. You can call it >> intutive definition of a function. Here the function in fact is a >> procedure as you mentioned. >> Second definition is set theoretic. > > Another difference I see with Jan's is a sense of direction. > > How about this: > cdt glossary proposal: >
>>> [Codomain]
>>> See function, math context.
>>>
>>> [Domain]
>>> 1. Given a relation R, a domain is a set Sn such
>>> that for each tuple (A1, A2, ...An, ...Am) in R,
>>> An is an element of Sn.
This is not good enough. It is possible that a value exists in the domain Sn yet the relation has no corresponding tuple which holds that value for An.
>>>
>>> 2. A domain is a set of values: for example
>>> "integers between 0 and 255",
>>> "character strings less than 10 characters long",
>>> "dates".
>>> Sometimes used synonymously with type.
This seems right. A domain is just a set of values. In relational algebra, this set is required to be non-empty since attributes are non-null.
>>>
>>> 3. Domain of a function. See function, math context.
On the other hand, mathematics does not require a domain to be non-empty.
>>>
>>>
>>>
>>> [Function]
>>> For now we have to live with different meanings
>>> of _function_ when talking about databases:
>>> "The function of this function is to get the tuples from B
>>> that are functionally dependant on A."
No, there is always just one meaning of function in database.
>>>
>>> Three different contexts, but just about the same meaning:
>>>
>>> 1. General
>>> A purpose or use.
>>>
>>> 2. Math
>>> A binary mathematical relation over two sets D and C that associates
>>> with each element in D exactly one element in C.
>>> Set D is called the domain of the function, C its codomain.
Essentially correct, although to be rigorous you need to define how
such binary relation can define the meaning of "associating each
element in D exactly one element in C."
Not all binary relation has this property.
>>>
>>> 3. Software
>>> A subroutine, procedure, or method.
Yea. It's really an abused use of the term in software design. Subroutines in software has no clear domain since same input arguments can product different outputs.
>>>
>>> In both the math and software context, there is a sense of
>>> direction from domain (input) to codomain (output).
>>> For most purposes, this intuitive picture is good enough:
>>>
>>> |------------|
>>> --- x ---- >| f-machine |------ f(x) ----- >
>>> |------------|
>>>
>>> Where x is input in the "f-machine" and f(x) is output.
Fair.
>>>
>>> notes:
>>> every operator is a function
>>> every function is a relation
Yes.
-- -kiraReceived on Tue Jan 15 2008 - 16:52:28 CET