## Crisp set operations

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

**Suggested Reading:** Introduction to Crisp Sets

Let us understand various operations on set with the help of example. We will consider 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 the 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 gray region represents the output of 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

Intersection of sets is the collection of all the common elements from set 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 gray region represents the output of 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 universal set, then it is called **absolute complement**.

Complement of set A is 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 }

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 complement operation as shown below. The gray region represents the output of operation.

## Difference

Difference of set A with respect to set B is collection of all the elements in A but not in B. It is also known as **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 computation. It is also useful in reducing process of some proof techniques. De Morgan’s law enjoys 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,

Following video summarizes the various crisp set operations.

## Watch on YouTube: operations on 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 country as an universal set, each state represents one set such that all sets are disjoint and the union of all those sets forms universal set. Let A_{1}, A_{2}, A_{3}, …, A_{n} represents 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 partition of set A

Graphically,

## Test Your Knowledge:

Consider the use case of university, in which a class is having 10 students. University is to offer elective subjects to the students. 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 following sets:

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

x_{2} = {Set of students who does not selected 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