Section 1 · Revision

Engineering Mathematics formula sheet

Formulas, standard counts and quick rules for logic, discrete maths, linear algebra, calculus and probability, for last-day revision.

Full notes Section test

Propositional and first order logic

Law Form
Implication p→q≡¬p∨q≡¬q→¬pp \to q \equiv \lnot p \lor q \equiv \lnot q \to \lnot p
Exportation p→(q→r)≡(p∧q)→rp \to (q \to r) \equiv (p \land q) \to r
Not associative (p→q)→r≢p→(q→r)(p \to q) \to r \not\equiv p \to (q \to r)
Biconditional p↔q≡(p→q)∧(q→p)p \leftrightarrow q \equiv (p \to q) \land (q \to p)
De Morgan (quantifiers) ¬∀x P≡∃x ¬P\lnot \forall x\, P \equiv \exists x\, \lnot P, ¬∃x P≡∀x ¬P\lnot \exists x\, P \equiv \forall x\, \lnot P
Distribution ∀\forall over ∧\land, ∃\exists over ∨\lor (both directions only)
Pull out of antecedent ∀x(P(x)→Q)≡∃x P(x)→Q\forall x (P(x) \to Q) \equiv \exists x\, P(x) \to Q; ∃x(P(x)→Q)≡∀x P(x)→Q\exists x (P(x) \to Q) \equiv \forall x\, P(x) \to Q
  • Valid one way only: ∃x∀y P→∀y∃x P\exists x \forall y\, P \to \forall y \exists x\, P; ∀xP∨∀xQ→∀x(P∨Q)\forall x P \lor \forall x Q \to \forall x (P \lor Q); ∃x(P∧Q)→∃xP∧∃xQ\exists x (P \land Q) \to \exists x P \land \exists x Q.
  • "Only AA are BB": ∀x(B(x)→A(x))\forall x (B(x) \to A(x)). "All AA are BB": ∀x(A(x)→B(x))\forall x (A(x) \to B(x)). "Some AA are BB": ∃x(A(x)∧B(x))\exists x (A(x) \land B(x)).
  • Boolean functions of nn variables: 22n2^{2^n}. Self-dual ones: 22n−12^{2^{n-1}}.
  • Functionally complete: {NAND}\{\text{NAND}\}, {NOR}\{\text{NOR}\}, {¬,∧}\{\lnot, \land\}, {¬,∨}\{\lnot, \lor\}, {¬,→}\{\lnot, \to\}, {→,F}\{\to, \mathbf{F}\}. Not complete: {∧,∨}\{\land, \lor\}, {∧,∨,→}\{\land, \lor, \to\} (all preserve 1), {⊕,¬}\{\oplus, \lnot\} (affine).
  • Inference: modus ponens, modus tollens, hypothetical syllogism, disjunctive syllogism, resolution (p∨q),(¬p∨r)⊢q∨r(p \lor q), (\lnot p \lor r) \vdash q \lor r.
  • If you see "how many assignments satisfy", count the complement or split on one variable.

Sets, relations, functions, partial orders and lattices

Counts on an nn-element set:

Relations that are Count
Any 2n22^{n^2}
Reflexive (or irreflexive) 2n2−n2^{n^2 - n}
Symmetric 2n(n+1)/22^{n(n+1)/2}
Reflexive and symmetric 2n(n−1)/22^{n(n-1)/2}
Antisymmetric 2n⋅3n(n−1)/22^n \cdot 3^{n(n-1)/2}
Asymmetric 3n(n−1)/23^{n(n-1)/2}
Equivalence Bell BnB_n: 1,1,2,5,15,52,203,8771, 1, 2, 5, 15, 52, 203, 877 for n=0..7n = 0..7
Partial orders 1,3,19,2191, 3, 19, 219 for n=1..4n = 1..4

| Functions A→BA \to B, ∣A∣=m|A| = m, ∣B∣=n|B| = n | Count | |---|---| | All | nmn^m | | Injective (m≤nm \le n) | n!/(n−m)!n!/(n - m)! | | Surjective | ∑i=0n(−1)i(ni)(n−i)m=n! S(m,n)\sum_{i=0}^{n} (-1)^i \binom{n}{i} (n - i)^m = n!\,S(m, n) | | Bijective (m=nm = n) | n!n! |

  • An equivalence relation with class sizes k1,…,krk_1, \dots, k_r has ∑ki2\sum k_i^2 ordered pairs.
  • Transitive closure: (a,b)(a, b) in R+R^+ iff a path of length ≥1\ge 1 from aa to bb. Warshall is O(n3)O(n^3).
  • g∘fg \circ f injective implies ff injective; g∘fg \circ f surjective implies gg surjective.
  • Lattice: every pair has a lub (join) and glb (meet). Finite lattice is bounded.
  • Distributive iff no sublattice M3M_3 (diamond) or N5N_5 (pentagon). In a distributive lattice complements are unique if they exist.
  • Boolean lattice = complemented + distributive, ∣L∣=2k|L| = 2^k.
  • (Dn,∣)(D_n, \mid): join lcm, meet gcd. Always distributive. Boolean iff nn is squarefree. Elements with a complement: 2ω(n)2^{\omega(n)}, where ω(n)\omega(n) is the number of distinct primes.
  • Partitions of a 3-set under refinement form M3M_3 (not distributive).
  • Hasse diagram: drop reflexive and transitive edges, draw smaller below.

Monoids and groups

Structure Needs
Semigroup closure, associativity
Monoid + identity
Group + inverses
Abelian + commutativity
  • (Z,−)(\mathbb{Z}, -) is not associative. (Z≥0,+)(\mathbb{Z}_{\ge 0}, +) and (P(S),∪)(\mathcal{P}(S), \cup) are monoids, not groups. (Zn∖{0},×n)(\mathbb{Z}_n \setminus \{0\}, \times_n) is a group iff nn is prime.
  • Lagrange: ∣H∣|H| and the order of every element divide ∣G∣|G|. The converse fails (A4A_4, order 12, has no subgroup of order 6).
  • Order of aa in Zn\mathbb{Z}_n: n/gcd⁡(a,n)n / \gcd(a, n). Generators of Zn\mathbb{Z}_n: φ(n)\varphi(n). Subgroups of Zn\mathbb{Z}_n: one per divisor, d(n)d(n) total. Elements of order dd: φ(d)\varphi(d).
  • Order of (a,b)(a, b) in G×HG \times H: lcm⁡(∣a∣,∣b∣)\operatorname{lcm}(|a|, |b|). Zm×Zn\mathbb{Z}_m \times \mathbb{Z}_n is cyclic iff gcd⁡(m,n)=1\gcd(m, n) = 1.
  • Prime order implies cyclic implies abelian. Every group of order ≤5\le 5 is abelian; smallest non-abelian is S3S_3 (order 6).
  • x2=ex^2 = e for all xx implies abelian. (ab)−1=b−1a−1(ab)^{-1} = b^{-1}a^{-1}.
  • Order of a permutation = lcm of cycle lengths. Number of kk-cycles in SnS_n: (nk)(k−1)!\binom{n}{k}(k - 1)!.
  • If you see a∗b=a+b+aba * b = a + b + ab on R∖{−1}\mathbb{R} \setminus \{-1\}: identity 0, inverse −a/(1+a)-a/(1 + a).

Graph theory

Fact Formula
Handshake ∑deg⁡v=2E\sum \deg v = 2E; odd-degree vertices are even in number
Tree on nn vertices n−1n - 1 edges; forest with kk trees: n−kn - k
Max edges, nn vertices, kk components (n−k+12)\binom{n - k + 1}{2}
Planar, simple, n≥3n \ge 3 E≤3V−6E \le 3V - 6; no triangles: E≤2V−4E \le 2V - 4
Euler formula V−E+F=1+kV - E + F = 1 + k (kk components; =2= 2 if connected)
Spanning trees KnK_n: nn−2n^{n-2}; Km,nK_{m,n}: mn−1nm−1m^{n-1} n^{m-1}; CnC_n: nn
Perfect matchings of K2nK_{2n} (2n−1)!!=(2n)!/(2nn!)(2n - 1)!! = (2n)!/(2^n n!)
Hamiltonian cycles KnK_n: (n−1)!/2(n-1)!/2; Kn,nK_{n,n}: n! (n−1)!/2n!\,(n-1)!/2

Chromatic polynomials: KnK_n: k(k−1)⋯(k−n+1)k(k-1)\cdots(k-n+1); tree on nn vertices: k(k−1)n−1k(k-1)^{n-1}; CnC_n: (k−1)n+(−1)n(k−1)(k-1)^n + (-1)^n (k-1); wheel (hub + CnC_n): k⋅P(Cn,k−1)k \cdot P(C_n, k-1).

  • χ=2\chi = 2 iff bipartite with an edge iff no odd cycle. χ(Cn)=2\chi(C_n) = 2 or 3 (odd). χ(Wn)=3\chi(W_n) = 3 or 4 (odd rim). Petersen: χ=3\chi = 3, not Hamiltonian, 3-regular, 15 edges.
  • χ≥ω\chi \ge \omega (clique size) and χ≥n/α\chi \ge n / \alpha. Brooks: χ≤Δ\chi \le \Delta unless complete or odd cycle. Planar: χ≤4\chi \le 4.
  • Euler circuit iff connected (ignoring isolated vertices) and all degrees even. Euler trail iff exactly 0 or 2 odd vertices.
  • Hamiltonian: Dirac (δ≥n/2\delta \ge n/2), Ore (deg⁡u+deg⁡v≥n\deg u + \deg v \ge n for non-adjacent u,vu, v). Bipartite with unequal sides: no Hamiltonian cycle.
  • Non-planar: K5K_5, K3,3K_{3,3} and anything containing a subdivision of them (Kuratowski).
  • König (bipartite): max matching = min vertex cover. Always: α+β=n\alpha + \beta = n (independent set + vertex cover). No isolated vertices: max matching + min edge cover =n= n.
  • Hall: bipartite GG has a matching saturating XX iff ∣N(S)∣≥∣S∣|N(S)| \ge |S| for all S⊆XS \subseteq X.

Combinatorics

Pattern Count
x1+⋯+xk=nx_1 + \dots + x_k = n, xi≥0x_i \ge 0 (n+k−1k−1)\binom{n + k - 1}{k - 1}
Same, xi≥1x_i \ge 1 (n−1k−1)\binom{n - 1}{k - 1}
Strictly increasing length-rr strings from nn symbols (nr)\binom{n}{r}
Non-decreasing (n+r−1r)\binom{n + r - 1}{r}
Derangements DnD_n n!∑i=0n(−1)i/i!n! \sum_{i=0}^{n} (-1)^i / i!: 1,0,1,2,9,44,2651, 0, 1, 2, 9, 44, 265
Exactly rr fixed points (nr)Dn−r\binom{n}{r} D_{n-r}
Catalan CnC_n 1n+1(2nn)\frac{1}{n+1}\binom{2n}{n}: 1,1,2,5,14,42,132,4291, 1, 2, 5, 14, 42, 132, 429
Binary strings, no two adjacent 1s Fn+2F_{n+2} (length 10: 144)
  • Stirling second kind S(n,k)S(n, k) (set partitions): S(n,k)=S(n−1,k−1)+k S(n−1,k)S(n, k) = S(n-1, k-1) + k\,S(n-1, k); S(n,2)=2n−1−1S(n, 2) = 2^{n-1} - 1; S(n,n−1)=(n2)S(n, n-1) = \binom{n}{2}. Row n=5n = 5: 1,15,25,10,11, 15, 25, 10, 1.
  • Stirling first kind c(n,k)c(n, k) (permutations with kk cycles): c(n,k)=c(n−1,k−1)+(n−1) c(n−1,k)c(n, k) = c(n-1, k-1) + (n-1)\,c(n-1, k). Row n=5n = 5: 24,50,35,10,124, 50, 35, 10, 1.
  • Inclusion-exclusion: ∣A∪B∪C∣=∑∣A∣−∑∣A∩B∣+∣A∩B∩C∣|A \cup B \cup C| = \sum |A| - \sum |A \cap B| + |A \cap B \cap C|. Count "none of" as total minus union.
  • Pigeonhole: nn objects in kk boxes, some box has ≥⌈n/k⌉\ge \lceil n/k \rceil. To force rr in one box: k(r−1)+1k(r - 1) + 1 objects.
  • Recurrences: roots r1≠r2r_1 \ne r_2: Ar1n+Br2nA r_1^n + B r_2^n; double root rr: (A+Bn)rn(A + Bn) r^n. Fit A,BA, B to a0,a1a_0, a_1, then check a2a_2.
Generating function Coefficient of xnx^n
1/(1−ax)1/(1 - ax) ana^n
1/(1−x)k1/(1 - x)^k (n+k−1k−1)\binom{n + k - 1}{k - 1}
x/(1−x)2x/(1 - x)^2 nn
(1+x)m(1 + x)^m (mn)\binom{m}{n}
(1−xm+1)/(1−x)(1 - x^{m+1})/(1 - x) 11 for n≤mn \le m
1/((1−x)(1−x2))1/((1-x)(1-x^2)) ⌊n/2⌋+1\lfloor n/2 \rfloor + 1

Linear algebra

  • det⁡(AB)=det⁡Adet⁡B\det(AB) = \det A \det B, det⁡(AT)=det⁡A\det(A^T) = \det A, det⁡(kA)=kndet⁡A\det(kA) = k^n \det A, det⁡(A−1)=1/det⁡A\det(A^{-1}) = 1/\det A. Row swap flips sign; adding a multiple of a row changes nothing. Triangular: product of diagonal.
  • det⁡(aI+bJ)n×n=an−1(a+nb)\det(aI + bJ)_{n \times n} = a^{n-1}(a + nb), with JJ the all-ones matrix.
  • Rank-nullity: rank⁡(A)+nullity⁡(A)=\operatorname{rank}(A) + \operatorname{nullity}(A) = number of columns. rank⁡(AB)≤min⁡(rank⁡A,rank⁡B)\operatorname{rank}(AB) \le \min(\operatorname{rank} A, \operatorname{rank} B).
Ax=bAx = b, AA is m×nm \times n, r=rank⁡Ar = \operatorname{rank} A Result
rank⁡[A∣b]>r\operatorname{rank}[A \mid b] > r no solution
rank⁡[A∣b]=r=n\operatorname{rank}[A \mid b] = r = n unique
rank⁡[A∣b]=r<n\operatorname{rank}[A \mid b] = r < n infinitely many, n−rn - r free variables
Ax=0Ax = 0, m<nm < n always a non-zero solution
  • Eigenvalues: ∑λi=tr⁡A\sum \lambda_i = \operatorname{tr} A, ∏λi=det⁡A\prod \lambda_i = \det A. Ak→λkA^k \to \lambda^k, A−1→1/λA^{-1} \to 1/\lambda, A+cI→λ+cA + cI \to \lambda + c, p(A)→p(λ)p(A) \to p(\lambda). AA and ATA^T share eigenvalues.
  • Triangular: eigenvalues on the diagonal. Real symmetric: real eigenvalues, orthogonal eigenvectors, diagonalisable. Idempotent: {0,1}\{0, 1\}. Nilpotent: 00. Orthogonal: ∣λ∣=1|\lambda| = 1.
  • Distinct eigenvalues imply diagonalisable. Independent eigenvectors for λ\lambda: n−rank⁡(A−λI)n - \operatorname{rank}(A - \lambda I) (geometric ≤\le algebraic multiplicity).
  • 2×22 \times 2: λ2−(tr⁡)λ+det⁡=0\lambda^2 - (\operatorname{tr})\lambda + \det = 0; A−1=1ad−bc[d−b−ca]A^{-1} = \frac{1}{ad - bc}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}.
  • Cayley-Hamilton: AA satisfies its characteristic polynomial; use it for A−1A^{-1} and high powers.
  • LU (Doolittle, LL unit lower): u1j=a1ju_{1j} = a_{1j}, li1=ai1/u11l_{i1} = a_{i1}/u_{11}; then lijl_{ij} are the elimination multipliers and UU is the echelon form. det⁡A=∏uii\det A = \prod u_{ii}. For invertible AA, LU without row swaps exists iff every leading principal minor is non-zero.

Calculus

Limit Value
sin⁡xx\frac{\sin x}{x}, tan⁡xx\frac{\tan x}{x}, ex−1x\frac{e^x - 1}{x}, ln⁡(1+x)x\frac{\ln(1+x)}{x} as x→0x \to 0 1
1−cos⁡xx2\frac{1 - \cos x}{x^2} 1/21/2
sin⁡x−xx3\frac{\sin x - x}{x^3} −1/6-1/6
(1+x)1/x(1 + x)^{1/x} as x→0x \to 0; (1+a/n)n(1 + a/n)^n ee; eae^a
ax−1x\frac{a^x - 1}{x} ln⁡a\ln a
  • L'Hospital for 0/00/0 or ∞/∞\infty/\infty. Convert 0⋅∞0 \cdot \infty, 1∞1^\infty, 000^0, ∞0\infty^0 with logs.
  • Differentiable implies continuous, not conversely (∣x∣|x| at 0). xnsin⁡(1/x)x^n \sin(1/x), f(0)=0f(0) = 0: continuous for n≥1n \ge 1, differentiable at 0 for n≥2n \ge 2.
  • Rolle: continuous on [a,b][a, b], differentiable on (a,b)(a, b), f(a)=f(b)f(a) = f(b) gives f′(c)=0f'(c) = 0. MVT: f′(c)=f(b)−f(a)b−af'(c) = \frac{f(b) - f(a)}{b - a}. For x2x^2 on [a,b][a, b], c=(a+b)/2c = (a+b)/2.
  • Extrema: f′=0f' = 0, then f′′>0f'' > 0 min, f′′<0f'' < 0 max. On a closed interval also check endpoints. Distance problems: minimise the squared distance.
  • ∫0π/2sin⁡nx dx=n−1n⋅n−3n−2⋯\int_0^{\pi/2} \sin^n x\,dx = \frac{n-1}{n} \cdot \frac{n-3}{n-2} \cdots, ending in π2\frac{\pi}{2} (nn even) or 1 (nn odd).
  • ∫0af(x) dx=∫0af(a−x) dx\int_0^a f(x)\,dx = \int_0^a f(a - x)\,dx. Odd ff on [−a,a][-a, a]: 0. Even: 2∫0a2\int_0^a.
  • ∫xeaxdx=eaxa2(ax−1)\int x e^{ax} dx = \frac{e^{ax}}{a^2}(ax - 1); by parts ∫u dv=uv−∫v du\int u\,dv = uv - \int v\,du.
  • pp-test: ∫1∞x−p\int_1^\infty x^{-p} converges iff p>1p > 1; ∫01x−p\int_0^1 x^{-p} converges iff p<1p < 1.
  • ∣f∣|f| integrals: split at the roots of ff.

Probability and statistics

Distribution PP or density Mean Variance
Binomial(n,p)(n, p) (nk)pkqn−k\binom{n}{k} p^k q^{n-k} npnp npqnpq
Geometric (trials to 1st success) qk−1pq^{k-1}p 1/p1/p q/p2q/p^2
Poisson(λ)(\lambda) e−λλk/k!e^{-\lambda}\lambda^k / k! λ\lambda λ\lambda
Uniform(a,b)(a, b) 1/(b−a)1/(b - a) (a+b)/2(a+b)/2 (b−a)2/12(b-a)^2/12
Exponential(λ)(\lambda) λe−λx\lambda e^{-\lambda x} 1/λ1/\lambda 1/λ21/\lambda^2
Normal(μ,σ2)(\mu, \sigma^2) 1σ2πe−(x−μ)2/2σ2\frac{1}{\sigma\sqrt{2\pi}} e^{-(x-\mu)^2/2\sigma^2} μ\mu σ2\sigma^2
  • Exponential: P(X>t)=e−λtP(X > t) = e^{-\lambda t}, memoryless, median ln⁡2/λ\ln 2/\lambda. Geometric is the discrete memoryless one.
  • Normal: Z=(X−μ)/σZ = (X - \mu)/\sigma (divide by σ\sigma, not σ2\sigma^2). P(∣Z∣<1,2,3)≈0.683,0.954,0.997P(|Z| < 1, 2, 3) \approx 0.683, 0.954, 0.997. Φ(1.645)=0.95\Phi(1.645) = 0.95, Φ(1.96)=0.975\Phi(1.96) = 0.975. aX+b∼N(aμ+b,a2σ2)aX + b \sim N(a\mu + b, a^2\sigma^2).
  • Poisson approximation: Binomial with nn large, pp small: λ=np\lambda = np. Sum of independent Poissons is Poisson with λ1+λ2\lambda_1 + \lambda_2.
  • E[aX+b]=aE[X]+bE[aX + b] = aE[X] + b; Var⁡(aX+b)=a2Var⁡(X)\operatorname{Var}(aX + b) = a^2 \operatorname{Var}(X); Var⁡(X)=E[X2]−E[X]2\operatorname{Var}(X) = E[X^2] - E[X]^2; Var⁡(X+Y)=Var⁡X+Var⁡Y+2Cov⁡(X,Y)\operatorname{Var}(X + Y) = \operatorname{Var} X + \operatorname{Var} Y + 2\operatorname{Cov}(X, Y).
  • Total probability: P(B)=∑P(B∣Ai)P(Ai)P(B) = \sum P(B \mid A_i) P(A_i). Bayes: P(Aj∣B)=P(B∣Aj)P(Aj)/P(B)P(A_j \mid B) = P(B \mid A_j) P(A_j) / P(B). Multi-stage: compute each branch's joint probability, then divide one branch by the sum.
  • Conditional expectation over a finite equally likely event: average the value over the outcomes in the event. E[X]=E[E[X∣Y]]E[X] = E[E[X \mid Y]].
  • Two uniforms on [0,1][0, 1]: probabilities are areas in the unit square; P(∣X−Y∣<a)=1−(1−a)2P(|X - Y| < a) = 1 - (1 - a)^2.
  • Mean, median, mode: right-skewed usually gives mode << median << mean. Empirical: mean −- mode ≈3\approx 3(mean −- median).