∑GATE DA Atlas

Formula sheet

Every formula, fact and complexity bound from the guide on one page, organised by syllabus section, for last-week revision. Each section links back to the full pages.

Probability and statistics

Counting — n!n! · nPr=n!(n−r)!^nP_r = \tfrac{n!}{(n-r)!} · (nr)=n!r!(n−r)!\binom nr = \tfrac{n!}{r!(n-r)!} · repetition allowed: (n+r−1r)\binom{n+r-1}{r} · derangements Dn=n!∑k=0n(−1)kk!D_n = n!\sum_{k=0}^n\tfrac{(-1)^k}{k!} · inclusion–exclusion ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A\cup B| = |A| + |B| - |A\cap B|.

Rules — P(A∪B)=P(A)+P(B)−P(A∩B)P(A\cup B) = P(A) + P(B) - P(A\cap B) · P(A∣B)=P(A∩B)P(B)P(A\mid B) = \tfrac{P(A\cap B)}{P(B)} · independent: P(A∩B)=P(A)P(B)P(A\cap B) = P(A)P(B) · total probability P(B)=∑iP(B∣Ai)P(Ai)P(B) = \sum_i P(B\mid A_i)P(A_i) · Bayes P(Ai∣B)=P(B∣Ai)P(Ai)∑jP(B∣Aj)P(Aj)P(A_i\mid B) = \tfrac{P(B\mid A_i)P(A_i)}{\sum_j P(B\mid A_j)P(A_j)}.

Expectation and variance — E[aX+b]=aE[X]+bE[aX + b] = aE[X] + b · Var(X)=E[X2]−(E[X])2\text{Var}(X) = E[X^2] - (E[X])^2 · Var(aX+b)=a2Var(X)\text{Var}(aX + b) = a^2\text{Var}(X) · Var(X+Y)=VarX+VarY+2Cov(X,Y)\text{Var}(X + Y) = \text{Var}X + \text{Var}Y + 2\text{Cov}(X, Y) · Cov(X,Y)=E[XY]−E[X]E[Y]\text{Cov}(X, Y) = E[XY] - E[X]E[Y] · ρ=CovσXσY∈[−1,1]\rho = \tfrac{\text{Cov}}{\sigma_X\sigma_Y} \in [-1, 1].

DistributionPMF / PDFMeanVariance
Bernoulli(pp)px(1−p)1−xp^x(1-p)^{1-x}ppp(1−p)p(1-p)
Binomial(n,pn, p)(nx)px(1−p)n−x\binom nx p^x(1-p)^{n-x}npnpnp(1−p)np(1-p)
Geometric(pp), trials to 1st success(1−p)x−1p(1-p)^{x-1}p1/p1/p(1−p)/p2(1-p)/p^2
Poisson(λ\lambda)e−λλx/x!e^{-\lambda}\lambda^x/x!λ\lambdaλ\lambda
Uniform(a,ba, b)1b−a\tfrac1{b-a}a+b2\tfrac{a+b}2(b−a)212\tfrac{(b-a)^2}{12}
Exponential(λ\lambda)λe−λx\lambda e^{-\lambda x}1/λ1/\lambda1/λ21/\lambda^2
Normal(μ,σ2\mu, \sigma^2)1σ2πe−(x−μ)2/2σ2\tfrac1{\sigma\sqrt{2\pi}}e^{-(x-\mu)^2/2\sigma^2}μ\muσ2\sigma^2

Memoryless: geometric and exponential. Normal: 68–95–99.7 rule; z=(x−μ)/σz = (x - \mu)/\sigma; z0.025=1.96z_{0.025} = 1.96, z0.05=1.645z_{0.05} = 1.645.

Inference — Xˉ∼N(μ,σ2/n)\bar X \sim N(\mu, \sigma^2/n) (CLT) · standard error σ/n\sigma/\sqrt n · CI xˉ±zα/2σ/n\bar x \pm z_{\alpha/2}\sigma/\sqrt n (use tn−1t_{n-1} and ss when σ\sigma unknown) · sample variance s2=1n−1∑(xi−xˉ)2s^2 = \tfrac1{n-1}\sum(x_i - \bar x)^2 · z=xˉ−μ0σ/nz = \tfrac{\bar x - \mu_0}{\sigma/\sqrt n} · t=xˉ−μ0s/nt = \tfrac{\bar x - \mu_0}{s/\sqrt n} · χ2=∑(O−E)2E\chi^2 = \sum\tfrac{(O - E)^2}{E} · Type I error =α= \alpha, Type II =β= \beta, power =1−β= 1 - \beta.

Full pages: Probability & Statistics.

Linear algebra

  • Subspace: contains 0\mathbf 0, closed under ++ and scalar multiplication. Basis = linearly independent spanning set.
  • Rank–nullity: rank(A)+nullity(A)=n\text{rank}(A) + \text{nullity}(A) = n (number of columns). Row rank = column rank.
  • Ax=bA\mathbf x = \mathbf b is consistent iff rank(A)=rank([A∣b])\text{rank}(A) = \text{rank}([A\mid\mathbf b]); unique iff also =n= n.
  • 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 · triangular: product of the diagonal.
  • Eigenvalues: det⁡(A−λI)=0\det(A - \lambda I) = 0 · ∑λi=tr(A)\sum\lambda_i = \text{tr}(A) · ∏λi=det⁡A\prod\lambda_i = \det A · eigenvalues of AkA^k: λk\lambda^k; of A−1A^{-1}: 1/λ1/\lambda; of A+cIA + cI: λ+c\lambda + c · triangular: diagonal entries · symmetric: real eigenvalues, orthogonal eigenvectors.
  • Diagonalisable iff nn independent eigenvectors (sufficient: nn distinct eigenvalues). A=PDP−1A = PDP^{-1}.
  • Special matrices: orthogonal QTQ=IQ^TQ = I (∣λ∣=1|\lambda| = 1, det⁡=±1\det = \pm1) · idempotent P2=PP^2 = P (λ∈{0,1}\lambda\in\{0, 1\}, rank = trace) · nilpotent (λ=0\lambda = 0) · projection onto the column space of AA: P=A(ATA)−1ATP = A(A^TA)^{-1}A^T; onto a\mathbf a: aaTaTa\tfrac{\mathbf a\mathbf a^T}{\mathbf a^T\mathbf a}.
  • Quadratic form xTAx\mathbf x^TA\mathbf x: positive definite iff all eigenvalues >0> 0 iff all leading principal minors >0> 0.
  • LU: A=LUA = LU (Gaussian elimination). SVD: A=UΣVTA = U\Sigma V^T, singular values σi=λi(ATA)\sigma_i = \sqrt{\lambda_i(A^TA)}, rank = number of nonzero σi\sigma_i, best rank-kk approximation keeps the top kk.

Full pages: Linear Algebra.

Calculus and optimisation

  • Standard limits: lim⁡x→0sin⁡xx=1\lim_{x\to0}\tfrac{\sin x}{x} = 1, lim⁡ex−1x=1\lim\tfrac{e^x - 1}{x} = 1, lim⁡ln⁡(1+x)x=1\lim\tfrac{\ln(1+x)}{x} = 1, lim⁡x→∞(1+1x)x=e\lim_{x\to\infty}(1 + \tfrac1x)^x = e. L'Hôpital for 00\tfrac00 and ∞∞\tfrac\infty\infty.
  • Differentiable ⇒ continuous (not conversely: ∣x∣|x| at 0).
  • Mean value theorem: f′(c)=f(b)−f(a)b−af'(c) = \tfrac{f(b) - f(a)}{b - a} for some c∈(a,b)c\in(a, b).
  • Taylor: f(x)=∑kf(k)(a)k!(x−a)kf(x) = \sum_k\tfrac{f^{(k)}(a)}{k!}(x - a)^k. ex=∑xkk!e^x = \sum\tfrac{x^k}{k!} · sin⁡x=x−x33!+…\sin x = x - \tfrac{x^3}{3!} + \dots · cos⁡x=1−x22!+…\cos x = 1 - \tfrac{x^2}{2!} + \dots · ln⁡(1+x)=x−x22+x33−…\ln(1 + x) = x - \tfrac{x^2}2 + \tfrac{x^3}3 - \dots · 11−x=∑xk\tfrac1{1-x} = \sum x^k.
  • Extrema: f′(c)=0f'(c) = 0; f′′>0f'' > 0 min, f′′<0f'' < 0 max; if f′′=0f'' = 0 use the first nonzero higher derivative (even order → extremum). On [a,b][a, b] also check the endpoints.
  • Gradient descent xk+1=xk−ηf′(xk)x_{k+1} = x_k - \eta f'(x_k) · Newton xk+1=xk−f′(xk)/f′′(xk)x_{k+1} = x_k - f'(x_k)/f''(x_k). Convex: f′′≥0f'' \ge 0, every local minimum is global.
  • Integration by parts ∫u dv=uv−∫v du\int u\,dv = uv - \int v\,du · ∫0∞xne−xdx=n!\int_0^\infty x^ne^{-x}dx = n! · ∫−∞∞e−x2dx=π\int_{-\infty}^\infty e^{-x^2}dx = \sqrt\pi.

Full pages: Calculus.

Programming, data structures and algorithms

Algorithm / structureTimeNotes
Binary searchO(log⁡n)O(\log n)sorted array
Insertion sortO(n2)O(n^2), best O(n)O(n)stable, in place; adaptive
Selection sortO(n2)O(n^2) alwaysnot stable; at most n−1n - 1 swaps
Bubble sortO(n2)O(n^2), best O(n)O(n) with flagstable
Merge sortO(nlog⁡n)O(n\log n)stable, O(n)O(n) extra space
Quicksortavg O(nlog⁡n)O(n\log n), worst O(n2)O(n^2)in place, not stable
Heap: build / insert / extractO(n)O(n) / O(log⁡n)O(\log n) / O(log⁡n)O(\log n)
Hash tableavg O(1)O(1); chaining expected length α=n/m\alpha = n/m
BST searchO(h)O(h): O(log⁡n)O(\log n) balanced, O(n)O(n) worstinorder = sorted
BFS / DFSO(V+E)O(V + E)BFS gives shortest paths in unweighted graphs
Dijkstra (binary heap)O((V+E)log⁡V)O((V + E)\log V)no negative edges
Topological sortO(V+E)O(V + E)DAG only
Kruskal / PrimO(Elog⁡E)O(E\log E) / O(Elog⁡V)O(E\log V)minimum spanning tree
  • Comparison sorting lower bound Ω(nlog⁡n)\Omega(n\log n). Master theorem for T(n)=aT(n/b)+Θ(nd)T(n) = aT(n/b) + \Theta(n^d): d>log⁡bad > \log_b a → Θ(nd)\Theta(n^d); == → Θ(ndlog⁡n)\Theta(n^d\log n); << → Θ(nlog⁡ba)\Theta(n^{\log_b a}).
  • Binary tree: max nodes at height hh: 2h+1−12^{h+1} - 1; n0=n2+1n_0 = n_2 + 1; complete tree height ⌊log⁡2n⌋\lfloor\log_2 n\rfloor. Heap children of ii (0-based): 2i+12i + 1, 2i+22i + 2.
  • Graphs: ∑deg⁡=2E\sum\deg = 2E; a tree has V−1V - 1 edges; simple graph has at most (V2)\binom V2 edges.
  • Python: mutable default arguments persist; // floors toward −∞-\infty; slicing copies; is vs ==.

Full pages: Programming & DSA.

DBMS and warehousing

  • Keys: superkey ⊇ candidate key (minimal) ∋ primary key. Closure X+X^+ decides whether XX is a key.
  • Armstrong's axioms: reflexivity, augmentation, transitivity (+ union, decomposition, pseudo-transitivity).
  • Normal forms: 1NF atomic · 2NF no partial dependency on a key · 3NF for every X→AX\to A, XX superkey or AA prime · BCNF every X→AX\to A has XX superkey. Lossless join (binary) iff R1∩R2→R1R_1\cap R_2\to R_1 or →R2\to R_2.
  • Relational algebra: σ,π,×,⋈,∪,−,÷,ρ\sigma, \pi, \times, \bowtie, \cup, -, \div, \rho; ∣R×S∣=∣R∣∣S∣|R\times S| = |R||S|; natural join on no common attribute = cross product.
  • SQL: WHERE filters rows before grouping, HAVING filters groups; COUNT(*) counts NULLs, COUNT(col) does not; comparisons with NULL are unknown.
  • B+ tree of order pp: nodes hold ⌈p/2⌉\lceil p/2\rceil to pp pointers; all data at leaves. Index levels ≈⌈log⁡fanout(records)⌉\approx\lceil\log_{\text{fanout}}(\text{records})\rceil.
  • Normalisation of data: min–max x−min⁡max⁡−min⁡\tfrac{x - \min}{\max - \min}, z-score x−μσ\tfrac{x - \mu}{\sigma}. Warehousing: star schema (fact + denormalised dimensions), snowflake (normalised dimensions); OLAP roll-up, drill-down, slice, dice, pivot; a cube with nn dimensions has 2n2^n cuboids (without hierarchies).

Full pages: DBMS.

Machine learning

  • Linear regression: β^=(XTX)−1XTy\hat{\boldsymbol\beta} = (X^TX)^{-1}X^T\mathbf y; simple: β^1=Cov(x,y)Var(x)\hat\beta_1 = \tfrac{\text{Cov}(x, y)}{\text{Var}(x)}, β^0=yˉ−β^1xˉ\hat\beta_0 = \bar y - \hat\beta_1\bar x; R2=1−SSresSStotR^2 = 1 - \tfrac{SS_{res}}{SS_{tot}}.
  • Ridge: (XTX+λI)−1XTy(X^TX + \lambda I)^{-1}X^T\mathbf y (shrinks; never exactly zero) · Lasso (ℓ1\ell_1) gives sparsity.
  • Logistic: σ(z)=11+e−z\sigma(z) = \tfrac1{1 + e^{-z}}, σ′=σ(1−σ)\sigma' = \sigma(1 - \sigma); log-odds linear; cross-entropy loss; gradient XT(σ(Xw)−y)X^T(\sigma(X\mathbf w) - \mathbf y).
  • k-NN: no training; small kk → high variance, large kk → high bias. Naive Bayes: P(c∣x)∝P(c)∏jP(xj∣c)P(c\mid\mathbf x)\propto P(c)\prod_j P(x_j\mid c); Laplace smoothing njc+1nc+V\tfrac{n_{jc} + 1}{n_c + V}.
  • LDA: shared covariance → linear boundary; Fisher direction w∝SW−1(μ1−μ2)\mathbf w\propto S_W^{-1}(\boldsymbol\mu_1 - \boldsymbol\mu_2).
  • SVM: maximise margin 2∥w∥\tfrac2{\|\mathbf w\|} s.t. yi(wTxi+b)≥1y_i(\mathbf w^T\mathbf x_i + b)\ge1; hinge loss max⁡(0,1−yf(x))\max(0, 1 - yf(x)); kernels K(x,z)=ϕ(x)Tϕ(z)K(\mathbf x, \mathbf z) = \phi(\mathbf x)^T\phi(\mathbf z).
  • Trees: entropy H=−∑pilog⁡2piH = -\sum p_i\log_2 p_i, Gini 1−∑pi21 - \sum p_i^2, information gain =H(parent)−∑nknH(k)= H(\text{parent}) - \sum\tfrac{n_k}{n}H(k).
  • Bias–variance: E[(y−f^)2]=bias2+variance+σ2E[(y - \hat f)^2] = \text{bias}^2 + \text{variance} + \sigma^2. kk-fold CV trains kk models; LOOCV trains nn.
  • Neural networks: MLP with one hidden layer is a universal approximator; parameters of a dense layer =ninnout+nout= n_{in}n_{out} + n_{out}; ReLU max⁡(0,z)\max(0, z); backprop = chain rule.
  • k-means: minimises ∑∥x−μc(x)∥2\sum\|\mathbf x - \boldsymbol\mu_{c(\mathbf x)}\|^2, converges to a local optimum. Linkage: single (min), complete (max), average.
  • PCA: eigenvectors of the covariance matrix; variance explained by component kk = λk/∑λi\lambda_k/\sum\lambda_i.
  • Metrics: precision TPTP+FP\tfrac{TP}{TP + FP}, recall TPTP+FN\tfrac{TP}{TP + FN}, F1=2PRP+RF_1 = \tfrac{2PR}{P + R}, accuracy TP+TNall\tfrac{TP + TN}{\text{all}}.

Full pages: Machine Learning.

Artificial intelligence

SearchCompleteOptimalTimeSpace
BFSyes (bb finite)yes (unit costs)O(bd)O(b^d)O(bd)O(b^d)
Uniform-costyes (ϵ>0\epsilon > 0)yesO(b1+⌊C∗/ϵ⌋)O(b^{1 + \lfloor C^*/\epsilon\rfloor})same
DFSno (infinite / cycles)noO(bm)O(b^m)O(bm)O(bm)
Depth-limitednonoO(bℓ)O(b^\ell)O(bℓ)O(b\ell)
Iterative deepeningyesyes (unit costs)O(bd)O(b^d)O(bd)O(bd)
Greedy best-firstno (tree search)noO(bm)O(b^m)O(bm)O(b^m)
A*yesyes if hh admissible (tree) / consistent (graph)exponentialexponential
  • f=g+hf = g + h. Admissible: h(n)≤h∗(n)h(n)\le h^*(n). Consistent: h(n)≤c(n,n′)+h(n′)h(n)\le c(n, n') + h(n') (consistent ⇒ admissible). max⁡(h1,h2)\max(h_1, h_2) of admissible heuristics is admissible and dominates.
  • Minimax O(bm)O(b^m); alpha–beta with perfect ordering O(bm/2)O(b^{m/2}); prune when α≥β\alpha\ge\beta.
  • Logic: p→q≡¬p∨q≡¬q→¬pp\to q\equiv\neg p\vee q\equiv\neg q\to\neg p · KB ⊨α\models\alpha iff KB ∧¬α\wedge\neg\alpha unsatisfiable · resolution · Horn clauses: forward/backward chaining · ¬∀x P≡∃x ¬P\neg\forall x\,P\equiv\exists x\,\neg P · "All PP are QQ": ∀x(P→Q)\forall x(P\to Q); "Some PP are QQ": ∃x(P∧Q)\exists x(P\wedge Q).
  • Bayesian networks: P(x1..xn)=∏P(xi∣parents)P(x_1..x_n) = \prod P(x_i\mid\text{parents}); Boolean node with kk parents: 2k2^k numbers; chain/fork blocked by observing the middle; collider blocked unless it or a descendant is observed; Markov blanket = parents + children + co-parents.
  • Inference: P(X∣e)=α∑yP(X,e,y)P(X\mid\mathbf e) = \alpha\sum_{\mathbf y}P(X, \mathbf e, \mathbf y) · VE: multiply factors with HH, sum out HH · polytrees linear, general NP-hard · rejection sampling keeps fraction P(e)P(\mathbf e) · likelihood weighting w=∏P(ej∣parents)w = \prod P(e_j\mid\text{parents}) · Gibbs: sample from P(xi∣Markov blanket)P(x_i\mid\text{Markov blanket}).

Full pages: AI.

General aptitude

Successive % changes a+b+ab100a + b + \tfrac{ab}{100} · km/h × 5/18 = m/s · together aba+b\tfrac{ab}{a + b} · average speed 2uvu+v\tfrac{2uv}{u + v} · CI − SI (2 yrs) =P(R/100)2= P(R/100)^2 · clock angle ∣30H−5.5M∣|30H - 5.5M| · mirror clock 11:60−t11{:}60 - t · painted cube 8,12(n−2),6(n−2)2,(n−2)38, 12(n-2), 6(n-2)^2, (n-2)^3 · squares in an n×nn\times n grid ∑k2\sum k^2.

Full pages: General Aptitude.