AI-C01-BANK-001

AI Question Bank · Series 1 — Solved

Mathematical and Statistical Foundation of Data Science
PGD01C01
Self-paced practice
600 marks
Solved

AI-generated practice bank for PGD01C01 — 100 Part A (2 marks) + 20 Part B (20 marks) questions covering all five modules, fully solved in a simple exam-oriented style. Click any question to reveal the answer.

How to use this bank

Click a question to reveal its answer. Each question matches the exam style of the Calicut PGDDSA paper — short crisp answers for 2-mark questions, full statements + derivations + worked examples for 20-mark questions.

Coverage. 20 Part-A + 4 Part-B per module × 5 modules.

ModuleTopic
1Set theory, relations, combinatorics
2Graph theory
3Linear algebra
4Vectors & geometry of space
5Probability theory

PART A — Short Answer (2 marks each) · 100 questions

Module 1 — Set Theory, Relations, Combinatorics

A set is a well-defined collection of distinct objects called elements. Example: A={1,2,3,4}A = \{1, 2, 3, 4\} — the set of positive integers less than 5.

The power set is the set of all subsets of AA. If ∣A∣=n|A| = n, then ∣P(A)∣=2n|\mathcal{P}(A)| = 2^n. For ∣A∣=4|A| = 4: ∣P(A)∣=24=16|\mathcal{P}(A)| = 2^4 = 16.

∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|. We add both and subtract the overlap counted twice.

A binary relation that is reflexive (a∼aa \sim a), symmetric (a∼b⇒b∼aa \sim b \Rightarrow b \sim a), and transitive (a∼b,b∼c⇒a∼ca \sim b, b \sim c \Rightarrow a \sim c).

A partition of AA is a collection of non-empty, pairwise-disjoint subsets whose union is AA. Every equivalence relation creates a partition.

A set in bijection with N\mathbb{N} (countably infinite). Examples: N,Z,Q\mathbb{N}, \mathbb{Z}, \mathbb{Q}. Note: R\mathbb{R} is uncountable.

For any set AA, ∣A∣<∣P(A)∣|A| < |\mathcal{P}(A)|. No set is in bijection with its own power set; hence R\mathbb{R} is uncountable.

A relation that is reflexive, antisymmetric (a≤b,b≤a⇒a=ba \le b, b \le a \Rightarrow a = b) and transitive. Example: divisibility on N\mathbb{N}.

8P3=8!(8−3)!=8⋅7⋅6=336^8P_3 = \dfrac{8!}{(8-3)!} = 8 \cdot 7 \cdot 6 = 336.

(103)=10!3! 7!=10⋅9⋅86=120\binom{10}{3} = \dfrac{10!}{3! \, 7!} = \dfrac{10 \cdot 9 \cdot 8}{6} = 120.

Letters: S×3, T×3, A×1, I×2, C×1 (total 10). Arrangements =10!3! 3! 2!=50,400= \dfrac{10!}{3! \, 3! \, 2!} = 50{,}400.

Circular arrangements =(8−1)!=7!=5040= (8 - 1)! = 7! = 5040. Fix one person and arrange the rest.

A∪B={1,2,3,4,5}A \cup B = \{1, 2, 3, 4, 5\}. A∩B={3}A \cap B = \{3\}.

(A∪B)c=Ac∩Bc(A \cup B)^c = A^c \cap B^c and (A∩B)c=Ac∪Bc(A \cap B)^c = A^c \cup B^c. The complement of union = intersection of complements.

A×B={(a,b):a∈A,b∈B}A \times B = \{(a, b) : a \in A, b \in B\} — set of all ordered pairs. ∣A×B∣=∣A∣⋅∣B∣|A \times B| = |A| \cdot |B|.

A relation RR on AA is reflexive if aRaa R a for every a∈Aa \in A. Example: ≤\le on R\mathbb{R} (every number is ≤\le itself).

aRb⇒bRaa R b \Rightarrow b R a for all a,ba, b. Example: "is a sibling of" — if A is sibling of B, then B is sibling of A.

aRba R b and bRc⇒aRcb R c \Rightarrow a R c. Example: "is taller than" — if A is taller than B and B taller than C, then A is taller than C.

If (i) P(1)P(1) is true and (ii) P(k)⇒P(k+1)P(k) \Rightarrow P(k+1) for all k≥1k \ge 1, then P(n)P(n) is true for all natural numbers nn.

(53)=5!3! 2!=10\binom{5}{3} = \dfrac{5!}{3! \, 2!} = 10 such subsets.

nPn=n!(n−n)!=n!0!=n!^n P_n = \dfrac{n!}{(n - n)!} = \dfrac{n!}{0!} = n! — the number of ways to arrange all nn distinct objects.

nC0=1^n C_0 = 1 (empty selection) and nCn=1^n C_n = 1 (the full set). Both equal 1.

(nr)=(n−1r−1)+(n−1r)\binom{n}{r} = \binom{n-1}{r-1} + \binom{n-1}{r}. Choosing rr from nn = choosing (r−1)(r-1) that include a fixed element + rr that exclude it.

(nr)=n!r!(n−r)!=n!(n−r)!r!=(nn−r)\binom{n}{r} = \dfrac{n!}{r! (n-r)!} = \dfrac{n!}{(n-r)! r!} = \binom{n}{n-r}. Picking rr to include = picking (n−r)(n-r) to exclude.

=2n= 2^n. (By Binomial theorem with x=y=1x = y = 1.) This equals the total number of subsets of an nn-element set.

11 letters: E×3, N×3, G×2, I×2, R×1. Arrangements =11!3! 3! 2! 2!=39,916,800144=277,200= \dfrac{11!}{3! \, 3! \, 2! \, 2!} = \dfrac{39{,}916{,}800}{144} = 277{,}200.

Arrange 5 boys: 5!=1205! = 120. This creates 6 gaps (before, between, after). Choose 4 of 6 gaps for the girls and arrange them: (64)⋅4!=15⋅24=360\binom{6}{4} \cdot 4! = 15 \cdot 24 = 360. Total =120×360=43,200= 120 \times 360 = 43{,}200.

Pick 4 of 5 digits and arrange: 5P4=5!1!=120^5 P_4 = \dfrac{5!}{1!} = 120 four-digit numbers.

Each of the 4 positions has 26 choices independently: 264=456,97626^4 = 456{,}976 words.

(1511)=(154)=15⋅14⋅13⋅124!=32,76024=1365\binom{15}{11} = \binom{15}{4} = \dfrac{15 \cdot 14 \cdot 13 \cdot 12}{4!} = \dfrac{32{,}760}{24} = 1365 ways.

Two specific books are pre-selected. Choose remaining 2 from the other 8: (82)=28\binom{8}{2} = 28 ways.

Necklace arrangements (rotations + reflections equivalent): (n−1)!2=4!2=12\dfrac{(n - 1)!}{2} = \dfrac{4!}{2} = 12 arrangements.

"EQUATION" has 8 letters, 5 vowels (E, U, A, I, O) and 3 consonants (Q, T, N). Treat the 5 vowels as one block: 4 units to arrange = 4!4!. Vowels inside the block: 5!5!. Total =4!×5!=24×120=2880= 4! \times 5! = 24 \times 120 = 2880.

Stars and bars: (n+k−1k−1)=(10+3−13−1)=(122)=66\binom{n + k - 1}{k - 1} = \binom{10 + 3 - 1}{3 - 1} = \binom{12}{2} = 66 ways.

Total committees of 5 from 14: (145)=2002\binom{14}{5} = 2002. Subtract committees with fewer than 2 women — i.e., 0 women or 1 woman:

  • 0 women: (85)=56\binom{8}{5} = 56.
  • 1 woman: (61)(84)=6⋅70=420\binom{6}{1} \binom{8}{4} = 6 \cdot 70 = 420.

Answer =2002−56−420=1526= 2002 - 56 - 420 = 1526 ways.

Module 2 — Graph Theory

A graph G=(V,E)G = (V, E) with no self-loops and no multiple edges between the same pair of vertices.

A graph that allows multiple edges between the same pair of vertices, but typically no self-loops.

∑v∈Vdeg⁡(v)=2∣E∣\sum_{v \in V} \deg(v) = 2|E|. Each edge contributes 1 to the degree of each endpoint, so the sum is twice the edge count.

∣E∣=(n2)=n(n−1)2|E| = \binom{n}{2} = \dfrac{n(n-1)}{2} — every pair of vertices joined.

∣E∣=m⋅n|E| = m \cdot n — every vertex on the left joined to every vertex on the right.

A closed walk that uses every edge exactly once. A connected graph has one iff every vertex has even degree (Euler's theorem).

A cycle that visits every vertex of the graph exactly once. Finding one is NP-complete in general.

A path is a sequence of distinct vertices joined by edges; first and last differ. A cycle is a closed path (first vertex = last vertex).

V−E+F=2V - E + F = 2, where FF counts all faces including the unbounded outer face.

For simple planar graphs E≤3V−6E \le 3V - 6. For K5K_5: V=5,E=10V = 5, E = 10, but 3(5)−6=9<103(5) - 6 = 9 < 10. So K5K_5 cannot be planar.

A subgraph of a connected graph GG that is a tree and includes every vertex of GG. It has ∣V∣−1|V| - 1 edges.

Exactly n−1n - 1. A tree is connected and acyclic, with this minimum number of edges to connect all vertices.

For nn vertices, the n×nn \times n matrix AA where Aij=1A_{ij} = 1 if (vi,vj)∈E(v_i, v_j) \in E and 0 otherwise. Symmetric for undirected graphs.

The number of walks of length exactly kk from vertex viv_i to vertex vjv_j.

A graph where each edge has a direction (ordered pair). Each vertex has separate in-degree and out-degree.

In-degree of a vertex = number of edges coming into it. Out-degree = number of edges going out from it.

A graph is connected if there is a path between every pair of vertices. Otherwise, it splits into connected components.

A graph whose vertex set splits into two disjoint subsets V1,V2V_1, V_2 such that every edge connects V1V_1 to V2V_2. No odd cycles.

A vertex whose removal disconnects the graph (or increases the number of components).

An edge whose removal disconnects the graph (or increases components). Removing it breaks a connected graph.

Module 3 — Linear Algebra

The rank is the number of linearly independent rows (equivalently, columns). It equals the dimension of the column space.

For an m×nm \times n matrix AA: rank(A)+nullity(A)=n\text{rank}(A) + \text{nullity}(A) = n.

Diagonal matrix — eigenvalues are the diagonal entries: λ1=2,λ2=3\lambda_1 = 2, \lambda_2 = 3.

A non-zero vector vv such that Av=λvA v = \lambda v for some scalar λ\lambda (the eigenvalue). AA only stretches vv — doesn't rotate it.

Trace = sum of diagonal entries: tr(A)=∑iaii\text{tr}(A) = \sum_i a_{ii}. Equals the sum of all eigenvalues.

A square matrix with det⁡(A)=0\det(A) = 0 — it has no inverse, its columns are linearly dependent, and 0 is an eigenvalue.

Any real m×nm \times n matrix can be written A=UΣVTA = U \Sigma V^T, where UU and VV are orthogonal and Σ\Sigma is diagonal with non-negative singular values.

A square matrix QQ with QTQ=IQ^T Q = I — its columns (and rows) form an orthonormal set. det⁡Q=±1\det Q = \pm 1.

cos⁡θ=x⋅y∥x∥ ∥y∥\cos\theta = \dfrac{x \cdot y}{\|x\| \, \|y\|} — measures the angle between two vectors. Used in text and embedding similarity.

The set {x∈Rn:wTx+b=0}\{x \in \mathbb{R}^n : w^T x + b = 0\} for some non-zero ww. It's an (n−1)(n-1)-dimensional flat. In 2D it's a line; in 3D a plane.

N(A)={x:Ax=0}N(A) = \{x : A x = 0\} — the set of vectors mapped to zero. Its dimension is the nullity.

Vectors v1,…,vkv_1, \dots, v_k are linearly independent if c1v1+⋯+ckvk=0c_1 v_1 + \dots + c_k v_k = 0 implies all ci=0c_i = 0.

Every square matrix satisfies its own characteristic equation: if p(λ)=det⁡(λI−A)p(\lambda) = \det(\lambda I - A), then p(A)=0p(A) = 0.

det⁡=(1)(4)−(2)(3)=4−6=−2\det = (1)(4) - (2)(3) = 4 - 6 = -2.

A square matrix with 1's on the diagonal and 0's elsewhere; InI_n acts as identity for matrix multiplication: AI=IA=AA I = I A = A.

For square AA with det⁡A≠0\det A \ne 0, the inverse A−1A^{-1} satisfies AA−1=A−1A=IA A^{-1} = A^{-1} A = I. For 2×22 \times 2: A−1=1det⁡A(d−b−ca)A^{-1} = \dfrac{1}{\det A}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}.

A square matrix with AT=AA^T = A, i.e., aij=ajia_{ij} = a_{ji}. Always has real eigenvalues and orthogonal eigenvectors.

A symmetric matrix AA with xTAx>0x^T A x > 0 for all non-zero xx. All eigenvalues positive.

∣x⋅y∣≤∥x∥ ∥y∥|x \cdot y| \le \|x\| \, \|y\| — the inner product is bounded by the product of norms.

Dropping a perpendicular from a vector onto a subspace. For vector uu onto vv: projvu=u⋅vv⋅v v\text{proj}_v u = \dfrac{u \cdot v}{v \cdot v} \, v.

Module 4 — Vectors and Geometry of Space

The vector OP⃗\vec{OP} from origin OO to a point PP. For P(x,y,z)P(x, y, z), OP⃗=⟨x,y,z⟩\vec{OP} = \langle x, y, z \rangle.

∥v⃗∥=9+16+144=169=13\|\vec{v}\| = \sqrt{9 + 16 + 144} = \sqrt{169} = 13.

(1)(4)+(2)(5)+(3)(6)=4+10+18=32(1)(4) + (2)(5) + (3)(6) = 4 + 10 + 18 = 32.

a⃗×b⃗=∣i^j^k^a1a2a3b1b2b3∣\vec{a} \times \vec{b} = \begin{vmatrix} \hat i & \hat j & \hat k \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{vmatrix}. Magnitude = ∥a⃗∥∥b⃗∥sin⁡θ\|\vec{a}\|\|\vec{b}\|\sin\theta = area of parallelogram.

r⃗(t)=A⃗+t(B⃗−A⃗)\vec{r}(t) = \vec{A} + t(\vec{B} - \vec{A}) for t∈Rt \in \mathbb{R}. Direction = B⃗−A⃗\vec{B} - \vec{A}.

n⃗⋅(r⃗−r⃗0)=0\vec{n} \cdot (\vec{r} - \vec{r}_0) = 0, where n⃗\vec{n} is the normal and r⃗0\vec{r}_0 is a point on the plane.

For plane ax+by+cz+d=0ax + by + cz + d = 0 and point P0(x0,y0,z0)P_0(x_0, y_0, z_0): d=∣ax0+by0+cz0+d∣a2+b2+c2d = \dfrac{|a x_0 + b y_0 + c z_0 + d|}{\sqrt{a^2 + b^2 + c^2}}.

For line through AA with direction d⃗\vec{d} and point PP: d=∥AP⃗×d⃗∥∥d⃗∥d = \dfrac{\|\vec{AP} \times \vec{d}\|}{\|\vec{d}\|}.

(x−h)2+(y−k)2+(z−l)2=r2(x - h)^2 + (y - k)^2 + (z - l)^2 = r^2 — sphere of radius rr centred at (h,k,l)(h, k, l).

x=rcos⁡θx = r \cos\theta, y=rsin⁡θy = r \sin\theta, z=zz = z.

x=ρsin⁡ϕcos⁡θx = \rho \sin\phi \cos\theta, y=ρsin⁡ϕsin⁡θy = \rho \sin\phi \sin\theta, z=ρcos⁡ϕz = \rho \cos\phi.

cos⁡θ=a⃗⋅b⃗∥a⃗∥ ∥b⃗∥\cos\theta = \dfrac{\vec{a} \cdot \vec{b}}{\|\vec{a}\| \, \|\vec{b}\|}. Take arccos⁡\arccos for the angle.

projv⃗u⃗=u⃗⋅v⃗v⃗⋅v⃗ v⃗\text{proj}_{\vec{v}} \vec{u} = \dfrac{\vec{u} \cdot \vec{v}}{\vec{v} \cdot \vec{v}} \, \vec{v}.

[a⃗,b⃗,c⃗]=a⃗⋅(b⃗×c⃗)[\vec{a}, \vec{b}, \vec{c}] = \vec{a} \cdot (\vec{b} \times \vec{c}) — a scalar equal to the (signed) volume of the parallelepiped with edges a⃗,b⃗,c⃗\vec{a}, \vec{b}, \vec{c}.

V=∣a⃗⋅(b⃗×c⃗)∣V = |\vec{a} \cdot (\vec{b} \times \vec{c})| — absolute value of the scalar triple product.

Find two edge vectors from one point, compute their cross product (gives normal n⃗\vec{n}), then use n⃗⋅(r⃗−r⃗0)=0\vec{n} \cdot (\vec{r} - \vec{r}_0) = 0.

x=x0+at,  y=y0+bt,  z=z0+ctx = x_0 + a t, \; y = y_0 + b t, \; z = z_0 + c t, where (x0,y0,z0)(x_0, y_0, z_0) is a point on the line and (a,b,c)(a, b, c) its direction.

d=∣d1−d2∣a2+b2+c2d = \dfrac{|d_1 - d_2|}{\sqrt{a^2 + b^2 + c^2}}.

∥(3,4,0)∥=5\|(3, 4, 0)\| = 5. Unit vector =(3/5,4/5,0)= (3/5, 4/5, 0).

∥(2,1,2)∥=3\|(2,1,2)\| = 3. Direction cosines: (2/3,1/3,2/3)(2/3, 1/3, 2/3).

Module 5 — Probability Theory

(i) P(A)≥0P(A) \ge 0. (ii) P(Ω)=1P(\Omega) = 1. (iii) For disjoint events, P(⋃Ai)=∑P(Ai)P(\bigcup A_i) = \sum P(A_i).

P(A∣B)=P(A∩B)P(B)P(A \mid B) = \dfrac{P(A \cap B)}{P(B)} for P(B)>0P(B) > 0. "Probability of AA given BB has occurred."

P(A∣B)=P(B∣A) P(A)P(B)P(A \mid B) = \dfrac{P(B \mid A) \, P(A)}{P(B)}. Inverts conditioning using prior and likelihood.

AA and BB are independent iff P(A∩B)=P(A) P(B)P(A \cap B) = P(A) \, P(B). Knowing BB doesn't change P(A)P(A).

A function X:Ω→RX: \Omega \to \mathbb{R} taking countably many values, described by PMF p(x)=P(X=x)p(x) = P(X = x) with ∑p(x)=1\sum p(x) = 1.

A function taking values in an interval, described by PDF f(x)≥0f(x) \ge 0 with ∫f=1\int f = 1. Probabilities = ∫abf(x)dx\int_a^b f(x) dx.

P(X=k)=(nk)pk(1−p)n−k,  k=0,1,…,nP(X = k) = \binom{n}{k} p^k (1-p)^{n-k}, \; k = 0, 1, \dots, n. Mean = npnp, variance = np(1−p)np(1-p).

f(x)=1σ2πexp⁡ ⁣(−(x−μ)22σ2)f(x) = \dfrac{1}{\sigma \sqrt{2\pi}} \exp\!\left(-\dfrac{(x - \mu)^2}{2 \sigma^2}\right) for x∈Rx \in \mathbb{R}.

Mean =E[X]=p= E[X] = p. Variance =E[X2]−(E[X])2=p−p2=p(1−p)= E[X^2] - (E[X])^2 = p - p^2 = p(1-p).

E[X]=E[E[X∣Y]]E[X] = E[E[X \mid Y]]. Average the conditional means over YY.

Cov(X,Y)=E[(X−μX)(Y−μY)]=E[XY]−E[X]E[Y]\text{Cov}(X, Y) = E[(X - \mu_X)(Y - \mu_Y)] = E[XY] - E[X] E[Y]. Measures linear co-movement.

P(X=k)=e−λλkk!,  k=0,1,2,…P(X = k) = \dfrac{e^{-\lambda} \lambda^k}{k!}, \; k = 0, 1, 2, \dots Mean = variance = λ\lambda.

f(x)=1b−af(x) = \dfrac{1}{b - a} for x∈[a,b]x \in [a, b], else 0. Mean = (a+b)/2(a+b)/2, variance = (b−a)2/12(b-a)^2/12.

f(x)=λe−λxf(x) = \lambda e^{-\lambda x} for x≥0x \ge 0. Mean = 1/λ1/\lambda, variance = 1/λ21/\lambda^2.

For any random variable with finite variance: P(∣X−μ∣≥kσ)≤1k2P(|X - \mu| \ge k \sigma) \le \dfrac{1}{k^2}.

F(x)=P(X≤x)F(x) = P(X \le x). Non-decreasing, right-continuous, F(−∞)=0,F(∞)=1F(-\infty) = 0, F(\infty) = 1.

Mean = λ\lambda, variance = λ\lambda. The Poisson is the only standard distribution where mean = variance.

Mean = a+b2\dfrac{a+b}{2}. Variance = (b−a)212\dfrac{(b-a)^2}{12}.

If {B1,…,Bn}\{B_1, \dots, B_n\} partitions Ω\Omega, then P(A)=∑iP(A∣Bi)P(Bi)P(A) = \sum_i P(A \mid B_i) P(B_i).

ρ=Cov(X,Y)σXσY∈[−1,1]\rho = \dfrac{\text{Cov}(X, Y)}{\sigma_X \sigma_Y} \in [-1, 1]. Measures the strength of linear association.

PART B — Long Essay (20 marks each) · 20 questions

Module 1 — Set Theory, Relations, Combinatorics

Statement. For three finite sets A,B,CA, B, C: ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣.|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|.

Proof. Take any element x∈A∪B∪Cx \in A \cup B \cup C, suppose it lies in exactly kk of the three sets.

  • LHS counts xx once.
  • RHS counts xx: (k1)\binom{k}{1} singletons − (k2)\binom{k}{2} pair-intersections + (k3)\binom{k}{3} triple.

For k=1,2,3k = 1, 2, 3: net = 1−0+0=11 - 0 + 0 = 1; 2−1+0=12 - 1 + 0 = 1; 3−3+1=13 - 3 + 1 = 1. So each element counted once on both sides. ∎

Application. Let AkA_k = multiples of kk in {1,…,500}\{1, \dots, 500\}, so ∣Ak∣=⌊500/k⌋|A_k| = \lfloor 500/k \rfloor.

  • ∣A3∣=166,  ∣A5∣=100,  ∣A7∣=71|A_3| = 166, \; |A_5| = 100, \; |A_7| = 71.
  • ∣A3∩A5∣=⌊500/15⌋=33|A_3 \cap A_5| = \lfloor 500/15 \rfloor = 33.
  • ∣A3∩A7∣=⌊500/21⌋=23|A_3 \cap A_7| = \lfloor 500/21 \rfloor = 23.
  • ∣A5∩A7∣=⌊500/35⌋=14|A_5 \cap A_7| = \lfloor 500/35 \rfloor = 14.
  • ∣A3∩A5∩A7∣=⌊500/105⌋=4|A_3 \cap A_5 \cap A_7| = \lfloor 500/105 \rfloor = 4.

∣A3∪A5∪A7∣=166+100+71−33−23−14+4=271|A_3 \cup A_5 \cup A_7| = 166 + 100 + 71 - 33 - 23 - 14 + 4 = 271.

So 271 integers in 1–500 are divisible by 3, 5 or 7.

Definition. A relation ∼\sim on AA that is reflexive, symmetric, and transitive. For a∈Aa \in A, the equivalence class [a]={x:x∼a}[a] = \{x : x \sim a\}.

Theorem. The equivalence classes of ∼\sim form a partition of AA.

Proof.

  1. Non-empty. Reflexivity: a∈[a]a \in [a], so [a]≠∅[a] \ne \emptyset.
  2. Cover. Each a∈[a]a \in [a], so ⋃a[a]=A\bigcup_a [a] = A.
  3. Disjoint or equal. Suppose [a]∩[b]≠∅[a] \cap [b] \ne \emptyset, pick cc in both. Then c∼ac \sim a and c∼bc \sim b. Symmetry gives a∼ca \sim c, transitivity a∼ba \sim b. For any x∈[a]x \in [a]: x∼a∼bx \sim a \sim b, so x∈[b]x \in [b]. So [a]⊆[b][a] \subseteq [b]. By symmetry [a]=[b][a] = [b]. ∎

Verification with ∼\sim on Z\mathbb{Z}, a∼b  ⟺  4∣(a−b)a \sim b \iff 4 \mid (a - b).

  • Reflexive: a−a=0a - a = 0, divisible by 4. ✓
  • Symmetric: 4∣(a−b)⇒4∣(b−a)4 \mid (a - b) \Rightarrow 4 \mid (b - a). ✓
  • Transitive: 4∣(a−b)4 \mid (a-b) and 4∣(b−c)⇒4∣(a−c)4 \mid (b-c) \Rightarrow 4 \mid (a-c). ✓

The four classes are [0],[1],[2],[3][0], [1], [2], [3] — residue classes mod 4 — and they partition Z\mathbb{Z}.

Principle. If P(n0)P(n_0) is true (base case) and P(k)⇒P(k+1)P(k) \Rightarrow P(k+1) (induction step), then P(n)P(n) is true for all n≥n0n \ge n_0.

Part 1. Prove ∑i=1ni=n(n+1)2\sum_{i=1}^{n} i = \dfrac{n(n+1)}{2}.

Base n=1n = 1: LHS = 1, RHS = 1⋅2/2=11 \cdot 2 / 2 = 1. ✓

Step. Assume ∑i=1ki=k(k+1)/2\sum_{i=1}^{k} i = k(k+1)/2. Then ∑i=1k+1i=k(k+1)2+(k+1)=k(k+1)+2(k+1)2=(k+1)(k+2)2\sum_{i=1}^{k+1} i = \dfrac{k(k+1)}{2} + (k+1) = \dfrac{k(k+1) + 2(k+1)}{2} = \dfrac{(k+1)(k+2)}{2}. ∎

Part 2. Prove 3∣(n3+2n)3 \mid (n^3 + 2n) for n≥1n \ge 1.

Base n=1n = 1: 1+2=31 + 2 = 3, divisible by 3. ✓

Step. Assume 3∣(k3+2k)3 \mid (k^3 + 2k), i.e., k3+2k=3mk^3 + 2k = 3m for some integer mm. Then (k+1)3+2(k+1)=k3+3k2+3k+1+2k+2=(k3+2k)+3k2+3k+3=3m+3(k2+k+1)(k+1)^3 + 2(k+1) = k^3 + 3k^2 + 3k + 1 + 2k + 2 = (k^3 + 2k) + 3k^2 + 3k + 3 = 3m + 3(k^2 + k + 1) — divisible by 3. ∎

(i) Choose 4 of 10 men and 3 of 8 women: (104)⋅(83)=210⋅56=11,760\binom{10}{4} \cdot \binom{8}{3} = 210 \cdot 56 = 11{,}760 ways.

(ii) "MATHEMATICS" has 11 letters: M×2, A×2, T×2, H, E, I, C, S. Arrangements =11!2! 2! 2!=39,916,8008=4,989,600= \dfrac{11!}{2! \, 2! \, 2!} = \dfrac{39{,}916{,}800}{8} = 4{,}989{,}600.

(iii) Treat the 2 specific persons as a single block: 5 units to arrange = 5!=1205! = 120. The 2 within the block can swap: 2!=22! = 2. Total =5!×2!=120×2=240= 5! \times 2! = 120 \times 2 = 240 ways.

Module 2 — Graph Theory

Theorem. A connected graph has an Eulerian circuit iff every vertex has even degree.

Proof. (⇒) If an Eulerian circuit exists, every time the walk enters a vertex it must leave by another edge. Edges at each vertex pair up, so every degree is even.

(⇐) Suppose connected and all even degree. Start a trail at any vertex v0v_0. The even-degree condition ensures that whenever we reach a vertex, an unused outgoing edge exists. The trail must return to v0v_0, forming a circuit C0C_0.

If C0C_0 uses all edges, done. Otherwise, by connectivity, some vertex on C0C_0 has unused edges; build another circuit and splice in. Repeat until all edges used. ∎

Verify K6K_6. K6K_6: every vertex has degree 55 (odd!). So K6K_6 does NOT have an Eulerian circuit. (Only KnK_n with nn odd does — degree n−1n - 1 even.)

Hamiltonian. Visit vertices in cyclic order v1→v2→⋯→v6→v1v_1 \to v_2 \to \dots \to v_6 \to v_1. Every consecutive pair is joined (complete graph). So K6K_6 DOES have a Hamiltonian circuit. Every KnK_n with n≥3n \ge 3 is Hamiltonian.

Algorithm.

Initialise d[v] = ∞ for all v; d[source] = 0
Use min-priority queue keyed by d[v]
while queue not empty:
    u = extract-min
    for each neighbour v of u:
        if d[u] + w(u,v) < d[v]:
            d[v] = d[u] + w(u,v)
            prev[v] = u

Greedy choice: always finalise unvisited vertex with smallest tentative distance. Complexity O((V+E)log⁡V)O((V+E) \log V) with a heap.

Apply.

StepVisitedd[A]d[B]d[C]d[D]d[E]
init–0∞∞∞∞
pick A{A}062∞∞
pick C{A,C}05*26**10
pick B{A,B,C}052610
pick D{A,B,C,D}05269***
pick Eall05269

*via A→C→BA \to C \to B (cost 2+3=52 + 3 = 5). **via A→C→DA \to C \to D (cost 2+4=62 + 4 = 6). ***via A→C→D→EA \to C \to D \to E (cost 6+3=96 + 3 = 9).

Shortest path: A→C→D→EA \to C \to D \to E, total cost 9.

Definitions.

  • Spanning tree: subgraph that is a tree and includes all vertices; has ∣V∣−1|V| - 1 edges.
  • MST: spanning tree with minimum total edge weight.

Kruskal's algorithm.

sort edges by weight ascending
Union-Find: each vertex its own component initially
for each edge (u, v) in order:
    if find(u) != find(v):
        add (u, v) to MST
        union(u, v)
    stop when |V| - 1 edges added

Apply. Sort edges: (B,D,1),(A,C,2),(B,C,3),(D,E,3),(C,D,4),(A,B,6),(C,E,8)(B,D,1), (A,C,2), (B,C,3), (D,E,3), (C,D,4), (A,B,6), (C,E,8).

#EdgeWeightAction
1(B, D)1add — {B,D}
2(A, C)2add — {A,C}, {B,D}
3(B, C)3add — merges to {A,B,C,D}
4(D, E)3add — {A,B,C,D,E}
stop4 edges = $V- 1$

MST edges: (B,D),(A,C),(B,C),(D,E)(B,D), (A,C), (B,C), (D,E). Total weight = 1+2+3+3=91 + 2 + 3 + 3 = 9.

Definitions.

  • Adjacency matrix A∈Rn×nA \in \mathbb{R}^{n \times n}: Aij=1A_{ij} = 1 if (vi,vj)∈E(v_i, v_j) \in E, else 0. Symmetric for undirected graphs.
  • Incidence matrix B∈Rn×mB \in \mathbb{R}^{n \times m}: Bij=1B_{ij} = 1 if vertex viv_i is on edge eje_j.

Key fact. (Ak)ij(A^k)_{ij} = number of walks of length exactly kk from viv_i to vjv_j.

Apply. A=(0110101111010110)A = \begin{pmatrix} 0 & 1 & 1 & 0 \\ 1 & 0 & 1 & 1 \\ 1 & 1 & 0 & 1 \\ 0 & 1 & 1 & 0 \end{pmatrix}

Compute A2A^2. Row 1:

  • (A2)11=0+1+1+0=2(A^2)_{11} = 0 + 1 + 1 + 0 = 2.
  • (A2)12=0+0+1+0=1(A^2)_{12} = 0 + 0 + 1 + 0 = 1.
  • (A2)13=0+1+0+0=1(A^2)_{13} = 0 + 1 + 0 + 0 = 1.
  • (A2)14=0+1+1+0=2(A^2)_{14} = 0 + 1 + 1 + 0 = 2.

By symmetry of AA, A2A^2 is symmetric. Continuing: A2=(2112132112312112)A^2 = \begin{pmatrix} 2 & 1 & 1 & 2 \\ 1 & 3 & 2 & 1 \\ 1 & 2 & 3 & 1 \\ 2 & 1 & 1 & 2 \end{pmatrix}

Interpretation. From vertex 1: 2 walks back to 1 (via 2 or 3), 1 walk to 2 (via 3), 1 walk to 3 (via 2), 2 walks to 4 (via 2 or 3). Diagonal entries equal vertex degrees.

Module 3 — Linear Algebra

Step 1 — Characteristic polynomial. det⁡(A−λI)=(6−λ)(3−λ)−(−1)(2)=λ2−9λ+20=(λ−4)(λ−5)\det(A - \lambda I) = (6-\lambda)(3-\lambda) - (-1)(2) = \lambda^2 - 9\lambda + 20 = (\lambda - 4)(\lambda - 5).

Eigenvalues: λ1=5,  λ2=4\lambda_1 = 5, \; \lambda_2 = 4. Check: sum =9=tr(A)= 9 = \text{tr}(A), product =20=det⁡(A)= 20 = \det(A). ✓

Step 2 — Eigenvectors.

For λ=5\lambda = 5: (A−5I)v=(1−12−2)v=0⇒x=y(A - 5I)v = \begin{pmatrix} 1 & -1 \\ 2 & -2 \end{pmatrix}v = 0 \Rightarrow x = y. Take v1=(1,1)Tv_1 = (1, 1)^T.

For λ=4\lambda = 4: (A−4I)v=(2−12−1)v=0⇒y=2x(A - 4I)v = \begin{pmatrix} 2 & -1 \\ 2 & -1 \end{pmatrix}v = 0 \Rightarrow y = 2x. Take v2=(1,2)Tv_2 = (1, 2)^T.

Step 3 — Diagonalise. P=(1112),  D=(5004),  A=PDP−1P = \begin{pmatrix} 1 & 1 \\ 1 & 2 \end{pmatrix}, \; D = \begin{pmatrix} 5 & 0 \\ 0 & 4 \end{pmatrix}, \; A = P D P^{-1}.

det⁡P=1\det P = 1, so P−1=(2−1−11)P^{-1} = \begin{pmatrix} 2 & -1 \\ -1 & 1 \end{pmatrix}.

Step 4 — Compute A5A^5. A5=PD5P−1A^5 = P D^5 P^{-1} where D5=(550045)=(3125001024)D^5 = \begin{pmatrix} 5^5 & 0 \\ 0 & 4^5 \end{pmatrix} = \begin{pmatrix} 3125 & 0 \\ 0 & 1024 \end{pmatrix}.

PD5=(3125102431252048)P D^5 = \begin{pmatrix} 3125 & 1024 \\ 3125 & 2048 \end{pmatrix}

A5=(3125102431252048)(2−1−11)=(5226−21014202−1077)A^5 = \begin{pmatrix} 3125 & 1024 \\ 3125 & 2048 \end{pmatrix} \begin{pmatrix} 2 & -1 \\ -1 & 1 \end{pmatrix} = \begin{pmatrix} 5226 & -2101 \\ 4202 & -1077 \end{pmatrix}.

Process. For A∈Rm×nA \in \mathbb{R}^{m \times n}:

  1. Form ATAA^T A.
  2. Find eigenvalues λi\lambda_i and orthonormal eigenvectors viv_i of ATAA^T A → right singular vectors VV.
  3. Singular values σi=λi\sigma_i = \sqrt{\lambda_i}, sorted descending → Σ\Sigma.
  4. Left singular vectors ui=1σiAviu_i = \dfrac{1}{\sigma_i} A v_i → UU.
  5. Then A=UΣVTA = U \Sigma V^T.

Apply.

Step 1. ATA=(3405)(3045)=(25202025)A^T A = \begin{pmatrix} 3 & 4 \\ 0 & 5 \end{pmatrix} \begin{pmatrix} 3 & 0 \\ 4 & 5 \end{pmatrix} = \begin{pmatrix} 25 & 20 \\ 20 & 25 \end{pmatrix}.

Step 2. det⁡(ATA−λI)=(25−λ)2−400=0⇒λ=45 or 5\det(A^T A - \lambda I) = (25 - \lambda)^2 - 400 = 0 \Rightarrow \lambda = 45 \text{ or } 5.

Eigenvectors:

  • λ=45\lambda = 45: v1=12(1,1)Tv_1 = \frac{1}{\sqrt 2}(1, 1)^T.
  • λ=5\lambda = 5: v2=12(1,−1)Tv_2 = \frac{1}{\sqrt 2}(1, -1)^T.

Step 3. σ1=45=35,  σ2=5\sigma_1 = \sqrt{45} = 3\sqrt 5, \; \sigma_2 = \sqrt 5.

Step 4. Left singular vectors: u1=135Av1=135⋅12(39)=110(1,3)Tu_1 = \dfrac{1}{3\sqrt 5} A v_1 = \dfrac{1}{3\sqrt 5} \cdot \dfrac{1}{\sqrt 2}\begin{pmatrix} 3 \\ 9 \end{pmatrix} = \dfrac{1}{\sqrt{10}}(1, 3)^T.

u2=15Av2=15⋅12(3−1)=110(3,−1)Tu_2 = \dfrac{1}{\sqrt 5} A v_2 = \dfrac{1}{\sqrt 5} \cdot \dfrac{1}{\sqrt 2}\begin{pmatrix} 3 \\ -1 \end{pmatrix} = \dfrac{1}{\sqrt{10}}(3, -1)^T.

Result. U=110(133−1),  Σ=(35005),  V=12(111−1)U = \dfrac{1}{\sqrt{10}}\begin{pmatrix} 1 & 3 \\ 3 & -1 \end{pmatrix}, \; \Sigma = \begin{pmatrix} 3\sqrt 5 & 0 \\ 0 & \sqrt 5 \end{pmatrix}, \; V = \dfrac{1}{\sqrt 2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.

Theorem. For an m×nm \times n matrix AA: rank(A)+nullity(A)=n\text{rank}(A) + \text{nullity}(A) = n.

Proof. Let kk = nullity, {v1,…,vk}\{v_1, \dots, v_k\} a basis of N(A)N(A). Extend to basis {v1,…,vn}\{v_1, \dots, v_n\} of Rn\mathbb{R}^n.

Claim: {Avk+1,…,Avn}\{A v_{k+1}, \dots, A v_n\} is a basis of the column space.

  • Spans: any AvA v has v=∑civiv = \sum c_i v_i, so Av=∑i>kciAviA v = \sum_{i>k} c_i A v_i (first kk killed).
  • Independent: if ∑i>kciAvi=0\sum_{i>k} c_i A v_i = 0 then A(∑i>kcivi)=0A(\sum_{i>k} c_i v_i) = 0, so this lies in N(A)N(A). But it's in the complement basis, so all ci=0c_i = 0.

Hence rank = n−kn - k, giving rank + nullity = nn. ∎

Apply. Row-reduce: (123246369)→R2−2R1, R3−3R1(123000000)\begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 3 & 6 & 9 \end{pmatrix} \xrightarrow{R_2 - 2R_1,\, R_3 - 3R_1} \begin{pmatrix} 1 & 2 & 3 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}

One non-zero row ⇒ rank = 1. By rank-nullity: nullity = 3 - 1 = 2.

Null space spanned by (2,−1,0)T(2, -1, 0)^T and (3,0,−1)T(3, 0, -1)^T (or similar two-vector basis).

Inner product. For x,y∈Rnx, y \in \mathbb{R}^n: ⟨x,y⟩=∑xiyi\langle x, y \rangle = \sum x_i y_i. Satisfies bilinearity, symmetry, positivity. Induces norm ∥x∥=⟨x,x⟩\|x\| = \sqrt{\langle x, x \rangle} and angle cos⁡θ=⟨x,y⟩∥x∥∥y∥\cos\theta = \dfrac{\langle x, y \rangle}{\|x\| \|y\|}.

Cosine similarity = cos⁡θ\cos\theta — scale-invariant. Used for text similarity, embeddings, recommender systems.

Distance metrics. Take x=(1,2)x = (1, 2), y=(4,6)y = (4, 6).

MetricFormulaValueUse
Euclidean (L2L_2)∑(xi−yi)2\sqrt{\sum (x_i - y_i)^2}9+16=5\sqrt{9 + 16} = 5k-means, k-NN, generic
Manhattan (L1L_1)$\sumx_i - y_i$
Cosine1−x⋅y∥x∥∥y∥1 - \dfrac{x \cdot y}{\|x\|\|y\|}1−16260≈0.0081 - \frac{16}{\sqrt{260}} \approx 0.008Text, embeddings, direction matters
Mahalanobis(x−y)TΣ−1(x−y)\sqrt{(x-y)^T \Sigma^{-1}(x-y)}depends on Σ\SigmaCorrelated features, anomaly detection

Summary. Euclidean is the default; Manhattan when outliers; Cosine for direction; Mahalanobis when features are correlated/have different scales.

Module 4 — Vectors and Geometry of Space

Dot product. a⃗⋅b⃗=∥a⃗∥∥b⃗∥cos⁡θ\vec{a} \cdot \vec{b} = \|\vec{a}\| \|\vec{b}\| \cos\theta. With basis i^,j^,k^\hat i, \hat j, \hat k where i^⋅i^=1,i^⋅j^=0\hat i \cdot \hat i = 1, \hat i \cdot \hat j = 0, expansion gives a⃗⋅b⃗=a1b1+a2b2+a3b3\vec{a} \cdot \vec{b} = a_1 b_1 + a_2 b_2 + a_3 b_3.

Cross product. a⃗×b⃗\vec{a} \times \vec{b} is perpendicular to both, magnitude ∥a⃗∥∥b⃗∥sin⁡θ\|\vec a\| \|\vec b\| \sin\theta, direction by right-hand rule. Using i^×j^=k^\hat i \times \hat j = \hat k etc: a⃗×b⃗=∣i^j^k^a1a2a3b1b2b3∣\vec{a} \times \vec{b} = \begin{vmatrix} \hat i & \hat j & \hat k \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{vmatrix}.

Computations.

Dot: (2)(1)+(−1)(3)+(1)(−2)=2−3−2=−3(2)(1) + (-1)(3) + (1)(-2) = 2 - 3 - 2 = -3.

Cross: a⃗×b⃗=∣i^j^k^2−1113−2∣\vec{a} \times \vec{b} = \begin{vmatrix} \hat i & \hat j & \hat k \\ 2 & -1 & 1 \\ 1 & 3 & -2 \end{vmatrix} =i^((−1)(−2)−(1)(3))−j^((2)(−2)−(1)(1))+k^((2)(3)−(−1)(1))= \hat i((-1)(-2) - (1)(3)) - \hat j((2)(-2) - (1)(1)) + \hat k((2)(3) - (-1)(1)) =i^(2−3)−j^(−4−1)+k^(6+1)=(−1,5,7)= \hat i(2 - 3) - \hat j(-4 - 1) + \hat k(6 + 1) = (-1, 5, 7).

Magnitudes: ∥a⃗∥=4+1+1=6\|\vec a\| = \sqrt{4 + 1 + 1} = \sqrt 6, ∥b⃗∥=1+9+4=14\|\vec b\| = \sqrt{1 + 9 + 4} = \sqrt{14}.

Angle: cos⁡θ=−3614=−384≈−0.327\cos\theta = \dfrac{-3}{\sqrt 6 \sqrt{14}} = \dfrac{-3}{\sqrt{84}} \approx -0.327. θ≈109.1°\theta \approx 109.1°.

Parallelogram area: ∥a⃗×b⃗∥=1+25+49=75=53≈8.66\|\vec a \times \vec b\| = \sqrt{1 + 25 + 49} = \sqrt{75} = 5\sqrt 3 \approx 8.66.

Derivation. For plane Π:ax+by+cz+d=0\Pi: ax + by + cz + d = 0 with normal n⃗=(a,b,c)\vec{n} = (a, b, c), and point P0(x0,y0,z0)P_0(x_0, y_0, z_0). Let QQ = foot of perpendicular from P0P_0 to Π\Pi. Then P0Q⃗=λn⃗\vec{P_0 Q} = \lambda \vec{n}, so Q=P0+λn⃗Q = P_0 + \lambda \vec{n}. Substituting into the plane:

a(x0+λa)+b(y0+λb)+c(z0+λc)+d=0a(x_0 + \lambda a) + b(y_0 + \lambda b) + c(z_0 + \lambda c) + d = 0 ⇒λ=−ax0+by0+cz0+da2+b2+c2\Rightarrow \lambda = -\dfrac{a x_0 + b y_0 + c z_0 + d}{a^2 + b^2 + c^2}.

Distance = ∣λ∣∥n⃗∥=∣ax0+by0+cz0+d∣a2+b2+c2|\lambda| \|\vec{n}\| = \dfrac{|a x_0 + b y_0 + c z_0 + d|}{\sqrt{a^2 + b^2 + c^2}}. ∎

Plane through P,Q,RP, Q, R.

Edge vectors: PQ⃗=(2,−1,−1)\vec{PQ} = (2, -1, -1), PR⃗=(−1,1,2)\vec{PR} = (-1, 1, 2).

Normal n⃗=PQ⃗×PR⃗\vec{n} = \vec{PQ} \times \vec{PR}: n⃗=∣i^j^k^2−1−1−112∣\vec{n} = \begin{vmatrix} \hat i & \hat j & \hat k \\ 2 & -1 & -1 \\ -1 & 1 & 2 \end{vmatrix} =i^((−1)(2)−(−1)(1))−j^((2)(2)−(−1)(−1))+k^((2)(1)−(−1)(−1))= \hat i((-1)(2) - (-1)(1)) - \hat j((2)(2) - (-1)(-1)) + \hat k((2)(1) - (-1)(-1)) =i^(−1)−j^(3)+k^(1)=(−1,−3,1)= \hat i(-1) - \hat j(3) + \hat k(1) = (-1, -3, 1).

Plane equation using P(1,1,2)P(1, 1, 2): −(x−1)−3(y−1)+(z−2)=0-(x - 1) - 3(y - 1) + (z - 2) = 0 −x+1−3y+3+z−2=0-x + 1 - 3y + 3 + z - 2 = 0 x+3y−z=2\boxed{x + 3y - z = 2} (after multiplying by −1-1).

Distance from origin. d=∣0+0−0−2∣1+9+1=211≈0.603d = \dfrac{|0 + 0 - 0 - 2|}{\sqrt{1 + 9 + 1}} = \dfrac{2}{\sqrt{11}} \approx 0.603.

Derivation. For skew lines L1:r⃗1+td⃗1L_1: \vec{r}_1 + t \vec{d}_1 and L2:r⃗2+sd⃗2L_2: \vec{r}_2 + s \vec{d}_2.

The common perpendicular direction is n⃗=d⃗1×d⃗2\vec{n} = \vec{d}_1 \times \vec{d}_2. The shortest distance equals the absolute projection of (r⃗2−r⃗1)(\vec{r}_2 - \vec{r}_1) onto n⃗\vec{n}:

d=∣(r⃗2−r⃗1)⋅(d⃗1×d⃗2)∣∥d⃗1×d⃗2∥.d = \dfrac{|(\vec{r}_2 - \vec{r}_1) \cdot (\vec{d}_1 \times \vec{d}_2)|}{\|\vec{d}_1 \times \vec{d}_2\|}.

Apply. d⃗1=(1,−1,2)\vec{d}_1 = (1, -1, 2), d⃗2=(2,1,−1)\vec{d}_2 = (2, 1, -1), r⃗2−r⃗1=(1,−2,−2)\vec{r}_2 - \vec{r}_1 = (1, -2, -2).

d⃗1×d⃗2=∣i^j^k^1−1221−1∣\vec{d}_1 \times \vec{d}_2 = \begin{vmatrix} \hat i & \hat j & \hat k \\ 1 & -1 & 2 \\ 2 & 1 & -1 \end{vmatrix} =i^((−1)(−1)−(2)(1))−j^((1)(−1)−(2)(2))+k^((1)(1)−(−1)(2))= \hat i((-1)(-1) - (2)(1)) - \hat j((1)(-1) - (2)(2)) + \hat k((1)(1) - (-1)(2)) =i^(−1)−j^(−5)+k^(3)=(−1,5,3)= \hat i(-1) - \hat j(-5) + \hat k(3) = (-1, 5, 3).

∥d⃗1×d⃗2∥=1+25+9=35\|\vec{d}_1 \times \vec{d}_2\| = \sqrt{1 + 25 + 9} = \sqrt{35}.

(r⃗2−r⃗1)⋅(d⃗1×d⃗2)=(1)(−1)+(−2)(5)+(−2)(3)=−1−10−6=−17(\vec{r}_2 - \vec{r}_1) \cdot (\vec{d}_1 \times \vec{d}_2) = (1)(-1) + (-2)(5) + (-2)(3) = -1 - 10 - 6 = -17.

d=1735≈2.873d = \dfrac{17}{\sqrt{35}} \approx 2.873.

Scalar triple product. [a⃗,b⃗,c⃗]=a⃗⋅(b⃗×c⃗)[\vec{a}, \vec{b}, \vec{c}] = \vec{a} \cdot (\vec{b} \times \vec{c}).

Geometric meaning. Base = parallelogram with edges b⃗,c⃗\vec{b}, \vec{c}, area ∥b⃗×c⃗∥\|\vec{b} \times \vec{c}\|, and b⃗×c⃗\vec{b} \times \vec{c} perpendicular to it. The height equals the projection of a⃗\vec{a} onto b⃗×c⃗\vec{b} \times \vec{c}. Hence

Volume = base × height = ∥b⃗×c⃗∥⋅∣a⃗⋅(b⃗×c⃗)∣∥b⃗×c⃗∥=∣a⃗⋅(b⃗×c⃗)∣\|\vec{b} \times \vec{c}\| \cdot \dfrac{|\vec{a} \cdot (\vec{b} \times \vec{c})|}{\|\vec{b} \times \vec{c}\|} = |\vec{a} \cdot (\vec{b} \times \vec{c})|.

Equivalently as a determinant: [a⃗,b⃗,c⃗]=det⁡(a1a2a3b1b2b3c1c2c3)[\vec{a}, \vec{b}, \vec{c}] = \det\begin{pmatrix} a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \\ c_1 & c_2 & c_3 \end{pmatrix}.

If this determinant is zero, the three vectors are coplanar.

Apply. det⁡(102210031)=1⋅(1−0)−0+2⋅(6−0)=1+12=13\det\begin{pmatrix} 1 & 0 & 2 \\ 2 & 1 & 0 \\ 0 & 3 & 1 \end{pmatrix} = 1 \cdot (1 - 0) - 0 + 2 \cdot (6 - 0) = 1 + 12 = 13.

Volume = ∣13∣=13|13| = 13 cubic units.

Since the determinant is non-zero, the three vectors are not coplanar — they truly span a 3D parallelepiped.

Module 5 — Probability Theory

Bayes' theorem. If {B1,…,Bn}\{B_1, \dots, B_n\} partitions Ω\Omega with P(Bi)>0P(B_i) > 0 and AA has P(A)>0P(A) > 0: P(Bk∣A)=P(A∣Bk)P(Bk)∑iP(A∣Bi)P(Bi).P(B_k \mid A) = \dfrac{P(A \mid B_k) P(B_k)}{\sum_i P(A \mid B_i) P(B_i)}.

Proof. From definition: P(Bk∩A)=P(A∣Bk)P(Bk)=P(Bk∣A)P(A)P(B_k \cap A) = P(A \mid B_k) P(B_k) = P(B_k \mid A) P(A). So P(Bk∣A)=P(A∣Bk)P(Bk)P(A)P(B_k \mid A) = \dfrac{P(A \mid B_k) P(B_k)}{P(A)}. By law of total probability: P(A)=∑iP(A∣Bi)P(Bi)P(A) = \sum_i P(A \mid B_i) P(B_i). Substituting gives Bayes' formula. ∎

Disease problem.

Let DD = "has disease", TT = "tests positive". Given:

  • P(D)=0.01,  P(Dc)=0.99P(D) = 0.01, \; P(D^c) = 0.99.
  • Sensitivity: P(T∣D)=0.95P(T \mid D) = 0.95.
  • Specificity: P(Tc∣Dc)=0.90P(T^c \mid D^c) = 0.90, so false-positive P(T∣Dc)=0.10P(T \mid D^c) = 0.10.

Total probability: P(T)=(0.95)(0.01)+(0.10)(0.99)=0.0095+0.099=0.1085P(T) = (0.95)(0.01) + (0.10)(0.99) = 0.0095 + 0.099 = 0.1085.

Bayes: P(D∣T)=(0.95)(0.01)0.1085=0.00950.1085≈0.0876P(D \mid T) = \dfrac{(0.95)(0.01)}{0.1085} = \dfrac{0.0095}{0.1085} \approx 0.0876.

So only about 8.76% chance the patient actually has the disease! Even a highly accurate test fails when the disease is rare — false positives dominate. This is the base-rate fallacy.

Types of random variables.

A random variable X:Ω→RX: \Omega \to \mathbb{R} assigns a real number to each outcome. Two main types:

Discrete RV. Takes countably many values. Described by PMF p(x)=P(X=x)p(x) = P(X = x) with ∑xp(x)=1\sum_x p(x) = 1.

Continuous RV. Takes values in an interval. Described by PDF f(x)≥0f(x) \ge 0 with ∫f=1\int f = 1.

Distributions.

DistributionPMF / PDFMeanVarianceUse
Bernoulli(p)(p)P(X=1)=p,P(X=0)=1−pP(X = 1) = p, P(X = 0) = 1 - pppp(1−p)p(1-p)Single yes/no trial
Binomial(n,p)(n, p)(nk)pk(1−p)n−k\binom{n}{k} p^k (1-p)^{n-k}npnpnp(1−p)np(1-p)# successes in nn trials
Poisson(λ)(\lambda)e−λλk/k!e^{-\lambda} \lambda^k / k!λ\lambdaλ\lambdaRare event counts
Uniform(a,b)(a, b)1b−a\dfrac{1}{b-a} on [a,b][a,b]a+b2\dfrac{a+b}{2}(b−a)212\dfrac{(b-a)^2}{12}Equal-likelihood
Exponential(λ)(\lambda)λe−λx,x≥0\lambda e^{-\lambda x}, x \ge 01/λ1/\lambda1/λ21/\lambda^2Waiting times
Normal(μ,σ2)(\mu, \sigma^2)1σ2πe−(x−μ)2/(2σ2)\dfrac{1}{\sigma\sqrt{2\pi}} e^{-(x-\mu)^2 / (2\sigma^2)}μ\muσ2\sigma^2Natural variation, errors

Importance. Bernoulli is the basic unit; Binomial = sum of nn Bernoullis. Poisson approximates Binomial when nn large, pp small with np=λnp = \lambda. The Normal arises naturally by the Central Limit Theorem — sums of many independent random variables tend to Normal regardless of original distribution.

Algorithm. Given target density f(x)f(x), easy-to-sample proposal g(x)g(x), and constant MM with Mg(x)≥f(x)M g(x) \ge f(x) for all xx:

loop:
    X ~ g
    U ~ Uniform(0, 1)
    if U <= f(X) / (M * g(X)):  accept X, return
    else:                       reject, repeat

Proof. Let AA = "accept this iteration".

P(A,X≤x)=∫−∞xg(y)⋅f(y)Mg(y)dy=F(x)MP(A, X \le x) = \int_{-\infty}^x g(y) \cdot \dfrac{f(y)}{M g(y)} dy = \dfrac{F(x)}{M}.

So P(A)=1/MP(A) = 1/M and P(X≤x∣A)=F(x)P(X \le x \mid A) = F(x) — accepted XX has the target CDF. ∎

Application. Target f(x)∝e−x2/2f(x) \propto e^{-x^2/2} on [0,1][0, 1]. Normalisation: ∫01e−x2/2dx≈0.8556\int_0^1 e^{-x^2/2} dx \approx 0.8556, so f(x)=e−x2/2/0.8556f(x) = e^{-x^2/2}/0.8556 for x∈[0,1]x \in [0, 1].

Proposal: g(x)=1g(x) = 1 (uniform on [0,1][0, 1]).

ff is maximised at x=0x = 0: f(0)=1/0.8556≈1.169f(0) = 1/0.8556 \approx 1.169. So M=1.17M = 1.17 works.

Algorithm:

  1. X∼Uniform(0,1)X \sim \text{Uniform}(0, 1).
  2. U∼Uniform(0,1)U \sim \text{Uniform}(0, 1).
  3. Accept if U≤f(X)/1.17U \le f(X) / 1.17.

Acceptance rate ≈1/1.17≈85%\approx 1/1.17 \approx 85\% — very efficient.

Variance identity. Var(X)=E[(X−μ)2]=E[X2−2μX+μ2]=E[X2]−2μE[X]+μ2=E[X2]−μ2\text{Var}(X) = E[(X - \mu)^2] = E[X^2 - 2\mu X + \mu^2] = E[X^2] - 2\mu E[X] + \mu^2 = E[X^2] - \mu^2. ∎

Linearity of expectation. For any random variables X,YX, Y and scalars a,ba, b: E[aX+bY]=aE[X]+bE[Y]E[a X + b Y] = a E[X] + b E[Y].

This holds without any independence assumption. For variance, Var(X+Y)=Var(X)+Var(Y)\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y) requires X⊥YX \perp Y.

Binomial mean and variance via linearity.

Write X=X1+X2+⋯+XnX = X_1 + X_2 + \dots + X_n, where each Xi∼Bernoulli(p)X_i \sim \text{Bernoulli}(p) independent.

Mean. E[Xi]=pE[X_i] = p. By linearity: E[X]=∑E[Xi]=npE[X] = \sum E[X_i] = n p.

Variance. Var(Xi)=p(1−p)\text{Var}(X_i) = p(1-p). By independence: Var(X)=∑Var(Xi)=np(1−p)\text{Var}(X) = \sum \text{Var}(X_i) = n p (1 - p).

For n=20,p=0.4n = 20, p = 0.4.

  • Mean = 20×0.4=820 \times 0.4 = 8.
  • Variance = 20×0.4×0.6=4.820 \times 0.4 \times 0.6 = 4.8.
  • Standard deviation = 4.8≈2.19\sqrt{4.8} \approx 2.19.

So a Binomial(20,0.4)(20, 0.4) has expected value 8 and typical fluctuations of about ±2.2\pm 2.2 around 8.

End of question bank. Total: 100 Part-A (200 marks possible) + 20 Part-B (400 marks possible) = 600 marks of practice material. All five modules covered with 20 + 4 questions each.