Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • GATE 2026 Prep
    • Get 3 IBM Certifications
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • Data Analytics Training
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation with DSA
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science & ML Program
    • All Courses
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • GATE
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Practice Coding Problems
    • GfG 160: Free DSA Practice
    • Problem of the Day
    • ETS TOEFL: Scholarship Contest
    • All Contests and Events
  • Jobs
    • Become a Mentor
    • Apply Now!
    • Post Jobs
    • Job-A-Thon: Hiring Challenge
  • Notifications

    Mark all as read
    All
    View All
    Notifications
    Mark all as read
    All
    Unread
    Read
    You're all caught up!!
  • Number System and Arithmetic
  • Algebra
  • Set Theory
  • Probability
  • Statistics
  • Geometry
  • Calculus
  • Logarithms
  • Mensuration
  • Matrices
  • Trigonometry
  • Mathematics
Open In App
  • Explore GfG Courses
  • Share Your Experiences
  • Set TheorySet Theory Formulas

    Representation of Set

    Representation of a SetSet-Builder Notation

    Types of Set

    Types Of SetsEmpty SetDisjoint SetsFinite SetsUniversal SetsSubsets in Maths

    Operation on Sets

    Set OperationsUnion of SetsIntersection of SetsDifference of SetsComplement of a Set
    Cartesian Product of Sets

    Application of Set

    De Morgan's Law - Theorem, Proofs, Formula & Examples
  • DSA to Development Course

Complement of a Set

Last Updated : 06 Jun, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

In mathematics, a set is a collection or grouping of well-defined objects. All such objects, when grouped in a set, are called elements. Sets are represented by capital letter symbols, and the elements are placed together in a curly bracket {}.

For example, if W is the set of whole numbers, then W = {0, 1, 2, 3, 4, 5,....,∞}.

In this article, we will learn about a particular aspect of set theory that is the complement of a set, its meaning, symbol, properties, and Venn diagram.

Complement-of-Set

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. The complement of a set S is mathematically expressed as:

S' = {x ∈ U and x ∉ S}
Where x denotes the elements in Universal Set, U but not in S.

For example, let S be the set of all Android mobiles, which is a subset of the universal set of all mobiles in the world. In this case, the complement of set S would be the set of all non-Android mobile phones (which would include iOS, Windows, and other operating systems), as these do not consist of Android mobile phones.

Mathematical Definition- Complement of a Set

If U is a universal set and A be any subset of U then the complement of A is the set of all members of the universal set U which are not the elements of A.

Mathematically Complement of a set  can be expressed in the  following form:

  • S' = U - S
  • S' = {x ∈ U : x ∉ S}

Symbol of Complement of a Set

The complements of sets A, B, C... are denoted as A', B', C',... and so on. Excluding all the elements of a given set from the universal set gives us the complement of that set. 

Venn Diagram of Complement of a Set

The following Venn diagram shows the universal set U and its two subsets- A and A'. The green-shaded portion represents set A and the red portion depicts set A'. As is clear from the diagram, set A is not part of A' and vice-versa. This implies that A and A' are both disjoint sets or complements of each-other.

Venn Diagram of Complement of Set

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. This is shown in the example below.

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 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}.


Next Article
Cartesian Product of Sets

P

prabhjotkushparmar
Improve
Article Tags :
  • Mathematics
  • School Learning
  • Class 10
  • Maths-Class-10
course-img
631k+ interested Geeks
DSA to Development: A Complete Guide
course-img
470k+ interested Geeks
Complete Machine Learning & Data Science Program
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • Careers
  • In Media
  • Contact Us
  • Corporate Solution
  • Campus Training Program
  • Explore
  • Job-A-Thon
  • Offline Classroom Program
  • DSA in JAVA/C++
  • Master System Design
  • Master CP
  • Videos
  • Tutorials
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • DSA Interview Questions
  • Competitive Programming
  • Data Science & ML
  • Data Science With Python
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • NodeJs
  • Bootstrap
  • Tailwind CSS
  • Python Tutorial
  • Python Examples
  • Django Tutorial
  • Python Projects
  • Python Tkinter
  • Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Computer Science
  • GATE CS Notes
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • DevOps
  • Git
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Databases
  • SQL
  • MYSQL
  • PostgreSQL
  • PL/SQL
  • MongoDB
  • Preparation Corner
  • Company-Wise Recruitment Process
  • Aptitude Preparation
  • Puzzles
  • Company-Wise Preparation
  • More Tutorials
  • Software Development
  • Software Testing
  • Product Management
  • Project Management
  • Linux
  • Excel
  • All Cheat Sheets
  • Courses
  • IBM Certification Courses
  • DSA and Placements
  • Web Development
  • Data Science
  • Programming Languages
  • DevOps & Cloud
  • Programming Languages
  • C Programming with Data Structures
  • C++ Programming Course
  • Java Programming Course
  • Python Full Course
  • Clouds/Devops
  • DevOps Engineering
  • AWS Solutions Architect Certification
  • Salesforce Certified Administrator Course
  • GATE 2026
  • GATE CS Rank Booster
  • GATE DA Rank Booster
  • GATE CS & IT Course - 2026
  • GATE DA Course 2026
  • GATE Rank Predictor
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences