- Related Questions & Answers
- What is a Stream and what are the types of Streams and classes in Java?
- Why does Java strictly specify the range and behavior of its primitive types?
- List out the default values of numeric and non-numeric primitive data types in Java?
- How to convert JavaScript objects to primitive data types manually?
- How many types of selection modes for a JList in Java?
- What is a LayoutManager and types of LayoutManager in Java?
- How many types of JDialog boxes can be created in Java?
- What are the different types of JOptionPane dialogs in Java?
- What does immutable mean? Which Python types are mutable and which are not?
- What are the different types of nested classes are defined in Java?
- How many types of inheritance are there in Python?
- How many types of anonymous inner classes are defined in Java?
- What are the different types of classes in Java?
- What are the types of tags involved in javascript?
- What types of logical operators are in javascript?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Sets can be classified into many types. Some of which are finite, infinite, subset, universal, proper, singleton set, etc.

A set which contains a definite number of elements is called a finite set.

**Example** − S = { x | x ∈ N and 70 > x > 50 }

A set which contains infinite number of elements is called an infinite set.

**Example** − S = { x | x ∈ N and x > 10 }

A set X is a subset of set Y (Written as X ⊆ Y) if every element of X is an element of set Y.

**Example 1** − Let, X = { 1, 2, 3, 4, 5, 6 } and Y = { 1, 2 }. Here set Y is a subset of set X as all the elements of set Y is in set X. Hence, we can write Y ⊆ X.

**Example 2** − Let, X = { 1, 2, 3 } and Y = { 1, 2, 3 }. Here set Y is a subset (Not a proper subset) of set X as all the elements of set Y is in set X. Hence, we can write Y ⊆ X.

The term “proper subset” can be defined as “subset of but not equal to”. A Set X is a proper subset of set Y (Written as X ⊂ Y ) if every element of X is an element of set Y and $|X| < |Y|.

**Example** − Let, X = { 1, 2, 3, 4, 5, 6 } and Y = { 1, 2 }. Here set Y ⊂ **X** since all elements in **X** are contained in **X** too and **X** has at least one element is more than set **Y**.

It is a collection of all elements in a particular context or application. All the sets in that context or application are essentially subsets of this universal set. Universal sets are represented as **U**.

**Example** − We may define U as the set of all animals on earth. In this case, set of all mammals is a subset of U, set of all fishes is a subset of **U**, set of all insects is a subset of **U**, and so on.

An empty set contains no elements. It is denoted by ∅. As the number of elements in an empty set is finite, empty set is a finite set. The cardinality of empty set or null set is zero.

**Example** − S = { x | x ∈ N and 7 < x < 8 } = ∅

Singleton set or unit set contains only one element. A singleton set is denoted by { s }.

**Example** − S = { x | x ∈ N, 7 < x < 9 } = { 8 }

If two sets contain the same elements they are said to be equal.

**Example** − If A = { 1, 2, 6 } and B = { 6, 1, 2 }, they are equal as every element of set A is an element of set B and every element of set B is an element of set A.

If the cardinalities of two sets are same, they are called equivalent sets.

**Example** − If A = { 1, 2, 6 } and B = { 16, 17, 22 }, they are equivalent as cardinality of A is equal to the cardinality of B. i.e. |A| = |B| = 3

Two sets that have at least one common element are called overlapping sets.

In case of overlapping sets −

n(A ∪ B) = n(A) + n(B) - n(A ∩ B)

n(A ∪ B) = n(A - B) + n(B - A) + n(A ∩ B)

n(A) = n(A - B) + n(A ∩ B)

n(B) = n(B - A) + n(A ∩ B)

**Example** − Let, A = { 1, 2, 6 } and B = { 6, 12, 42 }. There is a common element ‘6’, hence these sets are overlapping sets.

Two sets A and B are called disjoint sets if they do not have even one element in common. Therefore, disjoint sets have the following properties −

n(A ∩ B) = ∅

n(A ∪ B) = n(A) + n(B)

**Example** − Let, A = { 1, 2, 6 } and B = { 7, 9, 14 }, there is not a single common element, hence these sets are overlapping sets.

Advertisements