## 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 A1, A2, A3, …, An, we can find the union of all by taking unique elements from each set, i.e. A = A1 âˆª A2 âˆª A3 âˆª … âˆª An

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 A1, A2, A3, …, An, we can find the intersection of all by taking common elements from each set, i.e. A = A1 âˆ© A2 âˆ© A3 âˆ© … âˆ© An

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’ = Ac = X – A = { x | x âˆˆ X and x âˆ‰ A }

Complement of set A is often represented as A’ or Ac 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)’ = {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.

## 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 A1, A2, A3, …, An 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 Ai is called partition of set A

Graphically,

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:

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

x2 = {Set of students who does not selected Machine Learning }

x3 = {Set of students who selected all three subjects }

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

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