- Home
- >
- Demorgan’s law – Explanation and Examples

**DeMorganâ€™s Laws – Explanation and Examples**

In set theory, there exists a wide variety of sets. Some of the common types of sets discussed in our previous lessons include finite sets, infinite sets, universal sets, equal sets, and null sets. We also studied multiple set operations in-depth, including set union, set intersection, and set complement.Â

*In set theory, apart from set operations and set types, some certified set laws exist which simplify the set operations. These laws are termed as DeMorganâ€™s laws.Â *

Before diving into the concept of DeMorganâ€™s laws, we recommend you to go through our previous lectures first to solidify your concepts of the set union, set intersection, and set complement.Â

We will be covering the following topics in this article:

- What are DeMorganâ€™s laws?
- Recap of the set union.
- Recap of set intersection.
- Recap of set complement.
- Proof of DeMorganâ€™s laws.
- How to use DeMorganâ€™s laws?
- Examples.
- Practice problems.

Before moving forward, you may consider refreshing your knowledge on the following prerequisites:

**What are DeMorganâ€™s Laws?**

As mentioned above, set theory is an amalgam of set operations and set types. The understanding of these multiple set operations and their inter-relationship can be quite intimidating for young mathematics enthusiasts. Therefore, to better understand and simplify the relationships between multiple set operations, DeMorganâ€™s laws are considered the best tools.

DeMorganâ€™s laws depict the relationship between the three fundamental set operations: the set union, set intersection, and the set complement. Depending on the inter-relationship between the set union and set intersection, two kinds of DeMorganâ€™s laws exist in set theory.Â

These laws are explained below.

**Type 1 DeMorganâ€™s Law:**

*Type 1 DeMorganâ€™s law states that the complement of the union of any two sets say A and B, is equal to the intersection of their complements.Â *

This type of DeMorganâ€™s law inter-relates any two sets’ union with their intersection via set complement operation. Consider any two finite sets, A and B. We can portray the relationship between the union and the intersection of these two sets A and B through the type 1 DeMorganâ€™s law, whose mathematical form is given below:

(A U B)â€™ = Aâ€™ âˆ© Bâ€™

**Type 2 DeMorganâ€™s Law:**

*The second type of DeMorganâ€™s law states that the complement of the intersection of any two sets says A and B, is equal to the union of their complements.Â *

Type 2 DeMorganâ€™s law is opposed to the type 1 law. This law depicts the inter-relationship between the intersection and union of any two sets through set complement operation. Consider any two finite sets, namely A and B. Their intersection can be related to their union via the second type of DeMorganâ€™s law. The mathematical form of this type of law is given below:

(A âˆ© B)â€™ = Aâ€™ U B.â€™

Before we delve into the proofs and examples of DeMorganâ€™s laws, letâ€™s do a quick revision of the fundamental set operations.

**Recap of the Set Union**

Although we have covered the set union’s topic in great detail in our previous lessons, hereâ€™s a quick recap of the set union to save you from any trouble.Â

*The union of any two sets, say A and B, is a joint set containing the elements present in both A and B. The mathematical form of the set union in set theory is given below:*

*A U B*

The union between any two sets is indicated by the symbol â€˜Uâ€™. The concept of union is restricted to two sets and can also be extended to multiple sets joined by the symbol of union. The mathematical form of the union of multiple sets is given below:

A U B U C U D…

We can express the union between any two sets in pictorial form with Venn Diagrams’ aid. The union between any two sets, say A and B, is portrayed by shading the entire region of sets A and B. The Venn diagram for the union set operation between two sets A and B is given below:

Letâ€™s solve an example to strengthen our concept of the set union.Â

*Example 1*

Consider the following two sets:

A = {5, 10, 15, 20}

B = {10, 20, 30, 40}

Find their union and draw the respective Venn diagram.

Solution

The union between the two sets A and B is given as:

A U B

The union is given as:

A U B = {5, 10, 15, 20} U {10, 20, 30, 40}

A U B = {5, 10, 15, 20, 30, 40}

This is the union of the two sets A and B.Â

The Venn diagram representation of their union is shown below:

The entire shaded region shows the union of the two sets, A and B.Â

**Recap of the Set Intersection**

Much like the set union, we have also covered the topic of set intersection in great depth in our previous lessons. However, in this article, we will only be focussing on the quick recap of set intersection.Â

*The intersection of any two sets, say A and B, are the common elements in both sets A and B. The mathematical form of the intersection between two sets, A and B, is given below:*

A âˆ© B

The intersection between two sets is opposite to the union. The union between the sets concentrates on both sets’ joint elements, but the intersection, on the other hand, is restricted to only the common elements between the sets.Â

The symbol of intersection in set theory is given as â€˜âˆ©â€™. The intersection operation is not only limited to two sets but can also be extended to multiple sets. The intersection between multiple sets is given as:

A âˆ© B âˆ© C âˆ© Dâ€¦

The intersection between any two sets, namely A and B, is depicted through Venn diagrams. The intersection between sets A and B is portrayed through the shaded region shared by the two sets A and B. The Venn diagram for the intersection operation is given below:

Letâ€™s solve the same example to solidify our concept of set intersection.Â

*Example 2*

Consider the following two sets:

A = {5, 10, 15, 20}

B = {10, 20, 30, 40}

Find their intersection and draw the respective Venn diagram.

Solution

The intersection between two sets A and B is given as:

A âˆ© B

The intersection is given as:

A âˆ© B = {5, 10, 15, 20} âˆ© {10, 20, 30, 40}

A âˆ© B = {10, 20}

This shows the intersection between the two sets, A and B.

The Venn diagram representation of their intersection is given below:

The shaded region shows the intersection of the two sets, A and B.Â

**Recap of the Set ComplementÂ **

The complement of a set is another vital set operation whose understanding is mandatory to understand the concept of DeMorganâ€™s laws. As we have extensively covered this topic before, we will only dive into the quick recap of this article’s set complement.Â

*The complement of the set, letâ€™s assume a set A, is defined as the difference between the universal set and the set A itself.Â *

In the set theory realm, the universal set is the fundamental parent set, and all the other sets are the subsets of the universal set. The common notation for the universal set is denoted by the symbol â€˜Uâ€™.Â

The difference between sets works like the mathematical operation of subtraction. The difference between any two sets, say A and B, is denoted by the subtraction sign. The mathematical expression of difference is given below:

A âˆ’ B

Coming back to the definition of the set’s complement, it is the difference between the universal set and the set itself. It is denoted either by the symbol ( â€˜ ). The mathematical expression for the complement of the set is given as:

Aâ€™ = U âˆ’ A

We can also denote the complement of the set through the Venn diagram. The rectangular region shows the universal set U and the circular region shows the set A. The shaded region indicates the complement of A. The Venn diagram of the complement of a set is shown below:

Letâ€™s solve an example to solidify the concept of the complement of a set.

*Example 3*

Find the complement of a set A = {5, 10, 15, 20} where the universal set is U = {x:x is a multiple of 5 and x<100}. Show the complement through the Venn diagram.Â

Solution

To solve this, letâ€™s first simplify the sets. We can simplify the universal set as:

U = {5, 10, 15, 20, 25, â€¦, 100}

The complement of the set A is given as:

Aâ€™ = U âˆ’ A

Aâ€™ = {5, 10, 15, 20, 25, â€¦, 100} âˆ’ {5, 10, 15, 20}

Aâ€™ = {25, 30, 35, 40, â€¦, 100}

Where Aâ€™ denoted the complement of A.Â

The Venn diagram for the complement of the set is given as:

The shaded region indicates the complement of A.Â

Now that we have revised our concepts of the set union, set intersection, and the set complement, letâ€™s move onto the proofs of DeMorganâ€™s laws.

**Proof of the DeMorganâ€™s Laws**

DeMorganâ€™s laws form the foundation of the inter-relation amongst the set operations in set theory. As stated above, the set operations involved in DeMorganâ€™s laws include union, intersection, and complement, so understanding these three set operations in a single mathematical statement can be overwhelming for the young mathematics fanatics. Therefore, it is necessary to evaluate these laws’ proofs for their ease and for developing a simplified understanding of DeMorganâ€™s laws.Â

Earlier, we divided DeMorganâ€™s laws into two types based on the inter-relation of union and intersection or vice versa. An easier approach for understanding the proofs is to evaluate the proofs individually for both the types of DeMorganâ€™s laws. That being said, letâ€™s get right to the proofs.Â

There are two approaches to proving DeMorganâ€™s laws. One of them is the mathematical approach, and the other is the Venn Diagram approach. We will be evaluating the proofs of DeMorganâ€™s laws through both these approaches.Â

**Proof of Type 1 of DeMorganâ€™s Law**

*Type 1 of DeMorganâ€™s law depicts the inter-relation between the union of any two sets with their intersection through set complement operation. Type 1 states that the complement of the union of any two sets, namely A and B, is equal to the intersection of their complements.Â *

The mathematical expression for the type 1 of DeMorganâ€™s law is given as:

(A U B)â€™ = Aâ€™ âˆ© B.â€™

We will evaluate the proof through both the mathematical approach and the Venn diagram approach. Letâ€™s first assess the proof through the mathematical approach.Â

**Mathematical Approach:Â **

For the mathematical approach, we will first consider the left-hand side, which is:

(A U B)â€™

Firstly, we will assume that there exists an element z in (A U B)â€™.Â

Mathematically, we can state this assumption as:

z âˆˆ (A U B)â€™Â

Based on the above assumption, we can state the following relations for the element z:

z âˆ‰ (A U B)

And,Â

z âˆ‰ AÂ

Also,Â

z âˆ‰ B

Excluding these relations, the only possibilities that exist for the element z are:

z âˆˆ Aâ€™

And,Â

z âˆˆ Bâ€™

Since z is an element of the complement of A and the complement of B, therefore we can state the following:

z âˆˆ Aâ€™ âˆ© B.â€™

Where Aâ€™ âˆ© Bâ€™ is the right-hand side.Â

Now, as z is both the member of the left-hand side and the right-hand side, hence:

(A U B)â€™ = Aâ€™ âˆ© B.â€™

Hence, this mathematically proves type 1 of DeMorganâ€™s laws.Â

Now letâ€™s consider the Venn Diagram approach.Â

**Venn Diagram Approach:**

Again, we will first proceed with the left-hand side, which is given as:

(A U B)â€™

Consider two sets, A and B. The Venn diagram for their union, (A U B) is given by the shaded region, which is shown below:

Similarly, the complement of their union, (A U B)â€™, will include all the region except A and B’s union. We can see this in the following Venn diagram:

Now, letâ€™s consider the right-hand side, which is given as:

Aâ€™ âˆ© Bâ€™

The right-hand side can be divided into three segments; one is portraying Aâ€™, the other showing Bâ€™, and finally, the third one indicating Aâ€™ âˆ© Bâ€™.

Letâ€™s first consider the first two segments.Â

The Venn diagram for Aâ€™ is given by the shaded region, as shown below:

Similarly, the Venn diagram showing Bâ€™ is indicated by the shaded region, as shown below:

Finally, the intersection of the complements of A and B is depicted through the shaded region shown below, which is the universal set:

Since the Venn diagrams for the left-hand side and the right-hand side are the same, hence:

(A U B)â€™ = Aâ€™ âˆ© B.â€™

Letâ€™s solve an example for a better understanding of type 1 of DeMorganâ€™s laws.

*Example 4*

Let set U = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, set A = {2, 4, 6, 8}, and set B = {1, 3, 5, 7, 9}. Prove the type 1 of DeMorganâ€™s laws.

Solution

Type 1 of DeMorganâ€™s law is given as:

(A U B)â€™ = Aâ€™ âˆ© B.â€™

We will evaluate both the left-hand side and the right-hand side separately.Â

*Left-Hand Side:*

(A U B)â€™Â

The union is given as:

A U B = {2, 4, 6, 8} U {1, 3, 5, 7, 9}

A U B = {1, 2, 3, 4, 5, 6, 7, 8, 9}

The complement of the union is given as:

(A U B)â€™ = ({1, 2, 3, 4, 5, 6, 7, 8, 9})â€™

(A U B)â€™ = U âˆ’ (A U B)

(A U B)â€™ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} âˆ’ {1, 2, 3, 4, 5, 6, 7, 8, 9}

**(A U B)â€™ = {0, 10}**

Now, letâ€™s evaluate the right-hand side.

*Right-Hand Side:*

The right-hand side is given as:

Aâ€™ âˆ© Bâ€™

First, letâ€™s find the complements.

The complement of A is:

Aâ€™ = U âˆ’ A

Aâ€™ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} âˆ’ {2, 4, 6, 8}

Aâ€™ = {0, 1, 3, 5, 7, 9, 10}

The complement of B is:

Bâ€™ = U âˆ’ B

Bâ€™ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} âˆ’ {1, 3, 5, 7, 9}

Bâ€™ = {0, 2, 4, 6, 8, 10}

Now, Aâ€™ âˆ© Bâ€™ is given as:

Aâ€™ âˆ© Bâ€™ = {0, 1, 3, 5, 7, 9, 10} âˆ© {0, 2, 4, 6, 8, 10}

**Aâ€™ âˆ© Bâ€™ = {0, 10}**

This proves that left-hand side = right-hand side and hence:

(A U B)â€™ = Aâ€™ âˆ© B.â€™

**Proof of Type 2 of DeMorganâ€™s Law**

** Type 2 of DeMorganâ€™s law portrays the inter-relation between the intersection of any two sets with their union through set complement operation. Type 2 states that the complement of the intersection of any two sets, namely A and B, is equal to the union of their complements.**Â

The mathematical expression for the type 2 of DeMorganâ€™s law is given as:

(A âˆ© B)â€™ = Aâ€™ U B.â€™

We will evaluate the proof through both the mathematical approach and the Venn diagram approach. Letâ€™s first assess the proof through the mathematical approach.Â

**Mathematical Approach:Â **

Following the same procedure and the steps we conducted above for type 1, letâ€™s first take the left-hand side, which is given as:

(A âˆ© B)â€™Â

Firstly, letâ€™s make the same assumption we made before. Consider an element y which exists in (A âˆ© B)â€™. Mathematically, we can write this as:

y âˆˆ (A âˆ© B)â€™Â

Based on this assumption, we can exclude the following relations for the element y:

y âˆ‰ (A âˆ© B)

And,Â

y âˆ‰ A

Also,Â

y âˆ‰ B

Excluding these relations, the only possibilities that exist for the element y are:

y âˆˆ Aâ€™

And,Â

y âˆˆ Bâ€™

Since z is an element of the complement of A and the complement of B, therefore we can state the following:

z âˆˆ Aâ€™ U B.â€™

Where Aâ€™ U Bâ€™ is the right-hand side.Â

Now, as y is both the member of the left-hand side and the right-hand side, hence:

(A âˆ© B)â€™ = Aâ€™ U B.â€™

Hence, this mathematically proves type 2 of DeMorganâ€™s laws.Â

Now letâ€™s consider the Venn Diagram approach.Â

**Venn Diagram Approach:**

Again, we will first proceed with the left-hand side, which is given as:

(A âˆ© B)â€™Â

Consider any two finite sets, A and B. Their intersection, (A âˆ© B),Â is given by the shaded region, which is given as follows:

Similarly, the complement of their intersection (A âˆ© B)â€™ is showcased by the shaded region, as shown below:

Now, letâ€™s consider the right-hand side, which is given asÂ Aâ€™ U Bâ€™.

The right-hand side can be divided into three segments; one is showing Aâ€™, the other indicating Bâ€™, and the third one showcasingÂ Aâ€™ U Bâ€™.Â

The complement of A, Aâ€™ is indicated by the shaded region, which is shown below:

Similarly, the complement of B, Bâ€™ is shown by the shaded region given below:

And finally, the union of the complement, Aâ€™ U Bâ€™, is given by the shaded region indicated as:

Since the Venn diagrams for the left-hand side and the right-hand side are the same, hence:

(A âˆ© B)â€™ = Aâ€™ U B.â€™

Letâ€™s solve the same example for a better understanding of type 2 of DeMorganâ€™s laws.

*Example 5*

Let set U = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, set A = {2, 4, 6, 8}, and set B = {1, 3, 5, 7, 9}. Prove the type 2 of DeMorganâ€™s laws.

Solution

Type 2 of DeMorganâ€™s law is given as:

(A âˆ© B)â€™ = Aâ€™ U B.â€™

We will evaluate both the left-hand side and the right-hand side separately.Â

*Left-Hand Side:*

(A âˆ© B)â€™Â

Letâ€™s first the intersection of A and B given as:

(A âˆ© B)

So,Â

(A âˆ© B) = {2, 4, 6, 8} âˆ© {1, 3, 5, 7, 9}

(A âˆ© B) = â²ª

Now, letâ€™s find the complement of the intersection, which is given as:

(A âˆ© B)â€™ = U âˆ’ (A âˆ© B)

(A âˆ© B)â€™ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} âˆ’ {â²ª}

**(A âˆ© B)â€™ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}**

Now, letâ€™s evaluate the right-hand side.

*Right-Hand Side:*

Aâ€™ U Bâ€™

Letâ€™s first find the complements:

The complement of A is:

Aâ€™ = U âˆ’ A

Aâ€™ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} âˆ’ {2, 4, 6, 8}

Aâ€™ = {0, 1, 3, 5, 7, 9, 10}

The complement of B is:

Bâ€™ = U âˆ’ B

Bâ€™ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} âˆ’ {1, 3, 5, 7, 9}

Bâ€™ = {0, 2, 4, 6, 8, 10}

Now, the union of the complements is given as:

Aâ€™ U Bâ€™ = {0, 1, 3, 5, 7, 9, 10} U {0, 2, 4, 6, 8, 10}

**Aâ€™ U Bâ€™ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}**

This proves that left-hand side = right-hand side and hence:

(A âˆ© B)â€™ = Aâ€™ U B.â€™

**How to use DeMorganâ€™s Laws?**

Now that we have developed a firm understanding of DeMorganâ€™s laws, the next question arises, how and when to use them?Â

You can use DeMorganâ€™s laws whenever finding the inter-relations between the multiple set operations. DeMorganâ€™s laws can be beneficial in that case. In some literature, these laws are also termed the â€˜complement laws.â€™ Both are the same. The only difference is in their terms.Â

The two examples solved above can be taken as a sample for solving DeMorganâ€™s laws. However, for further strengthening the concept, consider the following practice problems.

### Practice Problems

- Let U = {set of alphabets} and let there be two sets A and B given as A = {set of vowels} and B = {set of constants}. Mathematically prove the type 1 DeMorganâ€™s law.
- Prove the above question through the Venn diagram as well.
- Consider 3 sets given as U = {x:x is a multiple of 10 and x<50}, A = {y:y is a multiple of 2 and y<20} and B = {z:z is a multiple of 3 and z< 30}. Mathematically prove the type 2 DeMorganâ€™s law.
- Prove the above question through the Venn diagram as well.
- Think of a problem that inter-relates both intersection and union of sets.Â

## Answers

- (A U B)â€™ = Aâ€™ âˆ© Bâ€™Â [True]
- (A U B)â€™ = Aâ€™ âˆ© Bâ€™Â [True]
- (A âˆ© B)â€™ = Aâ€™ U B.â€™ [True]
- (A âˆ© B)â€™ = Aâ€™ U B.â€™ [True]
- DeMorgan’s lawsÂ