Re: More on lists and sets

From: Mikito Harakiri <mikharakiri_nospaum_at_yahoo.com>
Date: 27 Mar 2006 10:34:37 -0800
Message-ID: <1143484477.504649.180060_at_g10g2000cwb.googlegroups.com>


Marshall Spight wrote:
> > > As join/intersection is noncommutative, we have left selection and right
> > selection.
>
> I don't see why it's not commutative.

Example:

1->2->1 /\ 2->1->2

A(x,y)



1 0
2 1
1 2

B(x,z)



2 0
1 1
2 2

Join the relations

A(x,y)&&B(y,z)



2 1 0
1 0 1
1 2 1
2 1 2

Order

A(x,y)&&B(y,z)


2   1 +  0*100 = 1
1   0 +  1*100 = 100
1   2 +  1*100 = 102
2   1 +  2*100 = 201

The result: 2->1->1->2

2->1->2 /\ 1->2->1

This have to be ordered differently

A(x,y)&&B(y,z)


1   0*100 +  1 = 1
2   1*100 +  0 = 100
2   1*100 +  2 = 102
1   2*100 +  1 = 201

The result: 1->2->2->1

I use the word "list join" instead of "my list intersection" from now on. List join performs two operations at once: selection and ordering -- this is why it's not very intuitive, at first.

The other example. Left join with natural numbers leaves list as it is. Right join sorts it in the ascending order. Again, I need couple more convincing examples. E.g. How to remove duplicates in this algebra? How to invert list? Received on Mon Mar 27 2006 - 20:34:37 CEST

Original text of this message