Mathematical set is the totality of well-defined objects. The objects which belong to the set are called the elements.

This state of belonging to a given set is called relation, which has the following sign: a∈X

You may read the given relation like this: “the elements of X set”, or “X set contains the following elements”.

The elements of a set:

The number of the elements which belong to a give set is called the cardinality of the set. This cardinal may be finite or infinite.

The elements (which belong to a given set) can be defined by enumeration or by giving an exact principle of how they belong to that set.

For example:

The set of natural numbers:

$$ Z = \{1, 2, 3, 4, 5, ...\} $$

You may define the elements by writing them: List the natural, odd integers from one to ten:

$$ A = \{1, 3, 5, 7, 9\} $$

or

$$ A = \{x \mid x \text{ is an odd integer and } 1 \leq x < 10 \} $$

or in modern C++:

std::set<int> mySet = {1, 2, 3};

or in Python:

my_set = {1, 2, 3}

The sets (and their belongings) are usually set in a sharp way.

In information technology it is possible to use sets which contain fuzzy elements as well.

In these cases the value of how an element is connected to a given set is defined by a 'membership function' μm(x)

Fuzzy sets are a generalization of classical sets used in mathematics and logic to handle uncertainty and partial membership. Unlike classical sets where an element either belongs or does not belong to a set (membership is binary: 0 or 1), fuzzy sets allow for degrees of membership, represented by values between 0 and 1.

Further reading: A very brief introduction to fuzzy-logic