Sets and Representation of Sets: Number Hierarchy with Worked Examples
Learn how to represent sets, classify numbers, distinguish membership from containment, build a power set and calculate set operations on actual values.
KnowledgeGate Team
Exam prep & CS education

Sets look elementary until one collection appears in words, roster form and set-builder form, or a number must be placed in the correct family. The answer can change if the domain is unclear or the convention for zero is not declared. Use concrete values to check notation, power sets and operations before moving deeper into GATE CS Exam Preparation.
Sets, elements and equality: read the notation precisely
A set is a well-defined collection of distinct objects. If A = {2, 4, 6}, then 4 ∈ A reads as "4 is an element of A", while 5 ∉ A reads as "5 is not an element of A". Braces describe the collection. The surrounding universe must be clear when a condition could select different objects.
Order and repetition do not change a set:
{2, 4, 4, 6} = {6, 4, 2}.
The repeated 4 contributes no new element, so |A| = 3, not 4. Distinguish the empty set ∅ from the singleton {∅}. Their cardinalities are |∅| = 0 and |{∅}| = 1. Two sets are equal when each contains every element of the other, regardless of order or representation.
Representation of sets: verbal, roster, set-builder and interval forms
Take one collection in three forms. In words, E is the set of even integers from -4 through 8. In roster form,
E = {-4, -2, 0, 2, 4, 6, 8}.
In set-builder form,
E = {x ∈ Z | -4 ≤ x ≤ 8 and x is even}.
The condition accepts x = 2 and rejects x = 3. The roster contains seven distinct values, so |E| = 7.
For real numbers, R0 = {x ∈ R | -2 ≤ x < 3} = [-2, 3). The square bracket includes -2, while the round bracket excludes 3. Change only the domain and the result becomes discrete: Z0 = {x ∈ Z | -2 ≤ x < 3} = {-2, -1, 0, 1, 2}.
When converting a representation, fix the domain, test both endpoints and one interior value, then check that no admissible value is missing. Avoid an ellipsis if its rule or stopping point is ambiguous.
Hierarchy of numbers: place each value in its smallest set
Let N = {1, 2, 3, ...} and W = {0, 1, 2, 3, ...}. Therefore,
N ⊂ W ⊂ Z ⊂ Q ⊂ R ⊂ C.
The rational numbers are Q = {p/q | p, q ∈ Z and q ≠ 0}. Every integer is rational because n = n/1. Every real number is complex because r = r + 0i.
The irrational set is I = R \ Q. It is the part of R outside Q, not a rung between Q and R. Thus Q ∩ I = ∅ and Q ∪ I = R.
Value | Smallest set and classification |
|---|---|
5 | N; also in W, Z, Q, R and C |
0 | W under our convention; also in Z, Q, R and C |
-3 | Z; -3 = -3/1 verifies that it is rational |
7/4 | Q; its terminating decimal 1.75 is rational |
√2 | Irrational real, in R \ Q and also in C |
3 + 2i | C, but not R |

Subsets, proper subsets and the power set
Let S = {a, b, c}. The statement X ⊆ S means every element of X belongs to S. The statement X ⊊ S adds the condition X ≠ S. Thus {a, b} ⊊ S, while S ⊆ S is true and S ⊊ S is false.
The complete power set is:
P(S) = {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}.
It contains eight subsets, so |P(S)| = 8 = 2^3. In general, a finite set with n distinct elements has 2^n subsets.
Membership and containment are different. Both a ∈ S and {a} ⊆ S are true, but {a} ∈ S is false because the elements of S are a, b and c, not singleton sets. However, {a} ∈ P(S) is true because {a} is one of S's subsets. Also, ∅ ⊆ S always holds.
Set operations worked on one finite universe
Fix U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Let A = {2, 4, 6, 8, 10}, the even elements of U, and B = {2, 3, 5, 7}, the prime elements of U. Then:
A ∪ B = {2, 3, 4, 5, 6, 7, 8, 10}
A ∩ B = {2}
A \ B = {4, 6, 8, 10}
B \ A = {3, 5, 7}
Aᶜ = {1, 3, 5, 7, 9}, relative to U
Now verify the union by inclusion-exclusion:
|A ∪ B| = |A| + |B| - |A ∩ B| = 5 + 4 - 1 = 8.
This matches the eight listed union elements. The overlap element 2 occurs in both original counts, so it must be subtracted once. After mastering representation changes and the number-system hierarchy, continue to Set Theory and Relations for GATE: Closures and Posets for Cartesian products, closures, equivalence and partial orders.

Worked question patterns: translate the condition before calculating
For F = {x ∈ Z | x² ≤ 10}, compare consecutive squares around the boundary. Since 3² = 9 ≤ 10 but 4² = 16 > 10, the accepted integers run from -3 to 3:
F = {-3, -2, -1, 0, 1, 2, 3}, so |F| = 7.
For D = {x ∈ N | x divides 12}, list the positive divisors in pairs. They are D = {1, 2, 3, 4, 6, 12}, so |D| = 6. Zero is neither in N under our convention nor a positive divisor, and division by zero is undefined.
For inclusion-exclusion, suppose 24 of 40 students study set theory, 18 study logic and 7 study both. Then 24 + 18 - 7 = 35 study at least one, and 40 - 35 = 5 study neither.
Common set and number-hierarchy traps: run a five-check audit
Before accepting an answer, run five checks:
Remove duplicates before counting.
Keep ∈ for membership separate from ⊆ for containment.
Declare whether 0 belongs to N.
Name the universe before taking a complement.
Distinguish interval brackets from set braces.
A radical sign does not automatically mean irrational: √9 = 3 is rational and natural. Similarly, 0.125 = 1/8 and 0.333... = 1/3 are rational. A non-terminating, non-repeating decimal is irrational.
Check the declared domain before deciding which description gives the smallest valid classification.
Sets and number hierarchy: the short version and next step
Solve in this order: identify the universe and domain, translate the representation, remove duplicates, choose ∈ or ⊆ correctly, place each number in its smallest family, then perform the operation. Without looking back, reconstruct E, classify 0, -3, 7/4 and √2, and recompute the A and B Venn regions. Your results should match the exact values above. Do this from memory once. If you want a structured route through the wider syllabus and guided practice, continue with GATE Guidance by Sanchit Sir.
Keep learning
Number Representation Mistakes: Fix Signed Values, Complements and Overflow
The same eight bits can represent 234, −106, −21 or −22. Learn which convention controls the answer, how to preserve values when widening, and when carry-out does not mean signed overflow.
Number Representation in Digital Electronics: Conversions, Complements and Worked Examples
Learn number representation through exact conversions, signed encodings, binary arithmetic, special codes, fixed point and IEEE 754 worked examples.
Number Representation and Floating Point MCQs: 12 solved COA questions
Twelve solved computer organization MCQs for GATE: two's complement, base conversion, IEEE 754 fields, normalization and floating-point precision loss.
TCP Header Fields MCQs: 12 Solved Questions on Sequence Numbers, Windows and Checksums
Solve 12 TCP header questions with the original stems and options, then check clear explanations for fields, sequence space, windows, checksums and payload size.





