Re: bags vs. sets

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Wed, 16 May 2007 08:05:18 -0300
Message-ID: <464ae529$0$4025$9a566e8b_at_news.aliant.net>


David Cressey wrote:

> "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.

Ahhh, but cheese and extra cheese are not necessarily the same thing. Received on Wed May 16 2007 - 13:05:18 CEST

Original text of this message