On Sun, Aug 2, 2009 at 7:23 PM, Kip Murray<[email protected]> wrote: > 1. Question: What is a set? > Answer:
This question is too abstract, I think. A proper question would be "how are we representing sets", and this can depend on your application and on your universe of supported elements. For example, I have no problem with "a set is represented as a sorted list of unique boxes". But I also have no problem with "a set is represented as a sequence of bits marking which element in the universe is a member" > 2. Question: What is an element of a set? > Answer: See above. > 3. Question: When are two sets the same set? > Answer: Set H is set K provided each element of H is an element of K and > each element of K is an element of H. In the context of computer programs, this depends on how you represent sets. For both of my examples for question 1, -: would work. However, -: will not work for all possible representations of sets. > 4. Question: What is a subset of a set? > Answer: To say H is a subset of set K means H is a set, and each element > of H > is an element of K. Also, the details of how this is implemented can depend on how you represent sets. One fundamental approach would be to find the elements in the potential subset which do not appear in the potential superset -- if there are none the potential subset really is a subset. But if you represent sets with equal-length lists of bits you can use an expression which would not work for other potential approaches: 0 0 1 *./ .<: 0 1 1 1 > 5. Question: What is an empty set? > Answer: The empty set, called phi, is the set which has no element. yes. But I never call the empty set "phi", and this name does not seem to be a common name for the empty set. Then again, I never call the empty set "george". > 7. Question: Why is the empty set a subset of every set? > Answer: This comes from the definition of subset (and of set): The set containing no elements is a set. For every set, if you removed all elements from the set, you would wind up with a set containing no elements. > 8. Question: Can the empty set be an element of a set? > Answer: That depends on 2, but the answer to 2 should make this answer > "Yes." Practically speaking, this depends on your application -- your "universe of consideration". If you have no use for empty sets in your sets, you should not waste any implementation effort on them. FYI, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
