in reply to Re^3: Subtracting Lists
in thread Subtracting Lists

By definition, sets have no duplicates.

Update: Hum, I guess he didn't use the word "set", but "difference" is an operation that produces a set.

Replies are listed 'Best First'.
Re^5: Subtracting Lists
by NetWallah (Canon) on Jun 02, 2008 at 06:09 UTC
    You are correct in the statement that sets have distinct elements.

    But the O.P did not say he was dealing with sets - he said "arrays".

    Update: Um - Ignore this post, since you updated yours ...

         "A fanatic is one who redoubles his effort when he has forgotten his aim."—George Santayana

Re^5: Subtracting Lists
by blazar (Canon) on Jun 02, 2008 at 17:03 UTC
    Update: Hum, I guess he didn't use the word "set", but "difference" is an operation that produces a set.

    I personally believe that a notion of difference can be given for the mathematical objects representing both ordered lists, i.e. functions from some finite set (0...n-1) into some other set, and unordered ones, i.e. classes of equivalence of those functions wrt composition with a permutation on the domain. Except that at least two reasonable definitions of such a difference spring to mind, abstractly, and I think that with no further specification one just has to pick the one that seems most reasonable for the actual problem. In the example the OP gave, both would do, so there's an ambiguity.

    --
    If you can't understand the incipit, then please check the IPB Campaign.