• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Union of sets (lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Union of sets (lists


  • Subject: Re: Union of sets (lists
  • From: Gary Lists <email@hidden>
  • Date: Sun, 12 Jan 2003 14:51:51 -0500

On or about 1/12/03 11:34 AM, Michelle Steiner wrote:

> If I recall set theory correctly (and it's been some 40+ years since I
> studied it), sets contain only unique items, so there wouldn't be any
> duplicates.

Nope...sets have "elements" which can be anything...duplicates are quite
allowed.

Imagine two kids' backpacks:

Set Q has elements {apple, apple, pencil, orange, frog}

Set X has elements {apple, rubberband, penny, banana}

Both valid sets.

So "union" them [put them all in one backpack] to get:

Set Z has elements {apple, apple, apple, pencil, orange, rubberband, banana,
frog}


AppleScript lists are sets, BTW. In fact, the { } used in set notation
means "whole elements are"...

Set A's elements = {a, b, a, c, a}
Set B's elements = {1, c, e, a, a}

Union = {a, b, a, c, a, 1, c, e, a, a} <-- pure union

Union = {a, b, c, e, 1} <-- unique union

iNtersection = {a, c} <-- pure intersection

{a, 1, c, a, a} <-- intersection [note absence of the 3rd a from A]

But, the OP would only know which level of 'purity' her/his solution was
requiring.

According to Venn, the 'pure' versions are most correct.
--
Gary
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Union of sets (lists
      • From: Axel Luttgens <email@hidden>
    • Re: Union of sets (lists
      • From: Michelle Steiner <email@hidden>
    • Re: Union of sets (lists
      • From: Gary Lists <email@hidden>
References: 
 >Re: Union of sets (lists (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Printing PS files from QuarkXPress
  • Next by Date: Re: Creating Text Notes From Safari Script
  • Previous by thread: Re: Union of sets (lists
  • Next by thread: Re: Union of sets (lists
  • Index(es):
    • Date
    • Thread