Brighton Webs Ltd.
Statistics for Energy and the Environment
Home Index About

Set Notation

Set notation is a way of describing the membership of and relationships between groups of objects.  Set notation is used in a wide range of documents and contexts, one example being the definition of a database query.  This page is written from the perspective of a programmer who is likely to find set notation in specifications and description of algorithms and who needs to decode it.

In theory, much math and programming is self defining, however, the necessary understanding is usually only acquired after a verbal or written description or an example.

The examples below are based on integer values which are treated as objects, however the same notation is applied to non-numeric objects, e.g. footballers, planets and anything else for which a database has been created.

Universal Set

The term universal set is used to describe all the items under consideration.  It gets round the problem of handling things which are not in a set.  The examples below are based on a universal set which is all positive integers, this means we are not dealing the value of pi, a pair of high heeled shoes or the family dog.

Definition of a Set

It is a feature of language that it is convenient to give an object a name, so we'll use the creativity that programmers are famous for and call  our example set "A".  This can be defined simply by listing its members between curly brackets:

Example of a set

Whilst this works for simple sets, it may be more practical to use use functions, equalities or other devices as appropriate as shown below:

Definition of a set

In this case the universal set has been defined as all positive integers, thus set B is all values of x which are greater than or equal to zero and less than or equal to 19.  The colon is shorthand for "such that".

Membership of Sets

The notation for showing if an object is a member of a set is:

Set Membership

Equality of sets

Sets are described as equal if they contain the same members, thus:

Set Equality

Disjointed Sets

Two or more sets are said to be disjointed if they do not have any common members:
Disjointed Set
Venn Diagram

Subsets

Subsets are sets which are formed from the members of an existing set:
Subsets
Venn diagram

If a set operation is required to produce a set which is either equal to another set or a subset of it, the condition is:

Equal or Subset

If the desired result is a set which is not a subset, the following condition should be true:

Set which is not a subset

Intersections

An intersection operation between two sets produces a result which contains elements which are common to both sets:

Intersection of Sets
Venn diagram

Unions

A union operation between two sets produces a result which contains the members of both sets:
Union of sets
Venn diagram

In the above example, the sets have a common element, the number five, but a union can be formed from disjointed sets.

Complements

The complement of a set is all members of the universal set which are not in a specific set.  In this example, the universal set is all positive integers:

Sets - compliment

Empty sets

An empty or null set is defined as a set with no members, it has its own symbol, the operation below produces an empty set:

Empty Set
Page updated: 08-Jan-2010