# Collection - Set

A set is:

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

The mathematical concept of a set is a group of unique items, meaning that the group contains no duplicates (theory) but many data application have extended this definition with a bag (multiset) (such as a table)

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

## Examples

### 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 {}

### 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.

## 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

## Set expression

### 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 :

### Another example

Another example where the set consists of and

### 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.

## Documentation / Reference

Discover More
(Collection|Container) Data Type (Set, Bag, Sequence)

A collection is a abstract data type for grouping together multiple values. It's therefore sometime known as a container and creates a aggregation relationship A collection is: an object that groups...
(Relation|Table) - Tabular data

A Relation is a logical data structure composed of tuple (row) attribute (column, field) The following data structure are a relation: a table, a materialized view (query) (store data) a query,...
(Relation|Table) - Tabular data

This section is based on the relation data structure must well known under the term of table. The system that manages this structure are called Relational databases (or RDMS) . They are founded on Set...
Automata - Finite Automata

A finite automaton is an automaton that has a set of states and its control moves from state to state in response to external inputs. It has a start and an end state and there are only a finite number...
Collection - (Tuple|Vector|Row)

A tuple is: a finite list of elements (fields) - It can only contain a specific number of elements. ordered by position that may have different types. and still be completely typesafe. You can...
Collection - Map (Associative arrays|Dictionary)

A map is an object that maps keys to values (known as property) Also known as: associative memories” or “associative arrays” dictionary hash table A map cannot contain duplicate keys; each...
Collection - MultiSet (bag or mset)

A multiset (aka bag or mset) is a set with one big difference because it allows for multiple instances of each of its elements (ie duplicate are allowed) This is the same structure that would support...
Collection - Sequence (Ordered)

A sequence is an abstract collection: of non-unique element where order matters - ie (A,B) is not equal to (B,A) non-unique means that it allows duplicate member (the same element/value may occur...
Java - Set (Collection)

This interface is a member of the Java Collections Framework. Set is a collection that cannot contain duplicate elements. This interface models the mathematical set abstraction and is used to represent...
Javascript - Set

The Set interface represents a set data type and works only with primitive type as there is no way to define an object equality function. object Jsdoc Declaration Add/Delete Size Contains...