Sets & relations formulas
Sets, relations, functions, partial orders and lattices. 24 formulas for GATE CS Discrete Mathematics, each with when to use it. Each is explained in the topic notes.
IAE Academy: Sets, relations, functions, partial orders and lattices formulas (GATE CS)
All 24 Sets & relations formulas
SIZE OF THE POWER SET
For a finite set A; each element is either in or out of a subset.
SIZE OF A CARTESIAN PRODUCT
Finite sets. A relation from A to B is any subset of A × B, so there are of them.
INCLUSION-EXCLUSION FOR TWO SETS
Finite sets; this is the basis of Venn-diagram counting.
INCLUSION-EXCLUSION FOR THREE SETS
Finite sets; add singles, subtract pairs, add the triple.
SIZE OF THE SYMMETRIC DIFFERENCE
Finite sets.
ALL RELATIONS ON AN N-ELEMENT SET
Each of the ordered pairs is in or out.
REFLEXIVE RELATIONS
The n diagonal pairs are forced; the other are free. Irreflexive relations have the same count.
NEITHER REFLEXIVE NOR IRREFLEXIVE
For , where no relation is both reflexive and irreflexive: subtract the reflexive and the irreflexive relations from all relations.
SYMMETRIC RELATIONS
Choose freely for each of the diagonal pairs and each of the unordered pairs with .
ANTISYMMETRIC RELATIONS
Diagonal pairs are free (); each unordered pair with has 3 choices: none, only, only.
ASYMMETRIC RELATIONS
Diagonal pairs are excluded; each unordered pair has the same 3 choices. Reflexive and antisymmetric relations have the same count (diagonal forced in instead of out).
REFLEXIVE AND SYMMETRIC RELATIONS
Diagonal forced to 1; each unordered pair with is in or out. Irreflexive and symmetric relations have the same count.
RELATIONS BOTH SYMMETRIC AND ANTISYMMETRIC
Such a relation is a subset of the identity relation, so only the diagonal pairs are free.
EQUIVALENCE RELATIONS ON N ELEMENTS
(Bell number) counts partitions of an n-element set; (Stirling number of the second kind) counts partitions into exactly non-empty blocks.
RECURRENCES FOR BELL AND STIRLING NUMBERS
With for , and .
PARTITIONS INTO TWO BLOCKS
For : the number of equivalence relations on n elements with exactly two classes.
ALL FUNCTIONS FROM A TO B
Each element of independently picks an image.
INJECTIVE FUNCTIONS
, , ; when there are none (the product form gives 0).
BIJECTIONS BETWEEN SETS OF EQUAL SIZE
; this is also the number of permutations of an n-set.
SURJECTIVE FUNCTIONS (INCLUSION-EXCLUSION)
, ; zero when .
PARTIAL FUNCTIONS FROM A TO B
, ; each element of maps to one of the elements or is left undefined.
SUBSETS OF AN N-SET ORDERED BY INCLUSION
Poset with : is covered by for each .
DIVISIBILITY ON THE DIVISORS OF N
Poset of positive divisors under 'divides' ( distinct primes); join is lcm and meet is gcd.
HASSE DIAGRAM EDGES FOR THE DIVISORS OF N
; is covered by whenever divides . For : .
Where this was asked: 2018 (1), 2020 (1), 2023 (1), 2024 (2), 2025 (2), 2026 (1). See the 8 previous-year questions on Sets & relations. This shows what was asked, not what will be asked.