# Crisp set operations – Explained with example

## Crisp set operations

We can perform a wide range of operations on a crisp set. Before you explore the operations of the crisp set, it is recommended to understand what a crisp set is.

**Suggested Reading:** Introduction to Crisp Sets

Let us understand various operations on set with the help of examples. We will consider the following data to execute various operations:

X = {1, 2, 3, 4, 5, 6, 7, 8, 9}

A = {1, 2, 3, 4, 5}

B = {3, 4, 5, 6}

C = {6, 7, 8, 9}

## Union

Union of sets is the collection of all the elements which are either in A **or** in B. Common elements from both sets are considered only once. Mathematically, we can represent union operation as follow:

A âĒ B = { x | x â A **or** x â B }

For the given data

A âĒ B = {1, 2, 3, 4, 5, 6}

Graphically, we can describe union operation as shown below. The grey region represents the output of the operation.

If there are *n* sets, called A_{1}, A_{2}, A_{3}, …, A_{n}, we can find the union of all by taking **unique elements **from each set, i.e. A = A_{1} âĒ A_{2} âĒ A_{3} âĒ … âĒ A_{n}

In shortened notation,

\[ A = \bigcup_{i=1}^{n} A_i \]

## Intersection

The intersection of sets is the collection of all the common elements from sets A **and **B. Mathematically, we can represent union operation as follow:

A âŠ B = { x | x â A **and** x â B }

For the given data

A âŠ B = {3, 4, 5}

Graphically, we can describe intersection operation as shown below. The grey region represents the output of the operation.

If there are *n* sets, called A_{1}, A_{2}, A_{3}, …, A_{n}, we can find the intersection of all by taking **common elements **from each set, i.e. A = A_{1} âŠ A_{2} âŠ A_{3} âŠ … âŠ A_{n}

In shortened notation,

\[ A = \bigcap_{i=1}^{n} A_i \]

## Complement

Complement operation is always represented with respect to some set. If complement is performed with respect to a universal set, then it is called **absolute complement**.

The complement of set A is a collection of all the elements which are **not in** A but are in the universal set.

Mathematically,

A’ = A^{c} = X – A = { x | x â X **and **x â A }

The complement of set A is often represented as A’ or A^{c} or \[ \bar{A} \]. We will be using any notation interchangeably in our discussion.

For the given data

A’ = {6, 7, 8, 9}

Graphically, we can describe the complement operation as shown below. The grey region represents the output of the operation.

## Difference

The difference between set A with respect to set B is the collection of all the elements in A but not in B. It is also known as a **relative complement**.

Here the reference set is not the universal set, rather it is some set derived from the universe of discourse

Mathematically,

A – B = { x | x â A **and** x â B }

For the given data

A – B = {1, 2}

Graphically, difference operation can be represented as,

## De Morgan’s Law

De Morgan’s law is very popular in set operations and it is quite useful in simplifying many complex computations. It is also useful in reducing the process of some proof techniques. De Morgan’s law enjoys a special place in crisp set operations. There are two laws of De Morgan.

**Law 1: ** (A âĒ B)’ = A’ âŠ B’

For the given data:

A âĒ B = {1, 2, 3, 4, 5, 6}

(A âĒ B)’ = {7, 8, 9} â LHS

A’ = {6, 7, 8, 9}

B’ = {1, 2, 7, 8, 9}

A’ âŠ B’ = {7, 8, 9} â RHS

Graphically,

**Law 2: ** (A âŠ B)’ = A’ âĒ B’

For the given data:

A âŠ B={3, 4, 5}

(A âŠ B)’ = {1, 2, 6, 7, 8, 9} â LHS

A’ = {6, 7, 8, 9}

B’ = {1, 2, 7, 8, 9}

A’ âĒ B’ = {1, 2, 6, 7, 8, 9} â RHS

Graphically,

The following video summarizes the various crisp set operations.

## Watch on YouTube: operations on a crisp set

## Disjoint sets:

Two sets A and B are said to be disjoint, if they do not have any common element in them, i.e. A âŠ B = { }. For sets

A = Set of even numbers = {2, 4, 6, 8, …} and

B = Set of odd numbers = {1, 3, 5, 7, …}

A âŠ B = { }, so here A and B are disjoint sets

Graphically, it can be represented as,

## Partition of the set

If we consider the country as a universal set, each state represents one set such that all sets are disjoint and the union of all those sets forms a universal set. Let A_{1}, A_{2}, A_{3}, …, A_{n} represent the n states in the country and set A represents the country.

As per the definition,

\[ \bigcup_{i=1}^{n} A_i = A \]

Each A_{i} is called a partition of set A

Graphically,

## Test Your Knowledge:

Consider the use case of a university, in which a class is having 10 students. University is to offer elective subjects to the students. The instructor got following response from the students:

A represents the enrollment number of students who chose Image Processing

B represents the enrollment number of students who chose Machine Learning

C represents the enrollment number of students who chose Cloud computing

Let,

A = {1, 4, 7, 9}

B = {2, 5, 7, 9}

C = {1, 6, 8, 9}

Perform various crisp set operations and find the elements of the following sets:

x_{1} = {Set of students who either Image Processing or Machine Learning }

x_{2} = {Set of students who do not select Machine Learning }

x_{3} = {Set of students who selected all three subjects }

x_{4} = {Set of students who selected at least any one subject }

x_{5} = {Set of students who did not select any subject }

**Please post your answers / queries / feedback in comment box below !**

Understandable material… !!

Noted with thanks

Comprehensible content and nicely explained

Appreciated your inputs

x1={1,2,4,5}

x1 = {1, 2, 4, 5, 7, 9}. Union includes elements from both the sets.

x2= {1,3,4,6,8,10}

Absolutely correct Smita

X3 = {9}

X4 = {2,4,5,6,8}

X5 = {10}

x3 is right

x4 = {1, 2, 4, 5, 6, 7, 8, 9}: Any one subject indicates union of all three sets

x5 = {3, 10} : These two students does not appear anywhere in any of the list