School of Engineering and Applied Science
Department of Computer Science
CSci 133 -- Algorithms and Data Structures I
http://www.seas.gwu.edu/~csci133/spring05
Prof. Michael B. Feldman
mfeldman@gwu.edu

A Bit of Set Theory
February 2004

This brief note presents just a bit of set-theory terminology, enough for you to get through the set-oriented reading and assignments in CSci 133. This subject is covered in much more depth in CSci 123, among other courses.

Sets are very important both in mathematics and in computer applications. Given a universe of objects or values, a set S is just a collection of objects belonging to that universe. Some common universes are the integers, the positive integers, the letters of the alphabet, and so on. Sets are so important in programming that some languages, especially Pascal, provide sets as a predefined type. 

Often sets are described mathematically simply by listing their members between braces, as in the set {a, b}, taken from the universe of English alphabetic characters. In general, there is no ordering associated with a set, so {a, b} and {b, a} usually describe the same set. Further, in general a given member appears in a set no more than once; we don't usually allow "duplicates". Two sets are said to be equal if they have exactly the same members. A set is said to be empty if it has no members.

Operations on Sets

What are the important operations associated with sets? Certainly inserting a member in a set and deleting a member from a set are essential; so are testing a set to see whether a given element is a member of it and testing a set to see whether it is empty. The last two operations are predicate operations; they return true/false values. The most important dyadic (binary  --  two operands) operations are

For example, if the universe is the alphabet letters, and S = {a, d, e, g} and T = {b, c, d, e, k}, then

Finally, two more predicate operations are commonly used:

For example, {b, c} is both a proper and an improper subset of {a, b, c, d, e}; {b, c} is not a subset of {c, e}. Also, {a, b} < {a, b}.

(end of article)