« previous section | next section » |
A set is a collection of objects that have some common
property. This is an intuitive comprehension of a set. Instead of
trying
to define the notion formally, we will leave this notion on that level
of precision and just start to present examples of sets. But it is
worth while to say that such intuitive treatment of that notion
may lead to the contradictions, known as paradoxes of the set
theory.
Let us start with some simple examples:
- The set of all students of Polish-Japanese Institute of Information Technology, PJIIT.
- The set of all identifiers of a given program.
- The set of memory cells used during the execution of a program.
- The set of all natural numbers, N.
- The set of all real numbers, R.
Instead of " John is a student of the Polish Japanese Institute of Information Technology" we say that John is an element of the set PJIIT, or "John belongs to the set of students of Polish Japanese Institute of Information Technology" and we write " John ∈PJIIT". Instead of "5 is a natural number", we say, that "5 is an element of the set of natural numbers", or 5 belongs to the set N, and we write "5 ∈ N". The symbol " ∈" is called the "belongs to" relation. If we would like to say that an object x is not the element of a given set X, then we write "x ∉X", and in that case x does not belong to X. For example, 2.5 ∈R, and 2.5 ∉ N. Obviously, every object is or is not an element of the given set.
The sets in the first three examples are finite, one can list all elements of these sets. All the elements of these sets can be counted. The other two sets are infinite. We will discuss the problem of the cardinality of sets separately later.
Denotations: We assume that N, the set of natural numbers, contains 0 as the smallest element, and that 0 is an even number. The set of integers is denoted by Z and the set all rational numbers by Q. The sets of positive natural numbers, positive integers, positive rational numbers and positive reals will be denoted by N+, Z+,Q+ and R+, respectively.
One can define sets in a different manner. Most frequently by:
- listing all elements of a set,
- describing the common property of elements of a set,
- defining the recipe (a method) of calculating the elements.
We will illustrate it by the following examples.
Example 1.1.1. Let 1, 3, 5, 7, 9 be all elements of the set X. We shall denote this as X = {1,3,5,7,9}. The brackets "{","}" stand for "a set", and semicolons separate the elements of the set. One can define the same set X describing the characteristic properties of its elements: "X is a set of odd natural numbers les than 10" or X = {x: x is an odd natural number, and x < 11} or X = {x ∈ N : x mod 2 = 1 and x < 11}. Finally, the set X can be defined by the recipe, that describes the process of calculation of the consecutives elements:
- Set i to 1.
- Calculate 2i-1, and add the result as a consecutive element of the created set X.
- Increase i by one.
- If i=6 then stop, else repeat from the point 2.
The above algorithm defines X as a collection of numbers of the form 2i-1, where i takes as values 1, 2, 3, 4, 5. We shall write shortly X = {2i-1: i= 1, 2, 3, 4, 5}.
Example 1.1.2. Let A be a two element set. We shall define the set A* as the set of all finite words on A. Thus 001, 000101, 111 are examples of elements of A*. In computer science, the sequences of that type are used to code numbers. If (an,...,a0) < is a (n+1)-element sequence, then this sequence represents a0 20 + a1 21 +... +an 2n. For example, the sequence 101 is a binary code of 5 and 1000 is a binary code of 8.
Let us notice that some definitions of sets do not allow to indicate the elements of that set. For example, the set X of all zeros of the function x2 + 16 has no element since there exists no real number a that a*a + 16 = 0. We shall say in that case that X is an empty set. There is only one empty set. It is usually denoted by ∅.
Question 1.1.1 : Define in another way:
- X is the set of all natural numbers with the last digit equal to 0 or 5.
- Y is the set of all natural number with three-bit binary representation.
- Z is the set of all words constructed with exactly the same letters as those contained in the word 'set'.
« previous section | next section » |