Re: bags vs. sets

From: David Cressey <cressey73_at_verizon.net>
Date: Wed, 16 May 2007 10:34:30 GMT
Message-ID: <W6B2i.13376$1X1.9126_at_trndny02>


"Bob Badour" <bbadour_at_pei.sympatico.ca> wrote in message news:464a5c56$0$4013$9a566e8b_at_news.aliant.net...
> Vadim Tropashko wrote:
>
> > On May 15, 3:38 pm, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
> >
> >>Marshall wrote:
> >>
> >>>We regularly deride SQL for using bags rather than sets.
> >>>Now, I get many of the reasons we point and laugh at SQL,
> >>>but I'm not so clear on this one.
> >>
> >>>We could have a language that covered sets, bags, and lists.
> >>>We could have a language that used bags as the basic
> >>>collection type and built lists and relations out of that.
> >>>It's not hard: a relation is a bag with a uniqueness constraint.
> >>>A list is a bag with a uniqueness constraint on a column
> >>>that belongs to the natural numbers. (Details glossed over.)
> >>
> >>>OTOH, I'm less clear how to model a bag with relations.
> >>
> >>A bag depends on physical location for identifying elements. Because
> >>elements in relations have no particular physical location, the very
> >>idea seems a little absurd.
> >
> > Compared to sets bags occur in math very rarely. Yet there are some
> > prominent cases such as equation roots. Consider:
> >
> > x*(x-1)*(x-1) = 0
> >
> > The root x=1 is counted with its multiplicity 2.
>
> Is the bag 0, 1, 1 the same as 1, 0, 1 ?
>
Is a pizza with pepperoni, cheese, and extra cheese the same thing as a pizza with cheese, pepperoni, and extra cheese?

Sorry. I couldn't resist. Received on Wed May 16 2007 - 12:34:30 CEST

Original text of this message