# Representing and thinking about sets

The interactive examples in this post require installing Wolfram CDF player, which is free and works on most desktop computers using Firefox, Safari and Internet Explorer, but not Chrome. The source code is the Mathematica Notebook Representing sets.nb, which is available for free use under a Creative Commons Attribution-ShareAlike 2.5 License. The notebook can be read by CDF Player if you cannot make the embedded versions in this post work.

## Representations of sets

Sets are represented in the math literature in several different ways, some mentioned here.  Also mentioned are some other possibilities.  Introducing a variety of representations of any type of math object is desirable because students tend to assume that the representation is the object.

### Curly bracket notation

The standard representation for a finite set is of the form "$\{1,3,5,6\}$". This particular example represents the unique set containing the integers $1$, $3$, $5$ and $6$ and nothing else. This means precisely that the statement "$n$ is an element of $S$" is true if $n=1$, $n=3$, $n=5$ or $n=6$, and it is false if $n$ represents any other mathematical object.

In the way the notation is usually used, "$\{1,3,5,6\}$", "$\{3,1,5,6\}$", "$\{1,5,3,6\}$",  "$\{1,6,3,5,1\}$" and $\{ 6,6,3,5,1,5\}$ all represent the same set. Textbooks sometimes say "order and repetition don't matter". But that is a statement about this particular representation style for sets. It is not a statement about sets.

It would be nice to come up with a representation for sets that doesn't involve an ordering. Traditional algebraic notation is essentially one-dimensional and so automatically imposes an ordering (see Algebra is a difficult foreign language).

### Let the elements move

In Visible Algebra II, I experimented with the idea of putting the elements at random inside a circle and letting them visibly move around like goldfish in a bowl.  (That experiment was actually for multisets but it applies to sets, too.)  This is certainly a representation that does not impose an ordering, but it is also distracting.  Our visual system is attracted to movement (but not as much as a cat's visual system).

### Enforce natural ordering

One possibility would be to extend the machinery in a visible algebra system that allows you to make a box you could drag elements into.

This box would order the elements in some canonical order (numerical order for numbers, alphabetical order for strings of letters or words) with the property that if you inserted an element in the wrong place it would rearrange itself, and if you tried to insert an element more than once the representation would not change.  What you would then have is a unique representation of the set.

An example is the device below.  (If you have Mathematica, not just CDF player, you can type in numbers as you wish instead of having to use the buttons.)

This does not allow a representation of a heterogenous set such as $\{3,\mathbb{R},\emptyset,\left(\begin{array}{cc}1&2\\0&1\\ \end{array}\right)\}$.  So what?  You can't represent every function by a graph, either.

### Hanger notation

The tree notation used in my visual algebra posts could be used for sets as well, as illustrated below. The system allows you to drag the elements listed into different positions, including all around the set node. If you had a node for lists, that would not be possible.

This representation has the pedagogical advantage of shows that a set is not its elements.

• A set is distinct from its elements
• A set is completely determined by what the elements are.

### Pattern recognition

Infinite sets are sometimes represented using the curly bracket notation using a pattern that defines the set.  For example, the set of even integers could be represented by $\{0,2,4,6,\ldots\}$.  Such a representation is necessarily a convention, since any beginning pattern can in fact represent an infinite number of different infinite sets.  Personally, I would write, "Consider the even integers $\{0,2,4,6,\ldots\}$", but I would not write,  "Consider the set $\{0,2,4,6,\ldots\}$".

By the way, if you are writing for newbies, you should say,"Consider the set of even integers $\{0,2,4,6,\ldots\}$". The sentence "Consider the even integers $\{0,2,4,6,\ldots\}$" is unambiguous because by convention a list of numbers in curly brackets defines a set. But newbies need lots of redundancy.

### Representation by a sentence

Setbuilder notation is exemplified by $\{x|x>0\}$, which denotes the positive reals, given a convention or explicit statement that $x$ represents a real number.  This allows the representation of some infinite sets without depending on a possibly ambiguous pattern.

A Visible Algebra system needs to allow this, too. That could be (necessarily incompletely) done in this way:

• You type in a sentence into a Setbuilder box that defines the set.
• You then attach a box to the Setbuilder box containing a possible element.
• The system then answers Yes, No, or Can't Tell.

The Can't Tell answer is a necessary requirement because the general question of whether an element is in a set defined by a first order sentence is undecidable. Perhaps the system could add some choices:

• Try for a second.
• Try for an hour.
• Try for a year.
• Try for the age of the universe.

Even so, I'll bet a system using Mathematica could answer many questions like this for sentences referring to a specific polynomial, using the Solve or NSolve command.  For example, the answer to the question, "Is $3\in\{n|n\lt0 \text{ and } n^2=9\}$?" (where $n$ ranges over the integers) would be "No", and the answer to  "Is $\{n|n\lt0 \text{ and } n^2=9\}$ empty?" would also be "No". [Corrected 2012.10.24]

### References

1. Explaining “higher” math to beginners (previous post)
2. Algebra is a difficult foreign language (previous post)
3. Visible Algebra II (previous post)
4. Sets: Notation (abstractmath article)
5. Setbuilder notation (Wikipedia)
Send to Kindle