# Collection - Set

### Table of Contents

## 1 - About

A set is:

- a data structure of the set theory
- an unordered collection of objects

The objects element of the set have the same type (the type may be a composed type such as a tuple)

The set is used to perform distinct operation (ie deleting duplicates)

## 2 - Articles Related

## 3 - Examples

### 3.1 - In Programming language

Some real-world examples of sets include the following:

- The set of uppercase letters 'A' through 'Z'
- The set of nonnegative integers {0, 1, 2 …}
- The set of reserved Java programming language keywords {'import', 'class', 'public', 'protected'…}
- A set of people (friends, employees, clients, …)
- The set of records returned by a database query - See resulset (in java)
- The set of Component objects in a Container
- The set of all pairs
- The empty set {}

### 3.2 - In Computer Science

- The idea of a “connection pool” is a set of open connections to a database server.
- Web servers have to manage sets of clients and connections.
- File descriptors provide another example of a set in the operating system.

## 4 - Basic properties of sets

The basic properties of sets:

- Sets contains only one instance of each item
- Sets may be finite or infinite
- Sets can define abstract concepts

## 5 - Set expression

### 5.1 - Set of Non-negative number

In Mathese, “the set of non-negative numbers” is written like this:

where:

- The colon stands for “such that”
- the part before the colon specifies the elements of the set, and introduces a variable to be used in the second part
- the part after the colon: defines a filter rule

The above notation can also be shortened if x is wel known :

### 5.2 - Another example

Another example where the set consists of and

### 5.3 - Tuple

Tuples examples in set expression:

- The set expression of all pairs of real numbers in which the second element of the pair is

the square of the first can be written:

of abbreviated:

- The set expression of triples consisting of nonnegative real numbers.