Formula Sheet

Sets, Relations & Functions Formulas

All key formulas grouped by subtopic. Each one has a quick reminder and common mistakes to watch for.

10 formulas · 7 subtopics

Union of Two Sets (Inclusion-Exclusion)

#1
n(AB)=n(A)+n(B)n(AB)n(A \cup B) = n(A) + n(B) - n(A \cap B)

💡 For three sets: n(A union B union C) = n(A) + n(B) + n(C) - n(A cap B) - n(B cap C) - n(A cap C) + n(A cap B cap C). Always subtract the pairwise overlaps and add back the triple overlap.

Forgetting to subtract n(A cap B) and double-counting elements in the intersection.

De Morgan's Laws

#2
(AB)=ABand(AB)=AB(A \cup B)' = A' \cap B' \quad \text{and} \quad (A \cap B)' = A' \cup B'

💡 Complement of union is intersection of complements. Complement of intersection is union of complements. These hold for any number of sets.

Swapping the operations: writing (A union B)' = A' union B' instead of A' cap B'.

Reflexive, Symmetric, Transitive Conditions

#3
Reflexive: (a,a)R  aASymmetric: (a,b)R(b,a)RTransitive: (a,b),(b,c)R(a,c)R\text{Reflexive: } (a, a) \in R \; \forall a \in A \quad | \quad \text{Symmetric: } (a,b) \in R \Rightarrow (b,a) \in R \quad | \quad \text{Transitive: } (a,b), (b,c) \in R \Rightarrow (a,c) \in R

💡 Reflexive requires every element to be related to itself. Symmetric requires the relation to work both ways. Transitive requires chains to close. Check each condition independently.

Assuming that a relation with some (a, a) pairs is reflexive. It must hold for ALL elements of the set.

Equivalence Class

#4
[a]={xA:(a,x)R}[a] = \{x \in A : (a, x) \in R\}

💡 The equivalence class of a is the set of all elements related to a. Equivalence classes partition the set into disjoint, exhaustive subsets. Two elements have the same equivalence class if and only if they are related.

One-One (Injective) and Onto (Surjective) Definitions

#5
One-one: f(a)=f(b)a=bOnto: yB,xA s.t. f(x)=y\text{One-one: } f(a) = f(b) \Rightarrow a = b \quad | \quad \text{Onto: } \forall y \in B, \exists x \in A \text{ s.t. } f(x) = y

💡 One-one means no two distinct inputs give the same output. Onto means every element of the codomain is hit. A function that is both one-one and onto is called bijective.

Confusing one-one with onto. One-one is about distinct inputs giving distinct outputs. Onto is about the range equalling the codomain.

Domain of Composite Function

#6
dom(gf)={xdom(f):f(x)dom(g)}\text{dom}(g \circ f) = \{x \in \text{dom}(f) : f(x) \in \text{dom}(g)\}

💡 For g(f(x)) to exist, x must be in the domain of f AND f(x) must be in the domain of g. Always check both conditions.

Computing the domain of g(f(x)) by only checking where g is defined, without verifying that f(x) falls in g's domain.

Inverse Function Existence

#7
f1 exists    f is bijective (one-one and onto)f^{-1} \text{ exists} \iff f \text{ is bijective (one-one and onto)}

💡 Only bijective functions have inverses. If f is one-one but not onto, restrict the codomain to the range to make it bijective. If f is onto but not one-one, no inverse exists.

Trying to find the inverse of a function that is not one-one. For example, f(x) = x^2 on R has no inverse because f(2) = f(-2).

Number of Relations on a Set

#8
Number of relations from A to B=2n(A)n(B)\text{Number of relations from } A \text{ to } B = 2^{n(A) \cdot n(B)}

💡 A relation from A to B is any subset of A x B. Since A x B has n(A)*n(B) elements, the number of subsets is 2^(n(A)*n(B)). For a relation on set A (from A to A), this becomes 2^(n(A)^2).

Number of Onto Functions (Surjections)

#9
Onto functions from A to B=k=0n(1)knCk(nk)m\text{Onto functions from } A \text{ to } B = \sum_{k=0}^{n} (-1)^k \cdot {}^{n}C_k \cdot (n-k)^m

💡 Here m = n(A) and n = n(B) with m >= n. This uses inclusion-exclusion. For n(B) = 2: onto functions = 2^m - 2. For n(B) = 3: onto functions = 3^m - 3*2^m + 3.

Using the formula when m < n. There are no onto functions when the domain is smaller than the codomain.

Floor and Ceiling Functions

#10
x=greatest integerxx=least integerx\lfloor x \rfloor = \text{greatest integer} \leq x \quad | \quad \lceil x \rceil = \text{least integer} \geq x

💡 Also called the greatest integer function [x]. For negative numbers: floor(-2.3) = -3, not -2. The fractional part {x} = x - floor(x) always satisfies 0 <= {x} < 1.

Computing floor(-2.3) as -2 instead of -3. The floor function rounds towards negative infinity, not towards zero.