Re: Functions are not fundamental to databases. Realtion are.

From: dawn <dawnwolthuis_at_gmail.com>
Date: 17 Jul 2005 21:49:06 -0700
Message-ID: <1121662146.888471.163400_at_f14g2000cwb.googlegroups.com>


Drago Ganic wrote:
> Dawn,
> functions and relations have in CS and mathematics two very important but
> different meanings:
> function ==> computation, action/transformation
> relation ==> storage, state

I am quite sure that any mathematical definition of a function will ensure that the function is a relation. Please look up the definitions of these mathematical terms and let me know if that is not what you find.

> The most fundamental objects in mathematics are functions and sets (=>
> relations).

I just deleted my full response to that and I'll only respond to the last part of your statement. A relation is a set (and a set does not imply a relation, if that is what your notation was to indicate). A function is a relation. Therefore a function is a set.

A function is a set that can be represented by showing that for each element in the domain of the function (you could think of the domain of a function to be the set of all values from which a key -- CK -- might come) you can identify exactly one element in the range of the function (a tuple, for example). We can say that a function PERSON maps the identifier "12345" to the tuple ("12345", "Rena", "Bakker"), for example, where that tuple is an element of the relation that is more specifically a function, and more generally a set.

> Functions cannot be UPDATEed / DELETEed or MODIFYed ... those are done on
> data which are stored somewhere.

Of course they can. You are relying too much on how you perceive a function and not on what it is defined to be.

> Functions just SELECTs data i.e.
> gives/calculates value(s) FROM somewhere.

Are you saying that for any value from the set of possible inputs to the function, there is a single output? Now look at the set of tuples with all input and corresponding output values. That would be a relation, right?

> Where is the confusion? This newsgroup is about storage,

there are more than a few folks here who would differ with you on this, but I'll go along with it -- storage by whatever name

> hence sets.

Storage, hence sets? You can't store a bag/multiset?

> So sets
> (incl. relations) are a good staring point for teaching databases (also in
> kindergarten :-)

I'm good with sets. Sets & the more specific flavor of sets that are functions are actually both good for kindergarten. I've even seen relations that are not sets there. When a student graduates from high school, they typically have heard definitions of two of those three terms -- the two I like to start with.

> Greeting from Croatia,

and back to you from the middle of corn fields in Iowa USA. Cheers! --dawn

> Drago Ganic
>
>
> "dawn" <dawnwolthuis_at_gmail.com> wrote in message
> news:1121198764.065448.194130_at_g44g2000cwa.googlegroups.com...
> > Marshall Spight wrote:
> >> dawn wrote:
> >> > [a lot of stuff]
> >>
> >> Dawn,
> >>
> >> Uh, wow.
> >
> > Glad you enjoyed? :-)
> >
> >> I don't *want* to ditch the word relation; I don't have another
> >> word that comes close. "Function" doesn't cut it.
> >
> > Because ... ? Granted, it is but one way to model data. I don't insist
> > on a single way of viewing the subject. However, I can discuss the
> > topic of data modeling quite thouroughly without ever using the term
> > "relation" but not without using the term "function".
> >
> >> I also
> >> don't see any particular conflict or even a difference between
> >> mathematics and computer science; I consider CS to be a branch
> >> of math, with some particular areas of emphasis, such as
> >> how much work calculating a particular function is.
> >
> > So one might hope that CS would not take a solid, generally agreed
> > upon, mathematical term and redefine it. But that does seem to be what
> > has happened, unfortunately.
> >
> >> And what's wrong with "a subset of the product of sets?" That's
> >> not all that complicated.
> >
> > I like it. I haven't seen a product of sets that has unordered
> > "columns" however.
> >
> >> It's no more complicated than "a mapping
> >> from one set to another."
> >
> > Functions are a subset of relations that is a little easier to teach,
> > however. In kindergarten the students match an item on the left hand
> > side of the page to exactly one on the right before any exercises that
> > permit the more generalized form of a relation, allowing an item on the
> > left to have a line to more than one item. So, I would argue that
> > there is some slight advantage to introducing the concept of a function
> > and then generalizing instead of starting with relations and then
> > narrowing it down.
> >
> >>
> >> > > It doesn't have to be required, it usually follows from the fact that
> >> > > the relation is a set.
> >> >
> >> > You lost me here. How do you define a candidate key in mathematics so
> >> > that every set must have one?
> >>
> >> A "set" is a collection of *unique* members. Because of that word
> >> "unique" there has to be a candidate key.
> >
> > OK, I'm with you and willing to hit my forehead and say "duh". Saying
> > that because something is a set it must be a function is not accurate,
> > but, yes, there is a function that can be associated with any set. If
> > no subset of the element/tuple variable is a candidate key, then the
> > entire element would be. Sorry I missed the point. --dawn
> >
Received on Mon Jul 18 2005 - 06:49:06 CEST

Original text of this message