VOOZH about

URL: https://www.geeksforgeeks.org/maths/complement-of-a-set/

⇱ Complement of a Set - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Complement of a Set

Last Updated : 1 Oct, 2025

The complement of a set is the set that consists of all the elements from the universal set that are not already included in the given set. In other words, the difference between the universal set and the given set represents the complement of that set.

πŸ‘ frame_3127
Compliment of Set A and B

The complement of a set A is mathematically expressed as:

A' = {x ∈ U and x βˆ‰ A}
Where x denotes the elements in Universal Set, U but not in A.

How to Find the Complement of a Set?

The complement of a set is simply found by excluding the elements of the given set from the universal set.

Example: Find the complement of set S = {4, 8, 12, 16}, where the universal set is all multiples of 4 that are smaller than 50.

Solution:

Step 1: Identify the universal set (U) and the set (S) for which you want to find the complement.
Universal Set(U) = {4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48}

Also, given: S = {4, 8, 12, 16}

Step 2: Calculate the complement of set S by excluding the elements of S from the universal set U i.e., S' = U - S.
S' = U - S = {4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48} - {4, 8, 12, 16}

Step 3: Simplify the resulting set to obtain the complement.
Thus, S' = {20, 24, 28, 32, 36, 40, 44, 48}

Properties of Complement of a Set

There are various properties of the Complement of a Set; some of these properties are discussed as follows:

Complement Laws

  • The union of set S and its complement set S' is the universal set, i.e., S βˆͺ S’ = U.

Example: If U = {10, 11, 12, 13, 14} and S = {10, 11, 12}; then S' = {13, 14}.

  • The intersection of set S and its complement set S' is the null or empty set, i.e., S ∩ S’ = βˆ….

Example: If U = {10, 11, 12, 13, 14} and S = {10, 11, 12}; then S' = {13, 14}.

Now, S ∩ S’ = {10, 11, 12} ∩ {13, 14} = βˆ….

Law of Double Complementation

  • The complement of the complement of a given set is the set itself, i.e., (S')' = S.

Example: If U = {10, 11, 12, 13, 14} and S = {10, 11, 12}; then S' = {13, 14}.

The complement of S' = U - S' = {10, 11, 12} = set S.

Law of Null and Universal Sets

  • The complement of the universal set is an empty set or null set and vice-versa, i.e., βˆ…' = U And U' = βˆ….

Example: If U = {10, 11, 12, 13, 14}; then U' = βˆ… and βˆ…' = U.

De Morgan’s laws

  • The complement of the union of two sets is equal to the intersection of the complements of the two sets, i.e., (S U T)’ = S’ ∩ T’.

Example: If U = {10, 11, 12, 13, 14} and S = {13, 14} and T = {10, 11}.

Now, S βˆͺ T = {10, 11, 13, 14} and (S βˆͺ T)' = {12}.

Thus, S’ ∩ T’ = {10, 11, 12} ∩ {12, 13, 14} = {12} = (S βˆͺ T)'.

  • The complement of the intersection of two sets is equal to the union of the complements of the two sets, i.e., (S ∩ T)’ = S’ U T’.

Example: If U = {10, 11, 12, 13, 14} and S = {13, 14} and T = {10, 11}.

Now, S ∩ T = βˆ… and (S ∩ T)’ = {10, 11, 12, 13, 14}.

Thus, S’ βˆͺ T’ = {10, 11, 12} βˆͺ {12, 13, 14} = {10, 11, 12, 13, 14} = S’ βˆͺ T’.

Solved Examples on Complement of a Set

Learn various Practice Questions on Complement of a Set.

Question 1. If D = { x | x is a multiple of 10, x ∈ N }, find D'.

Solution:

Given: the universal set U = set of all natural numbers = N = {1, 2, 3, 4, 5, 6,....}

Also it is given that: D = { x | x is a multiple of 10, x ∈ N }
β‡’ D = {10, 20, 30, 40, 50, 60,....}
β‡’ D' = U - D

D' = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12,...19, 21, 22,..., 29, 31,.....}.

Question 2. If S and T are any two sets, prove that S' β€“ T' = T – S.

Solution:

S' β€“ T' = T – S is only possible when S' – T' βІ S – T.

Let x ∈ S' – T'
β‡’ x βˆˆ S' and x βˆ‰ T'
β‡’ x βˆ‰ S and x βˆˆ T (since, S ∩ S' = Ο• )
β‡’ x βˆˆ S – T

The above result would be true for all x βˆˆ S' – T'
∴ S' β€“ T' = T – S

Question 3. How many elements are there in the complement of the set of all vowels in the English alphabet?

Solution:

The English alphabet consists of 26 alphabets of which 5 are vowels and 21 are consonants. The difference between the universal set(U) and the set of vowels(say, V) is the complement of the set of all vowels.

Now, n(U) = 26 and n(V) = 5.

Thus, n(V') = n(U) - n(V)
β‡’ n(V') = 26 - 5
β‡’ n(V') = 21

Question 4. If P and Q are two sets, then prove P βˆ© (P' βˆͺ Q') = P βˆ© Q.

Solution:

LHS = P βˆ© (P' βˆͺ Q')
Let us expand the LHS to get: (P βˆ© P’) βˆͺ (P ∩ Q)

Since, P βˆ© P’ = Ο•; our LHS becomes:
LHS = Ο• βˆͺ (P ∩ Q)
β‡’ LHS = P ∩ Q
Thus, LHS = RHS

Hence Proved.

Question 5. If U = {12, 13, 15, 17, 19} and S = {13, 17}, T = {12, 15, 17, 19}, then prove that (S βˆͺ T)' = S' βˆ© T'.

Solution:

LHS = (S βˆͺ T)'. Let us first find S βˆͺ T.
S βˆͺ T = {12, 13, 15, 17, 19} = U
β‡’ (S βˆͺ T)' = U – (S βˆͺ T) = U – U = Ο•.

So, LHS = Ο•.

RHS = S' βˆ© T'
S' = U – S = {12, 15, 19}
and T' = U – T = {13}
β‡’ S' βˆ© T' = {12, 15, 19} ∩ {13} = Ο•
So, RHS = Ο•
Thus, LHS = RHS

Hence Proved.

Question 6. If X and Y are two sets, prove that: X – (X – Y) = X βˆ© Y.

Solution:

According to the De Morgan's Laws, (A βˆͺ B)’ = A’ ∩ B’ and (A βˆ© B) β€˜ = A’ βˆͺ B’.

LHS = X – (X – Y)
β‡’ LHS = X βˆ© (X – Y)'
β‡’ LHS = X ∩ (X ∩ Y')'
β‡’ LHS = X ∩ (X' βˆͺ Y')') ((Y')' = Y)
β‡’ LHS = X βˆ© (X' βˆͺ Y)
β‡’ LHS = (X βˆ© X') βˆͺ (X βˆ© Y)
β‡’ LHS = Ο• βˆͺ (X ∩ Y)
β‡’ LHS = (X βˆ© Y)   [As Ο• βˆͺ A = A]

But, RHS = (X βˆ© Y)
∴ LHS = RHS

Hence Proved.

Practice Questions on Complement of a Set

Question 1: Let A = {1, 2, 3, 4, 5} and the universal set U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Find the complement of A, i.e., A'.

Question 2: If M = {a, b, c, d} and N = {c, d, e, f}, prove that: (M βˆͺ N)' = M' ∩ N'.

Question 3: The universal set U consists of all positive integers less than or equal to 20. If A = {2, 4, 6, 8, 10} and B = {1, 2, 3, 4, 5, 6}, find the complement of A ∩ B.

Question 4: If X = {3, 5, 7, 9}, Y = {1, 3, 5, 7}, and the universal set U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, find X' – Y.

Question 5: Let U = {10, 20, 30, 40, 50}, P = {20, 40}, and Q = {30, 50}. Find (P βˆͺ Q)'.

Question 6: If A = {2, 4, 6, 8, 10} and B = {1, 2, 3, 4, 5, 6}, find the number of elements in the complement of the union of A and B, i.e., (A βˆͺ B)'.

Question 7: If X = {a, b, c} and Y = {b, c, d}, and the universal set U = {a, b, c, d, e}, find the complement of (X ∩ Y).

Question 8: Prove that: (X ∩ Y)' = X' βˆͺ Y'

Question 9: If A = {1, 3, 5, 7, 9}, B = {2, 4, 6, 8, 10}, and the universal set U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, find A' ∩ B'.

Question 10: If the universal set U = {1, 2, 3, 4, 5, 6}, and A = {2, 3, 4}, find the number of elements in A' and B = {1, 5, 6}.

Comment

Explore