GATE Data Science & AIGATE DA
Module 1 · Maths refreshers

The maths toolkit behind GATE DA

GATE DA leans on a compact set of maths tools. This module recaps them in one place: functions and logs, sums and sets, derivatives and integrals, vectors and matrices. Each chapter shows where the idea turns up in real GATE questions, so you know why you’re learning it.

New to this, or has it been years? Start at Chapter 1.1, which reads the symbols aloud, and take the warm-up problems at the top of each practice set before the harder ones. Words with a dotted underline can be tapped for a plain definition. Already comfortable with a chapter? Jump straight to its quiz: if you get it right, move on. Every later module builds on these ideas.

The route

    Start here if maths has been a while. The first chapter is a phrasebook for the symbols every later page uses: kinds of numbers, intervals, subscripts and Greek letters. Then come the two ideas every other module quietly depends on. First, functions and their graphs: lines, parabolas, absolute values and the piecewise functions that GATE uses to describe probabilities. Second, exponentials and logarithms, which run through the exponential distribution, the sigmoid in machine learning and entropy in decision trees.

    You need: arithmetic and the idea that a letter can stand for a number. That’s it.

    Reading maths: numbers, symbols and notation

    Maths is written in a compact shorthand, and once you can read each symbol aloud in plain words, a question that looked frightening becomes an ordinary sentence.

    Every later chapter uses things like $\R$, $[1, 3]$, $x_1$, $\lambda$ and $5!$ without stopping to explain them. This chapter is the phrasebook: twenty minutes here saves a lot of confusion later.

    It’s like learning to read a bowling figure: “4–0–28–2” looks cryptic until someone tells you it means overs, maidens, runs and wickets. After that you read it at a glance.

    Where it shows up in GATE DA

    In every question. None of it is asked on its own, but you can’t start a question you can’t read.

    2024 Q56 · “uniformly distributed in the interval [1, 3]”2025 Q21 · λ and ln2025 Q19 · F_X(x) with ≤2024 Q33 · f: ℝ → ℝ
    Heat: every question, as the language they are written in

    Why bother? Read one real sentence

    Here is how a 2024 exam question begins: "Let $X$ be a random variable uniformly distributed in the interval $[1, 3]$." Read slowly, it is only three ideas:

    • "$X$“ is a name for a number we don’t know yet, like ”the score in tomorrow’s match".
    • “uniformly distributed” means every value is equally likely (you’ll meet this properly in Probability).
    • "$[1, 3]$“ means ”any number from 1 to 3, including 1 and 3 themselves".

    So the sentence says: $X$ is a number somewhere between 1 and 3, and no part of that range is favoured. That’s the whole skill of this chapter: turning symbols back into words.

    Kinds of numbers

    Four families of numbers come up again and again. Each one contains the one before it.

    • Natural numbers $\N$: the counting numbers $1, 2, 3, \ldots$ (some books include 0). “How many tickets?” is a natural number.
    • Integers $\Z$: whole numbers, negatives included: $\ldots, -2, -1, 0, 1, 2, \ldots$ A team’s net run difference is an integer.
    • Rational numbers $\Q$: fractions of integers, like $\tfrac34$, $-\tfrac52$ or $0.25 = \tfrac14$.
    • Real numbers $\R$: every point on the number line, including numbers like $\sqrt2 \approx 1.414$ and $\pi \approx 3.1416$ that are not fractions. Heights, times and probabilities are real numbers.

    When you read "$x \in \R$“, say ”$x$ is a real number". The symbol $\in$ means “is a member of” (it’s a stylised E for “element”), and $\notin$ means “is not a member of”: $-3 \in \Z$ but $-3 \notin \N$.

    SymbolRead it asExample
    $=$, $\ne$equals, is not equal to$2 + 2 = 4$, $\ 3 \ne 4$
    $\approx$is approximately$\pi \approx 3.14$
    $\lt$, $\le$less than, less than or equal to$2 \lt 3$, $\ 3 \le 3$
    $\gt$, $\ge$greater than, greater than or equal to$x \ge 0$: “x is zero or more”
    $\pm$plus or minus (two answers)$\pm 3$ means $3$ or $-3$
    $|x|$the size of $x$, sign dropped$|-5| = 5$
    $\Rightarrow$implies, so$x = 2 \Rightarrow x^2 = 4$
    $\iff$if and only if (each implies the other)$2x = 6 \iff x = 3$
    $\infty$infinity: larger than any number (not a number itself)$[0, \infty)$: zero or more
    $n!$$n$ factorial$4! = 4\cdot3\cdot2\cdot1 = 24$
    Careful: $\Rightarrow$ only goes one way. $x = -2 \Rightarrow x^2 = 4$ is true, but $x^2 = 4$ does not force $x = -2$ (it could be $2$). That is why $\iff$ is a stronger statement.

    An interval is an unbroken stretch of the number line. A square bracket means the end is included; a round bracket means it is left out.

    • $[a, b]$: $a \le x \le b$, both ends in.
    • $(a, b)$: $a \lt x \lt b$, both ends out.
    • $[a, b)$: $a \le x \lt b$, left end in, right end out.
    • $[a, \infty)$: $x \ge a$, no upper limit. Infinity always gets a round bracket, because no number reaches it.
    Try it

    Choose a bracket style and move the ends. A filled dot means the end is included; a hollow dot means it’s left out. Drag the test point onto an end and watch it switch between “in” and “not in” as you change $[\,$ to $(\,$.

    Subscripts, indices and Greek letters

    A small number written low, as in $x_1$, is a subscript. It’s part of the name, not arithmetic: $x_1$ is “x one”, the first of several values $x_1, x_2, x_3, \ldots$ If a batter’s scores in five matches are 30, 12, 55, 0 and 41, then $x_3 = 55$. Two subscripts, as in $a_{23}$, give a row and a column in a table (row 2, column 3).

    A small number written high, as in $x^2$, is a power (“x squared”, $x \cdot x$). You’ll revise powers in the next chapter but one.

    Greek letters are simply more names. Each field has favourites, so seeing the letter tells you what kind of thing it probably is:

    LetterNameUsually means in this course
    $\mu$mu (“mew”)a mean (average)
    $\sigma$, $\Sigma$sigma (small, capital)$\sigma$: a standard deviation; $\Sigma$: “add these up”
    $\lambda$lambdaa rate (events per hour) or an eigenvalue
    $\theta$thetaan angle, or an unknown quantity we want to estimate
    $\alpha$, $\beta$alpha, betaconstants; $\alpha$ is also a test’s significance level
    $\eta$etathe learning rate in machine learning
    $\varepsilon$epsilona tiny amount, or random noise
    $\rho$rhoa correlation
    $\pi$pi$3.14159\ldots$, the circle constant (not a variable)

    Factorials, fractions and percentages

    The factorial $n!$ multiplies every whole number from $n$ down to 1: $5! = 5\cdot4\cdot3\cdot2\cdot1 = 120$. It counts the ways to put $n$ things in order (five batters can be arranged in 120 batting orders). By agreement $0! = 1$. Factorials grow fast, so cancel before multiplying: $\dfrac{6!}{4!} = \dfrac{6\cdot5\cdot\cancel{4!}}{\cancel{4!}} = 30$.

    Probabilities are written three ways, and you should switch between them without thinking: $\tfrac14 = 0.25 = 25\%$. To turn a fraction into a decimal, divide: $\tfrac38 = 3 \div 8 = 0.375$. To turn a decimal into a percentage, multiply by 100.

    Translate and solve: which integers $x$ satisfy $x \in (-2, 3]$? How many are there?

    1. Read the symbols: "$x$ is in the interval from $-2$ to $3$, with $-2$ left out and $3$ included", that is, $-2 \lt x \le 3$.

      Round bracket on the left means “not included”; square bracket on the right means “included”.

    2. “Integers” means whole numbers only. Walk along the number line from just after $-2$: $-1, 0, 1, 2, 3$.

      $-2$ itself is excluded by the round bracket; $3$ is included by the square one.

    3. There are 5 such integers.

      A quick check: $[-2, 3]$ would contain 6 integers ($-2$ to $3$); removing the left end leaves 5.

    How many integers lie in the interval $[-2, 3)$?

    The square bracket keeps $-2$; the round bracket drops $3$. List them.

    $-2, -1, 0, 1, 2$: five integers. $3$ is left out by the round bracket.

    Which inequality says the same thing as $x \in (0, 1]$?

    Round bracket: that end is left out (strict $\lt$). Square bracket: that end is included ($\le$).

    $(0$ means $0$ is excluded, so $0 \lt x$; $1]$ means $1$ is included, so $x \le 1$. Together: $0 \lt x \le 1$.

    Compute $\dfrac{5!}{3!}$.

    Write $5! = 5\cdot4\cdot3!$ and cancel the $3!$.

    $\dfrac{5\cdot4\cdot3!}{3!} = 5\cdot4 = 20$. (Directly: $120/6 = 20$.)

    Which of these are real numbers but not integers? (Select all that apply.)

    (A) $-3$   (B) $2.5$   (C) $\sqrt2$   (D) $\tfrac{7}{7}$

    Simplify each one first. An integer is a whole number, negative or not.

    (A) $-3$ is an integer. (B) $2.5$ is real, not whole ✓. (C) $\sqrt2 \approx 1.414$ is real, not whole ✓. (D) $\tfrac77 = 1$ is an integer.

    A bowler takes a wicket in 3 of every 8 overs. Write $\tfrac38$ as a decimal.

    Divide 3 by 8.

    $3 \div 8 = 0.375$, which is $37.5\%$.

    How many integers $n$ in the interval $(-3.5,\ 10]$ satisfy $\dfrac{n!}{(n-2)!} \le 30$? (A factorial $m!$ is defined only for whole numbers $m = 0, 1, 2, \ldots$)

    First decide which $n$ make both factorials meaningful. Then cancel the factorials to get a short product and test it against 30.

    Read the interval: $-3.5 \lt n \le 10$, so the integers in it are $-3, -2, \ldots, 10$.

    Both $n!$ and $(n-2)!$ must be defined, so $n - 2 \ge 0$, that is $n \ge 2$. That leaves $n = 2, 3, \ldots, 10$.

    Cancel: $\dfrac{n!}{(n-2)!} = \dfrac{n(n-1)\,(n-2)!}{(n-2)!} = n(n-1)$.

    Test: $2\cdot1 = 2$, $3\cdot2 = 6$, $4\cdot3 = 12$, $5\cdot4 = 20$, $6\cdot5 = 30$ are all at most 30, but $7\cdot6 = 42 \gt 30$, and the product only grows from there.

    So $n = 2, 3, 4, 5, 6$: 5 integers. (Counting 7 means $n = 0$ and $n = 1$ slipped in, where $(n-2)!$ has no meaning.)

    In 2025 the Nagpur Neural Nets won 40% of their 25 matches. In 2026 they played 20% more matches and won 50% of them. By what percentage did their number of wins rise from 2025 to 2026?

    1. 10%
    2. 25%
    3. 50%
    4. 45%

    Turn each percentage into an actual number of matches and wins before comparing anything. A percentage rise is (new − old) ÷ old.

    2025 wins: $0.40 \times 25 = 10$.

    2026 matches: $25 \times 1.20 = 30$. 2026 wins: $0.50 \times 30 = 15$.

    Rise: $\dfrac{15 - 10}{10} = 0.5 = 50\%$. Answer (C).

    (A) subtracts the win rates, $50 - 40 = 10$ percentage points, which is not a rise in wins. (B) compares the win rates, $50/40 = 1.25$, and forgets that more matches were played. (D) adds the two growth rates, $20\% + 25\%$; growth factors multiply instead: $1.20 \times 1.25 = 1.50$.

    Which of the following is/are true?

    1. $\dfrac{10!}{8!\,2!} + \dfrac{4!}{0!} = 69$.
    2. The interval $[2, 5)$ contains 4 integers.
    3. If $x_1 = 4$, $x_2 = -1$ and $x_3 = 7$, then $x_2^2 - x_1 x_3 = -27$.
    4. $x^2 = 9 \iff x = 3$.

    Cancel factorials before multiplying, and remember the agreed value of $0!$. Read a subscript as part of a name and a superscript as a power. For a two-way arrow, check both directions.

    (A) True. $\dfrac{10!}{8!\,2!} = \dfrac{10\cdot 9}{2} = 45$ and $\dfrac{4!}{0!} = \dfrac{24}{1} = 24$, so the total is $69$.

    (B) False. $[2, 5)$ means $2 \le x \lt 5$, so the integers are $2, 3, 4$: three of them. The round bracket leaves 5 out.

    (C) True. $x_2^2 = (-1)^2 = 1$ and $x_1x_3 = 4\cdot7 = 28$, so $1 - 28 = -27$.

    (D) False. $x = 3 \Rightarrow x^2 = 9$ is true, but $x^2 = 9$ also allows $x = -3$, so the arrow fails in the other direction.

    Correct: A, C.

    • Read every symbol aloud in words before doing anything else.
    • Check the brackets on an interval: square means the end counts, round means it doesn’t.
    • Cancel factorials before multiplying them out.
    • Reading $x_2$ as “x times 2” or “x squared”. A subscript is part of the name.
    • Writing $[0, \infty]$. Infinity is never included, so it always gets a round bracket.
    • Assuming $\Rightarrow$ works backwards. "$A \Rightarrow B$" says nothing about whether $B \Rightarrow A$.
    1. ℕ ⊂ ℤ ⊂ ℚ ⊂ ℝ: counting numbers, integers, fractions, and every point on the number line. “x ∈ ℝ” reads “x is a real number”.
    2. Intervals: square bracket = end included, round bracket = end left out; ∞ always gets a round bracket.
    3. Subscripts are names (x₁ is “the first x”), superscripts are powers, Greek letters are just more names, and n! = n·(n−1)·…·1 with 0! = 1.

    Which number is in $[2, 5)$ but not in $(2, 5)$?

    2
    The square bracket includes 2; the round bracket in $(2, 5)$ leaves it out.
    5
    Look at the right-hand bracket of $[2, 5)$: is 5 included?
    3.5
    3.5 is strictly between 2 and 5, so it’s in both intervals.
    4
    4 is inside both intervals. Look at the ends.

    In a list of scores $x_1, x_2, \ldots, x_{10}$, what is $x_3$?

    $x$ multiplied by 3
    A low number is a subscript, part of the name, not arithmetic.
    $x$ cubed
    Cubing would be a raised number, $x^3$.
    The third score in the list
    Subscripts label positions: $x_3$ is “x three”, the third value.
    The sum of the first three scores
    That would be $x_1 + x_2 + x_3$, written with $\Sigma$ in Part 2.

    $0!$ equals

    0
    It looks like it should be 0, but by agreement it is something else, so that counting formulas work.
    1
    By agreement $0! = 1$: there is exactly one way to arrange nothing.
    It isn’t defined
    It is defined, and counting formulas in Probability rely on it.
    $\infty$
    Factorials of small numbers are small.

    $|-7| + |2|$ equals

    $-5$
    The bars drop the sign before you add.
    5
    $|-7|$ is 7, not $-7$.
    9
    $7 + 2 = 9$.
    $-9$
    An absolute value is never negative.

    Functions: machines that turn one number into another

    A function takes an input number and returns exactly one output number, and its graph is a picture of every input–output pair at once.

    Probability distributions, loss functions, activation functions, eigenvalue equations: almost everything in GATE DA is a function. Reading one quickly is a skill you’ll use in every module.

    It’s like a vending machine: press button B4 and you always get the same snack. Same input, same output, every time.

    Where it shows up in GATE DA

    Rarely asked on its own, but used everywhere. Piecewise functions describe distributions and activations; you’ll need to read them fluently.

    2025 Q19 · piecewise CDF2025 Q39 · piecewise CDF2024 Q37 · piecewise continuity2025 Q48 · ReLU = max(x, 0)2024 Q23 · |h₁ − h₂|
    Heat: used in every paper as part of bigger questions

    Suppose the Data Premier League charges ₹200 per ticket, plus a ₹50 booking fee per order. If you buy $x$ tickets, you pay $200x + 50$ rupees. That rule is a function. We give it a name, say $f$, and write

    $$f(x) = 200x + 50.$$

    Read $f(x)$ as “f of x”: the output when the input is $x$. So $f(3) = 200\cdot 3 + 50 = 650$. The letter $x$ is just a placeholder; $f(t) = 200t + 50$ is the same function.

    The graph of $f$ is the set of all points $(x, f(x))$ drawn on a grid. The horizontal axis holds inputs and the vertical axis holds outputs. A graph lets you see a function’s whole behaviour at once: where it rises, where it falls, where it crosses zero.

    A function $f$ assigns to each allowed input $x$ exactly one output $f(x)$. The set of allowed inputs is the domain. "$f:\R\to\R$“ reads ”f takes a real number to a real number": inputs are real numbers, outputs are real numbers.

    The five shapes you’ll meet constantly

    • Line $f(x) = mx + c$. The slope $m$ says how much the output rises per unit step right; $c$ is where it crosses the vertical axis. Through two points $(x_1, y_1)$ and $(x_2, y_2)$ the slope is “rise over run”, $m = \dfrac{y_2 - y_1}{x_2 - x_1}$. The ticket function passes through $(1, 250)$ and $(3, 650)$, so $m = \dfrac{650 - 250}{3 - 1} = 200$: each extra ticket adds ₹200.
    • Parabola $f(x) = ax^2 + bx + c$. A U shape if $a \gt 0$, an upside-down U if $a \lt 0$. Its turning point (the vertex) sits at $x = -\dfrac{b}{2a}$.
    • Absolute value $|x|$: “drop the minus sign”. $|{-3}| = 3$, $|3| = 3$. Its graph is a V. Geometrically, $|a - b|$ is the distance between $a$ and $b$ on the number line.
    • ReLU $\max(0, x)$: zero for negative inputs, the input itself otherwise. It’s the most common activation function in neural networks.
    • Piecewise functions use different rules on different stretches of the input. ReLU is one; so is the ticket function above if bulk orders get a discount.
    Try it

    Pick a shape and move the sliders. Watch how each number changes the graph: for the parabola, see the vertex move as you change $b$; for the piecewise one, find where the graph reaches height ½ (you’ll need that in the GATE question below).

    Solving equations and inequalities

    "Solve $f(x) = k$" means: which inputs give output $k$? On the graph, draw a horizontal line at height $k$ and read off where it hits the curve.

    • Linear: $200x + 50 = 1050$ ⇒ $200x = 1000$ ⇒ $x = 5$. Do the same thing to both sides until $x$ is alone.
    • Quadratic: $ax^2 + bx + c = 0$ has solutions $x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a}$. The part under the root, $b^2 - 4ac$, is the discriminant: positive means two real roots, zero means one, negative means none (the parabola never touches the axis). You’ll meet this again with eigenvalues.
    • Inequalities work like equations, with one twist: multiplying or dividing both sides by a negative number flips the sign. $-2x \gt 6$ ⇒ $x \lt -3$.
    Careful: with fractions, cross-multiplying $\dfrac{p}{q} = \dfrac{r}{s}$ into $ps = qr$ is fine for equations. For inequalities it is only safe when you know the denominators are positive.
    GATE DA 2025 · Q19 · MCQ · 1 mark

    Let $X$ be a continuous random variable whose cumulative distribution function (CDF) $F_X(x)$, for some $t$, is given as follows:

    $$F_X(x) = \begin{cases} 0 & x \le t \\ \dfrac{x-t}{4-t} & t \le x \le 4 \\ 1 & x \ge 4 \end{cases}$$

    If the median of $X$ is 3, then what is the value of $t$?

    1. 2
    2. 1
    3. −1
    4. 0

    You don’t need to know what a CDF is yet (that’s Probability, Part 3). All you need: the median is the input where $F_X$ equals ½. Everything else is reading a piecewise function and solving an equation.

    1. The median is 3, so $F_X(3) = \tfrac12$.

      This is the one fact we’re given. It turns the question into an equation.

    2. Which piece applies at $x = 3$? The middle one, as long as $t \le 3 \le 4$. So $\dfrac{3-t}{4-t} = \dfrac12$.

      A piecewise function uses different formulas on different stretches. The outer pieces are flat at 0 and 1, and neither can equal ½, so it must be the middle piece.

    3. Cross-multiply: $2(3 - t) = 4 - t$ ⇒ $6 - 2t = 4 - t$ ⇒ $t = 2$.

      Safe for an equation. Collect the $t$ terms on one side: $6 - 4 = 2t - t$.

    4. Check: $t = 2 \le 3 \le 4$ ✓, and $F_X(3) = \tfrac{1}{2}$ ✓. Answer (A) 2.

      Always check that your answer is consistent with the assumption you made in step 2 (here, that 3 lies in the middle piece). On GATE, plugging your answer back in costs ten seconds and catches most slips. The official key agrees: (A).

    Go deeper: why the vertex is at −b/(2a)

    Complete the square: $ax^2 + bx + c = a\left(x + \frac{b}{2a}\right)^2 + c - \frac{b^2}{4a}$. A square is never negative, so if $a \gt 0$ the smallest value happens when the bracket is zero, at $x = -\frac{b}{2a}$. The same algebra, set equal to zero, gives the quadratic formula. In the calculus refresher you’ll get the same answer by setting the slope $2ax + b$ to zero.

    Warm-up. With $f(x) = 200x + 50$ (the ticket cost above), how many tickets did someone buy if they paid ₹1450?

    Solve $200x + 50 = 1450$: subtract 50, then divide by 200.

    $200x = 1400$, so $x = 7$. Check: $200\cdot7 + 50 = 1450$ ✓.

    Warm-up. A line passes through $(2, 5)$ and $(6, 13)$. What is its slope?

    Rise over run: (change in $y$) ÷ (change in $x$).

    $\dfrac{13 - 5}{6 - 2} = \dfrac{8}{4} = 2$. Each step right raises the line by 2.

    For $f(x) = x^2 - 6x + 5$, where is the vertex, and what is the lowest value $f$ reaches?

    Vertex at $x = -b/(2a)$ with $a = 1$, $b = -6$. Then plug that $x$ back into $f$.

    $x = -(-6)/(2\cdot 1) = 3$. Then $f(3) = 9 - 18 + 5 = -4$. Since $a = 1 \gt 0$ the parabola opens upward, so $-4$ is its lowest value.

    Solve $2x^2 - 3x - 2 = 0$. Enter the larger root.

    Use $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$ with $a=2$, $b=-3$, $c=-2$.

    Discriminant $= 9 + 16 = 25$, so $x = \frac{3 \pm 5}{4}$: $x = 2$ or $x = -\tfrac12$. The larger root is $2$. Check: $2\cdot4 - 6 - 2 = 0$ ✓.

    Which describes every $x$ with $-3x + 6 \gt 0$?

    Move the 6 across, then divide by −3, and remember what dividing by a negative does to the inequality sign.

    $-3x \gt -6$. Divide by $-3$ and flip the sign: $x \lt 2$. Check with $x = 0$: $6 \gt 0$ ✓; with $x = 3$: $-3 \gt 0$ ✗.

    A piecewise function is $f(x) = x + 1$ for $x \lt 1$ and $f(x) = ax$ for $x \ge 1$. For which $a$ do the two pieces meet at $x = 1$ (so the graph has no jump)?

    The left piece is heading towards $1 + 1$ as $x$ approaches 1. The right piece is $a \cdot 1$ at $x = 1$. Make them equal.

    Left piece at $x=1$: $1 + 1 = 2$. Right piece: $a \cdot 1 = a$. No jump means $a = 2$. This “make the pieces agree at the boundary” idea is exactly how GATE 2024 Q37 starts, which you’ll solve in Calculus 1.2.

    A function is defined in pieces: $f(x) = kx$ for $0 \le x \lt 2$, $f(x) = k(4 - x)$ for $2 \le x \le 4$, and $f(x) = 0$ everywhere else, where $k \gt 0$ is a constant. The total area between the graph of $f$ and the $x$-axis is 1. Find the area under the graph between $x = 0$ and $x = 3$.

    Sketch it: the graph is a triangle. Use the total area to find $k$. Then the small area to the right of $x = 3$ is easier to find, and you can subtract it.

    Both pieces give height $2k$ at $x = 2$, and the graph is at 0 at $x = 0$ and $x = 4$. So the graph is a triangle with base 4 and height $2k$.

    Total area $= \tfrac12 \cdot 4 \cdot 2k = 4k = 1$, so $k = \tfrac14$.

    To the right of $x = 3$ is a small triangle with base 1 (from 3 to 4) and height $f(3) = \tfrac14(4 - 3) = \tfrac14$. Its area is $\tfrac12 \cdot 1 \cdot \tfrac14 = \tfrac18$.

    Area from 0 to 3: $1 - \tfrac18 = \tfrac78 =$ 0.875. This is exactly how a probability density works: you’ll meet this triangle again in Probability.

    How many integers $x$ satisfy $x^2 - 5|x| + 4 \lt 0$?

    Since $x^2 = |x|^2$, write $t = |x|$. The inequality becomes a quadratic in $t$. Factorise it and ask where a U-shaped parabola dips below zero.

    Because $x^2 = |x|^2$, put $t = |x| \ge 0$: the inequality is $t^2 - 5t + 4 \lt 0$, that is $(t - 1)(t - 4) \lt 0$.

    This parabola opens upward and crosses zero at $t = 1$ and $t = 4$, so it is negative strictly between them: $1 \lt t \lt 4$.

    Whole-number values: $t = 2$ or $t = 3$. Each gives two values of $x$: $|x| = 2$ gives $x = \pm 2$ and $|x| = 3$ gives $x = \pm 3$.

    Check: $x = 2$ gives $4 - 10 + 4 = -2 \lt 0$; $x = 1$ gives $1 - 5 + 4 = 0$, which is not below zero. Answer: 4 integers ($-3, -2, 2, 3$). Getting 2 means forgetting the negative solutions of $|x| = t$.

    Let $f(x) = |x - 2| + |x + 1|$. Which of the following is/are true?

    1. The smallest value of $f$ is 3.
    2. The equation $f(x) = 5$ has exactly two solutions.
    3. $f$ reaches its smallest value at exactly one point.
    4. $f(x) = 2x - 1$ for every $x \ge 0$.

    $|x - a|$ is the distance from $x$ to $a$, so $f(x)$ is the total distance from $x$ to 2 and to $-1$. Split the number line at $-1$ and $2$ and write $f$ without bars on each piece.

    On each stretch, drop the bars with the right sign:

    • $x \lt -1$: $f(x) = (2 - x) + (-1 - x) = 1 - 2x$.
    • $-1 \le x \le 2$: $f(x) = (2 - x) + (x + 1) = 3$.
    • $x \gt 2$: $f(x) = (x - 2) + (x + 1) = 2x - 1$.

    (A) True. On the left piece $1 - 2x \gt 3$, on the right piece $2x - 1 \gt 3$, and the middle piece is exactly 3.

    (B) True. The middle piece is never 5. Left: $1 - 2x = 5$ gives $x = -2$, which is below $-1$ ✓. Right: $2x - 1 = 5$ gives $x = 3$, which is above 2 ✓.

    (C) False. Every $x$ in $[-1, 2]$ gives 3: a point between $-1$ and $2$ is always 3 away from the two ends in total.

    (D) False. The formula $2x - 1$ holds only for $x \ge 2$. At $x = 1$, $f(1) = 1 + 2 = 3$, but $2(1) - 1 = 1$.

    Correct: A, B.

    • Sketch the graph, even roughly, before solving. A picture tells you how many answers to expect.
    • For a piecewise function, first decide which piece applies, then use only that formula.
    • Plug your answer back in. It’s the cheapest check there is.
    • Forgetting to flip the inequality sign when multiplying or dividing by a negative number.
    • Writing $\sqrt{b^2 - 4ac}$ as $b - 2\sqrt{ac}$. Square roots don’t split over a minus.
    • Reading $f(x+1)$ as $f(x) + 1$. The first changes the input; the second changes the output.
    1. A function gives exactly one output per input; its graph shows all of them at once.
    2. Lines, parabolas, |x|, max(0, x) and piecewise rules cover most of what GATE uses. The parabola’s vertex is at x = −b/(2a).
    3. Solving f(x) = k means finding where a horizontal line at height k meets the graph. For piecewise functions, pick the right piece first.

    If $f(x) = 3x - 4$, what is $f(2) + f(0)$?

    2
    That’s $f(2)$ alone. Don’t forget to add $f(0)$.
    −2
    $f(2) = 2$ and $f(0) = -4$, so the sum is $-2$.
    6
    Evaluate each one separately: replace $x$ by 2, then by 0.
    −4
    That’s only $f(0)$.

    The parabola $y = -2x^2 + 8x + 1$ has its vertex at

    $x = -2$, a lowest point
    Check the sign in $-b/(2a)$: $b = 8$, $a = -2$.
    $x = 2$, a lowest point
    The position is right. But what does a negative $a$ do to the U shape?
    $x = 2$, a highest point
    $-8/(2\cdot -2) = 2$, and $a \lt 0$ means the parabola opens downward, so the vertex is a maximum.
    $x = 4$, a highest point
    Recompute $-b/(2a)$ carefully; the 2 in the denominator matters.

    $\max(0, x)$ (ReLU) evaluated at $x = -3$ and at $x = 3$ gives

    −3 and 3
    That’s just $x$. ReLU replaces negative inputs with something.
    0 and 3
    Negative inputs become 0; positive inputs pass through unchanged.
    3 and 3
    That would be $|x|$, the absolute value. ReLU doesn’t flip negatives, it zeroes them.
    0 and 0
    For positive inputs, ReLU returns the input itself.

    The equation $x^2 + 2x + 5 = 0$ has how many real solutions?

    Two
    Compute the discriminant $b^2 - 4ac$ before deciding.
    One
    One solution needs the discriminant to be exactly zero. Is it?
    None
    $4 - 20 = -16 \lt 0$: the parabola sits entirely above the axis. (It has two complex roots, which is the kind of thing GATE 2024 Q13 asks about eigenvalues.)
    Infinitely many
    A non-zero quadratic can cross the axis at most twice.

    Exponentials and logarithms: growth, decay and undoing them

    An exponential multiplies by the same factor at every step; a logarithm undoes that, answering “how many steps does it take?”

    The exponential distribution has appeared in every GATE DA paper so far, and you can’t touch it without $e^{-\lambda x}$ and $\ln$. The sigmoid in logistic regression and the entropy in decision trees are built from the same pieces.

    It’s like a rumour: each person tells two more, so the count doubles every round. The exponential tells you how many people know after 10 rounds; the logarithm tells you how many rounds until a million people know.

    Where it shows up in GATE DA

    Every paper. Most often inside exponential-distribution questions, where you solve $e^{-\lambda x} = p$ for $\lambda$ or $x$.

    2025 Q21 · solve e^(−2λ) = 0.252024 Q57 · exponential mean/variance2026 Q34 · memoryless property2025 Q41 · e^(−ln 10)2024 Q33 · sigmoid 1/(1+e^(−x))2024 Q62 · entropy with log₂2024 Q60 · ln limit
    Heat: every year, 2–6 marks

    Powers first

    $2^5$ means five 2s multiplied together: $2\cdot2\cdot2\cdot2\cdot2 = 32$. The small raised number is the exponent. Five rules cover nearly everything:

    RuleExampleWhy
    $a^m \cdot a^n = a^{m+n}$$2^3\cdot 2^2 = 2^5$3 twos then 2 more twos
    $(a^m)^n = a^{mn}$$(2^3)^2 = 2^6$two groups of three twos
    $a^0 = 1$$7^0 = 1$$a^n / a^n = a^{n-n}$
    $a^{-n} = 1/a^n$$2^{-3} = 1/8$dividing undoes multiplying
    $a^{1/2} = \sqrt a$$9^{1/2} = 3$$(a^{1/2})^2 = a^1$

    More generally, $a^{1/n}$ is the $n$th root: $8^{1/3} = 2$ because $2^3 = 8$. And $a^{m/n} = (a^{1/n})^m$, so $8^{2/3} = 2^2 = 4$.

    The special number e

    Mathematicians favour one base above all others: $e \approx 2.71828$. It’s the base where the slope of $e^x$ at any point equals its height. That makes calculus with $e^x$ unusually clean (you’ll see why in the derivatives chapter). On GATE, almost every exponential is written with base $e$.

    • Growth $e^{x}$: shoots up quickly as $x$ increases.
    • Decay $e^{-\lambda x}$ with $\lambda \gt 0$: starts at 1 when $x = 0$ and slides towards 0, never reaching it. Bigger $\lambda$ means faster decay. In GATE, $e^{-\lambda x}$ is the probability that a waiting time is longer than $x$.

    $\log_b y$ is the exponent you put on $b$ to get $y$: $$\log_b y = x \iff b^x = y.$$ The natural log $\ln$ is $\log_e$. So $\ln e^3 = 3$, $e^{\ln 5} = 5$, $\log_2 32 = 5$, $\log_{10} 1000 = 3$. Logs exist only for positive $y$.

    • $\ln(ab) = \ln a + \ln b$ (multiplying adds exponents)
    • $\ln(a/b) = \ln a - \ln b$
    • $\ln(a^k) = k\ln a$, so $\ln(1/4) = -\ln 4$
    • $\ln 1 = 0$, $\ln e = 1$
    • Change of base: $\log_2 x = \dfrac{\ln x}{\ln 2}$
    Try it

    The curve shows $e^{-\lambda x}$. Drag the dot along the curve, or change $\lambda$. Notice the “half-life”: the $x$ where the curve hits 0.5 is always $\ln 2 / \lambda$. Switch to the second view to see that $e^x$ and $\ln x$ are mirror images: one undoes the other.

    The Kalinga Kernels’ bowling machine fails at random; the chance it survives more than $x$ hours is $e^{-0.5x}$. Roughly how long until that chance drops to 25%?

    2 hours
    At 2 hours, $e^{-1} \approx 0.37$: still above 25%.
    About 2.8 hours
    $e^{-0.5x} = 0.25$ ⇒ $x = 2\ln 4 \approx 2.77$.
    4 hours
    At 4 hours, $e^{-2} \approx 0.135$: you’ve gone past 25%.

    Take $\ln$ of both sides: $-0.5x = \ln 0.25 = -\ln 4$, so $x = 2\ln 4 \approx 2.77$ hours. Notice the pattern: to free an exponent, take the log. The two half-lives ($\ln2/0.5 \approx 1.39$ each) multiply the survival chance by ½ twice: ½ · ½ = ¼.

    GATE DA 2025 · Q21 · MCQ · 1 mark

    It is given that $P(X \ge 2) = 0.25$ for an exponentially distributed random variable $X$ with $E[X] = \dfrac{1}{\lambda}$, where $E[X]$ denotes the expectation of $X$. What is the value of $\lambda$? ($\ln$ denotes natural logarithm)

    1. $\ln 2$
    2. $\ln 4$
    3. $\ln 3$
    4. $\ln 0.25$

    One fact from Probability, Part 4: for an exponential random variable, $P(X \ge x) = e^{-\lambda x}$. With that, this is purely an exponentials-and-logs question.

    1. Write the given fact as an equation: $e^{-2\lambda} = 0.25$.

      Substitute $x = 2$ into $P(X \ge x) = e^{-\lambda x}$.

    2. Take $\ln$ of both sides: $-2\lambda = \ln 0.25$.

      $\ln$ undoes $e^{(\cdot)}$, which frees the exponent.

    3. $\ln 0.25 = \ln(1/4) = -\ln 4$, so $-2\lambda = -\ln 4$, i.e. $\lambda = \tfrac12\ln 4$.

      The rule $\ln(1/a) = -\ln a$.

    4. $\tfrac12\ln 4 = \ln 4^{1/2} = \ln 2$. Answer (A).

      $k\ln a = \ln a^k$ with $k = \tfrac12$. Option (D) is a trap: $\ln 0.25$ is negative, and a rate $\lambda$ must be positive. Official key: (A).

    Go deeper: where e comes from

    Invest ₹1 at 100% yearly interest, compounded $n$ times a year: you end with $(1 + 1/n)^n$. With $n = 1$ that’s 2; $n = 12$ gives 2.613; $n = 365$ gives 2.7146; and as $n \to \infty$ it approaches $e = 2.71828\ldots$ The same limit, $(1 + x/n)^n \to e^x$, is behind the Poisson distribution, which you’ll meet in Probability, Part 4.

    Warm-up. Compute $8^{2/3}$.

    Take the cube root first ($8^{1/3}$), then square it.

    $8^{1/3} = 2$ and $2^2 = 4$. Doing it the other way round also works: $8^2 = 64$ and $\sqrt[3]{64} = 4$.

    Warm-up. Write $10^{-2}$ as a decimal.

    A negative exponent means “one over”: $10^{-2} = 1/10^2$.

    $10^{-2} = \dfrac{1}{100} = 0.01$.

    Simplify $\ln\!\left(e^3 \cdot e^{-1}\right)$.

    Combine the powers of $e$ first: $e^a \cdot e^b = e^{a+b}$.

    $e^3 \cdot e^{-1} = e^{2}$, and $\ln e^2 = 2$.

    Solve $e^{-0.5x} = 0.25$ for $x$ (a decimal is fine).

    Take $\ln$ of both sides and use $\ln 0.25 = -\ln 4$.

    $-0.5x = -\ln 4$, so $x = 2\ln 4 = 4\ln 2 \approx 2.773$.

    Compute $\log_2 32 + \log_2 \tfrac18$.

    $32 = 2^5$ and $\tfrac18 = 2^{-3}$.

    $5 + (-3) = 2$. Or combine first: $\log_2(32/8) = \log_2 4 = 2$.

    Which of these equal $\ln 8$? (Select all that apply.)

    (A) $3\ln 2$   (B) $\ln 2 + \ln 4$   (C) $\ln 4 \cdot \ln 2$   (D) $\ln 16 - \ln 2$

    Logs turn products into sums and quotients into differences. Is there a rule that turns a product of logs into anything nice?

    (A) $3\ln2 = \ln 2^3 = \ln 8$ ✓. (B) $\ln(2\cdot4) = \ln 8$ ✓. (C) There is no rule for multiplying two logs: $\ln 4\cdot\ln 2 \approx 0.961$, but $\ln 8 \approx 2.079$ ✗. (D) $\ln(16/2) = \ln 8$ ✓.

    Solve $\log_2 x + \log_2(x - 2) = 3$.

    Combine the two logs into one, then undo the log by raising 2 to the power of each side. You’ll get a quadratic: check each root against the inputs a log can accept.

    Product rule: $\log_2\big(x(x - 2)\big) = 3$, so $x(x - 2) = 2^3 = 8$.

    $x^2 - 2x - 8 = 0$ factorises as $(x - 4)(x + 2) = 0$, so $x = 4$ or $x = -2$.

    A log only accepts positive inputs, so we need $x \gt 0$ and $x - 2 \gt 0$, that is $x \gt 2$. The root $x = -2$ is not allowed: $\log_2(-2)$ has no meaning.

    Check $x = 4$: $\log_2 4 + \log_2 2 = 2 + 1 = 3$ ✓. Answer: 4.

    A model’s validation error after $t$ training epochs is $E(t) = 80\,e^{-kt}$ for some constant $k \gt 0$. After 5 epochs the error is 20. After how many whole epochs does the error first drop to 1 or below?

    Use $E(5) = 20$ to find $k$ (you’ll need $\ln$). Then solve $80e^{-kt} \le 1$ for $t$, watch the direction of the inequality, and round in the safe direction.

    Find $k$: $80e^{-5k} = 20$ gives $e^{-5k} = \tfrac14$, so $-5k = -\ln 4$ and $k = \dfrac{\ln 4}{5} \approx 0.2773$.

    Solve: $80e^{-kt} \le 1$ means $e^{-kt} \le \tfrac{1}{80}$. Taking $\ln$ (which keeps the direction, because $\ln$ is increasing): $-kt \le -\ln 80$, so $t \ge \dfrac{\ln 80}{k} = \dfrac{5\ln 80}{\ln 4} \approx \dfrac{5 \times 4.382}{1.386} \approx 15.80$.

    The first whole epoch is 16. Check: the error quarters every 5 epochs, $80 \to 20 \to 5 \to 1.25$, so $E(15) = 1.25 \gt 1$, while $E(16) \approx 0.947 \le 1$. Answer: 16.

    A leaf of a decision tree holds four classes in proportions $p_1 = \tfrac12$, $p_2 = \tfrac14$, $p_3 = \tfrac18$, $p_4 = \tfrac18$. Its entropy is $H = -\sum_{i=1}^{4} p_i \log_2 p_i$. What is $H$?

    1. 1.213
    2. −1.75
    3. 1.75
    4. 2

    Write each $p_i$ as a power of 2, so that each $\log_2 p_i$ is a whole number. Then mind the minus sign in front of the sum.

    $\log_2 \tfrac12 = -1$, $\log_2 \tfrac14 = -2$, $\log_2 \tfrac18 = -3$.

    The terms $p_i \log_2 p_i$ are $-\tfrac12$, $-\tfrac12$, $-\tfrac38$, $-\tfrac38$, which add to $-1.75$.

    $H = -(-1.75) = 1.75$. Answer (C).

    (A) uses $\ln$ instead of $\log_2$: $1.75\ln 2 \approx 1.213$. (B) drops the leading minus sign. (D) is $\log_2 4$, the entropy if all four classes were equally common; uneven proportions give less.

    • To solve for something in an exponent, take $\ln$ of both sides.
    • Write probabilities like 0.25 as fractions (1/4) before taking logs; the answer often becomes a clean $\ln 2$ or $\ln 4$.
    • Sanity-check signs: a decay rate $\lambda$ and a time $x$ are positive.
    • $\ln(a + b) = \ln a + \ln b$. False: logs split products, not sums.
    • $(\ln a)^2 = \ln(a^2)$. False: $\ln(a^2) = 2\ln a$.
    • Taking the log of zero or a negative number. It isn’t defined.
    1. Exponent rules: multiplying adds exponents, powers multiply them, and negative exponents mean reciprocals.
    2. A logarithm undoes an exponential: ln(eˣ) = x. Log rules are the exponent rules in disguise.
    3. e^(−λx) starts at 1 and decays; solving e^(−λx) = p gives x = −ln(p)/λ. This is the core move in GATE’s exponential questions.

    $\dfrac{2^{10}}{2^{7}}$ equals

    $2^{17}$
    You added the exponents. That’s for multiplication.
    8
    $2^{10-7} = 2^3 = 8$.
    $1^3$
    The base stays 2; only the exponents combine.
    $2^{10/7}$
    Dividing powers subtracts exponents; it doesn’t divide them.

    If $e^{-\lambda \cdot 5} = 0.35$, then $e^{-\lambda \cdot 10}$ is

    0.70
    Doubling the exponent doesn’t double the value. Use $e^{-10\lambda} = (e^{-5\lambda})^2$.
    0.175
    That’s halving. Write $e^{-10\lambda}$ as a power of $e^{-5\lambda}$.
    0.1225
    $(e^{-5\lambda})^2 = 0.35^2 = 0.1225$. This exact structure is behind GATE 2026 Q34.
    0.35
    The value keeps decaying as $x$ grows from 5 to 10.

    $\log_2 x = \dfrac{\ln x}{\ln 2}$. Using $\ln 2 \approx 0.693$, $\log_2 e$ is about

    0.693
    That’s $\ln 2$, which is $\log_e 2$, the other way round.
    1.443
    $\ln e / \ln 2 = 1/0.693 \approx 1.443$.
    2.718
    That’s $e$ itself, not its base-2 log.
    0.5
    Apply the change-of-base formula with $x = e$, and remember $\ln e = 1$.

    Which statement about $f(x) = e^{-2x}$ for $x \ge 0$ is true?

    It reaches 0 at $x = 2$
    An exponential is never zero; it only gets closer and closer.
    It decays more slowly than $e^{-x}$
    A larger rate means faster decay.
    It halves every $\tfrac{\ln 2}{2} \approx 0.35$ units of $x$
    $e^{-2h} = \tfrac12$ ⇒ $h = \ln 2/2$. Every step of that size multiplies the value by ½.
    Its value at $x=0$ is 2
    $e^{0} = 1$, whatever the rate.

    $f(x) = |x - 3|$. How many inputs $x$ give $f(x) = 2$?

    One
    Distance 2 from 3 can happen in two directions.
    Two
    $x = 1$ and $x = 5$: both are at distance 2 from 3.
    None
    $|x-3| = 2$ is certainly possible; try $x = 5$.
    Infinitely many
    A V-shaped graph meets a horizontal line at most twice.

    Solve $e^{-3\lambda} = \tfrac18$ for $\lambda$.

    $\ln 8$
    You have $-3\lambda = -\ln 8$. Don’t forget to divide by 3.
    $\ln 2$
    $3\lambda = \ln 8 = 3\ln 2$, so $\lambda = \ln 2$.
    $-\ln 2$
    Check the sign: $\ln(1/8)$ is negative and so is $-3\lambda$, so $\lambda$ comes out positive.
    $1/24$
    You can’t divide through an exponent; take logs first.

    $g(x) = \max(0, \ln x)$ for $x \gt 0$. What is $g(0.5) + g(e^2)$?

    $\ln 0.5 + 2$
    $\ln 0.5$ is negative, and $\max(0, \cdot)$ replaces negatives with 0.
    2
    $\ln 0.5 \lt 0 \to 0$, and $\ln e^2 = 2$.
    0
    $\ln e^2 = 2 \gt 0$, so that term survives.
    $e^2$
    $\ln$ undoes $e^{(\cdot)}$; $\ln e^2$ is just the exponent.

    A CDF-style function is $F(x) = (x - 1)/3$ for $1 \le x \le 4$. Where does it equal 0.5?

    $x = 2$
    $F(2) = 1/3$. Solve $(x-1)/3 = 1/2$.
    $x = 2.5$
    $x - 1 = 1.5$, so $x = 2.5$: exactly halfway between 1 and 4.
    $x = 1.5$
    $F(1.5) = 1/6$. Multiply both sides by 3 first.
    $x = 3$
    $F(3) = 2/3$.

    Two pieces of notation that probability is written in. Sums ($\Sigma$) let you add up many terms in one line, including infinitely many, which is how expected values and geometric tails are computed. Sets let you talk precisely about collections of outcomes: "this or that“, ”this and that“, ”everything except this".

    You need: Part 1 (exponents in particular).

    Sums and series: adding up many things at once

    $\sum$ is shorthand for “add these up”, and a geometric series, where each term is a fixed fraction of the last, can add up to a finite number even with infinitely many terms.

    Means, variances and expected values are all sums. Several GATE questions are really “can you sum this series?” in disguise, and in 2026 one was literally a double sum.

    It’s like eating half the remaining cake each day: you’ll never quite finish it, but you’ll never eat more than one cake in total.

    Where it shows up in GATE DA

    Directly in series questions, and indirectly in every mean, variance and expected-value calculation.

    2026 Q35 · double geometric sum2024 GA Q4 · infinite series2026 Q62 · double sum of squares2024 Q34 · updating an average2024 Q36 · expected number of throws
    Heat: every year, mostly inside probability questions

    Last season the Haryana Heuristics’ opener scored $x_1, x_2, \ldots, x_{14}$ runs in 14 matches. The total is $x_1 + x_2 + \cdots + x_{14}$, which is tedious to write. Sigma notation compresses it:

    $$\sum_{i=1}^{14} x_i = x_1 + x_2 + \cdots + x_{14}.$$

    Read it as "add up $x_i$ for $i$ from 1 to 14". The letter $i$ is the index; it’s a placeholder, so $\sum_{k=1}^{14} x_k$ means the same thing. The average is then $\bar x = \frac{1}{14}\sum_{i=1}^{14} x_i$ (the bar over $x$ is read “x bar” and always means an average).

    When a sum looks unfamiliar, write out its first few terms: put $i = 1$, then $i = 2$, and so on. For example $$\sum_{i=1}^{4} i^2 = 1^2 + 2^2 + 3^2 + 4^2 = 1 + 4 + 9 + 16 = 30, \qquad \sum_{k=0}^{3} 2^k = 1 + 2 + 4 + 8 = 15.$$ Notice the second one starts at $k = 0$, so its first term is $2^0 = 1$. Checking the starting value is the habit that prevents most slips with $\Sigma$.

    • Constants come out: $\sum c\,x_i = c\sum x_i$.
    • Sums split: $\sum (x_i + y_i) = \sum x_i + \sum y_i$.
    • Adding a constant $n$ times: $\sum_{i=1}^{n} c = nc$.
    • Products do not split: $\sum x_i y_i \ne \left(\sum x_i\right)\left(\sum y_i\right)$ in general.

    Two patterns you should know cold

    Arithmetic series (each term adds the same amount): $1 + 2 + \cdots + n = \dfrac{n(n+1)}{2}$. The trick: pair the first and last terms, $1 + n$, then the second and second-last, $2 + (n-1)$, and so on. Every pair sums to $n+1$, and there are $n/2$ pairs.

    Can you add up infinitely many numbers? Sometimes. Keep adding terms and watch the running total. If the totals settle down towards a fixed number, that number is the sum of the infinite series, and we say the series converges. If the totals keep growing (or keep jumping about), it has no sum. The geometric series is the one case you need to know well.

    Geometric series (each term multiplies by the same ratio $r$): $$a + ar + ar^2 + \cdots + ar^{n-1} = a\,\frac{1 - r^n}{1 - r}.$$ If $|r| \lt 1$, then $r^n \to 0$ as $n$ grows, and the infinite sum settles down to $$a + ar + ar^2 + \cdots = \frac{a}{1-r}.$$ If $|r| \ge 1$, the terms don’t shrink and the sum runs off to infinity (or never settles).

    Try it

    Each bar is a running total of $a + ar + ar^2 + \cdots$. Slide $r$ and watch the totals creep up to the dashed line at $a/(1-r)$. Push $r$ to 1 or beyond and the line disappears: the sum no longer settles. Try a negative $r$ too.

    A sum inside a sum

    A double sum is a sum whose terms are themselves sums. Work from the inside out: fix the outer index, do the inner sum, then add up the results. For example $$\sum_{i=1}^{2}\sum_{j=1}^{3} i\,j:\quad i = 1 \text{ gives } 1 + 2 + 3 = 6;\quad i = 2 \text{ gives } 2 + 4 + 6 = 12;\quad \text{total } 18.$$ Because each term $i\,j$ is (something in $i$) × (something in $j$), there’s a shortcut: $(1 + 2)(1 + 2 + 3) = 3 \times 6 = 18$. The exam question below uses exactly that shortcut, with infinite geometric series inside.

    GATE DA 2026 · Q35 · NAT · 1 mark

    The value of $\displaystyle\sum_{i=0}^{\infty}\sum_{j=1}^{\infty} 2^{-i}\,3^{-j}$ is ______. (Answer in integer)

    1. The term $2^{-i}3^{-j}$ is a product of something that depends only on $i$ and something that depends only on $j$. So the double sum splits into two separate sums multiplied together: $$\left(\sum_{i=0}^{\infty} 2^{-i}\right)\left(\sum_{j=1}^{\infty} 3^{-j}\right).$$

      When the inner sum is over $j$, the factor $2^{-i}$ is a constant and comes out. What’s left, $\sum_j 3^{-j}$, is the same number for every $i$, so it comes out of the outer sum too.

    2. First sum: $1 + \tfrac12 + \tfrac14 + \cdots$, a geometric series with $a = 1$, $r = \tfrac12$. It equals $\dfrac{1}{1 - 1/2} = 2$.

      Careful with the starting point: $i$ starts at 0, so the first term is $2^0 = 1$.

    3. Second sum: $\tfrac13 + \tfrac19 + \tfrac1{27} + \cdots$, with $a = \tfrac13$ (since $j$ starts at 1) and $r = \tfrac13$. It equals $\dfrac{1/3}{1 - 1/3} = \tfrac12$.

      The most common slip here is using $a = 1$ out of habit. Always write out the first term.

    4. Product: $2 \times \tfrac12 = $ 1.

      Official key: 1.

    Go deeper: the sum 1 + 2r + 3r² + ⋯ (used for expected values)

    For $|r| \lt 1$, $\sum_{k=1}^{\infty} k\,r^{k-1} = \dfrac{1}{(1-r)^2}$. One way to see it: write the sum as the infinite GP $1 + r + r^2 + \cdots$, plus the same GP starting at $r$, plus the same GP starting at $r^2$, and so on. Those GPs add to $\frac{1}{1-r}(1 + r + r^2 + \cdots) = \frac{1}{(1-r)^2}$. You’ll use this for the mean of the geometric distribution (“how many tries until the first success?”) in Probability, Part 4.

    Warm-up. Compute $\displaystyle\sum_{i=1}^{5} 2i$.

    Write out the terms: $2\cdot1 + 2\cdot2 + \cdots$, or take the 2 outside first.

    $2(1 + 2 + 3 + 4 + 5) = 2 \times 15 = 30$.

    Warm-up. Add up $1 + 2 + 3 + \cdots + 20$.

    Use $\dfrac{n(n+1)}{2}$ with $n = 20$.

    $\dfrac{20 \times 21}{2} = 210$. Pairing works too: $1 + 20 = 2 + 19 = \cdots = 21$, and there are 10 pairs.

    Compute $\displaystyle\sum_{k=1}^{100} k$.

    Use $n(n+1)/2$ with $n = 100$.

    $100 \cdot 101 / 2 = 5050$.

    Compute $\displaystyle\sum_{k=1}^{10} (2k + 1)$.

    Split it: $2\sum k + \sum 1$.

    $2 \cdot \frac{10\cdot 11}{2} + 10 = 110 + 10 = 120$.

    Find $3 + 1 + \tfrac13 + \tfrac19 + \cdots$ (forever).

    First term $a = 3$; each term is $\tfrac13$ of the previous one.

    $\dfrac{3}{1 - 1/3} = \dfrac{3}{2/3} = 4.5$.

    GATE DA 2024 · GA Q4 · MCQ · 1 mark

    The sum of the following infinite series is $$2 + \frac12 + \frac13 + \frac14 + \frac18 + \frac19 + \frac1{16} + \frac1{27} + \cdots$$

    Apart from the leading 2, the terms come from two interleaved geometric series: powers of ½ and powers of ⅓.

    Group the terms: $2 + \left(\tfrac12 + \tfrac14 + \tfrac18 + \cdots\right) + \left(\tfrac13 + \tfrac19 + \tfrac1{27} + \cdots\right) = 2 + 1 + \tfrac12 = \tfrac72$. (Each bracket is $a/(1-r)$ with $a = r$.) Official key: (B) 7/2.

    A bowler hits the stumps with probability $\tfrac13$ on each ball, independently of other balls. She keeps bowling until she first hits. What is the probability that the first hit comes on an even-numbered ball (the 2nd, 4th, 6th, …)?

    A first hit on ball $n$ means $n - 1$ misses and then a hit. Write the probability for $n = 2, 4, 6, \ldots$ and you’ll see a geometric series. What are its first term and its ratio?

    $P(\text{first hit on ball } n) = \left(\tfrac23\right)^{n-1}\cdot\tfrac13$, because the misses and the hit are independent.

    Even balls: $\left(\tfrac23\right)^{1}\tfrac13 + \left(\tfrac23\right)^{3}\tfrac13 + \left(\tfrac23\right)^{5}\tfrac13 + \cdots$

    First term $a = \tfrac29$. Each later term has two more misses, so the ratio is $r = \left(\tfrac23\right)^2 = \tfrac49$. Since $|r| \lt 1$, the sum is $\dfrac{a}{1 - r} = \dfrac{2/9}{5/9} = \dfrac25$.

    Answer: 0.4. It makes sense that odd balls (probability 0.6) beat even ones: the very first ball alone already has $\tfrac13$.

    Evaluate $\displaystyle\sum_{i=1}^{10}\sum_{j=1}^{i} j$. You may use $\displaystyle\sum_{k=1}^{n} k^2 = \frac{n(n+1)(2n+1)}{6}$.

    1. 55
    2. 220
    3. 385
    4. 550

    Work from the inside out. For a fixed $i$, the inner sum stops at $i$, not at 10. What is $1 + 2 + \cdots + i$?

    Inner sum: $\displaystyle\sum_{j=1}^{i} j = \frac{i(i+1)}{2}$.

    Outer sum: $\displaystyle\sum_{i=1}^{10} \frac{i(i+1)}{2} = \frac12\left(\sum_{i=1}^{10} i^2 + \sum_{i=1}^{10} i\right) = \frac12(385 + 55) = 220$, using $\sum i^2 = \frac{10\cdot11\cdot21}{6} = 385$ and $\sum i = 55$.

    Answer (B).

    (A) counts the terms of the inner sum ($i$ of them) instead of adding them. (C) is $\sum i^2$ alone, forgetting the $+i$ and the halving. (D) lets every inner sum run to 10: $10 \times 55$.

    Which of the following is/are true?

    1. $\displaystyle\sum_{k=0}^{\infty} \left(-\tfrac12\right)^k = \tfrac23$.
    2. $\displaystyle\sum_{k=1}^{\infty} 3\left(\tfrac14\right)^k = 1$.
    3. $\displaystyle\sum_{k=11}^{20} k = 165$.
    4. $1 + 2 + 4 + \cdots + 2^{10} = 1023$.

    For each geometric series, find the first term (look at where $k$ starts) and the ratio. For a sum that doesn’t start at 1, subtract the part you don’t want, and check exactly which terms that part holds.

    (A) True. First term 1, ratio $-\tfrac12$: $\dfrac{1}{1 - (-1/2)} = \dfrac{1}{3/2} = \dfrac23$.

    (B) True. The first term ($k = 1$) is $\tfrac34$ and the ratio is $\tfrac14$: $\dfrac{3/4}{1 - 1/4} = 1$.

    (C) False. $\sum_{k=1}^{20} k - \sum_{k=1}^{10} k = 210 - 55 = 155$. The 165 comes from subtracting only $1 + \cdots + 9 = 45$, which wrongly keeps 10 in the sum.

    (D) False. There are 11 terms, $2^0$ to $2^{10}$, so the sum is $\dfrac{2^{11} - 1}{2 - 1} = 2047$. The figure $1023 = 2^{10} - 1$ adds only the first ten terms.

    Correct: A, B.

    • Write out the first two or three terms before using a formula. This tells you $a$ and $r$ for certain.
    • Check $|r| \lt 1$ before using $a/(1-r)$.
    • Split a double sum into a product when the term factors into an $i$-part times a $j$-part.
    • Using $a = 1$ when the sum starts at $j = 1$ with first term $r$.
    • Writing $\sum x_i^2 = \left(\sum x_i\right)^2$. Squaring doesn’t pass through a sum.
    • Applying the infinite-sum formula with $r = 2$ and getting a negative “answer”. The series has no sum.
    1. Σ is shorthand for adding. Constants factor out and sums split over +, but sums don’t split over × or squares.
    2. 1 + 2 + ⋯ + n = n(n+1)/2. A geometric series sums to a(1 − rⁿ)/(1 − r), and to a/(1 − r) forever when |r| < 1.
    3. Find the first term and the ratio by writing out terms; a double sum of a product splits into a product of sums.

    $\displaystyle\sum_{i=1}^{5} 4$ equals

    4
    The term doesn’t change with $i$, but it’s still added once for each $i$.
    20
    Five copies of 4.
    15
    That’s $\sum_{i=1}^{5} i$. Here the term is the constant 4.
    60
    Count the terms: $i$ runs from 1 to 5.

    The infinite series $\tfrac15 + \tfrac1{25} + \tfrac1{125} + \cdots$ sums to

    $\tfrac54$
    That would be the sum starting from 1. Here the first term is $\tfrac15$.
    $\tfrac14$
    $a = r = \tfrac15$: $\frac{1/5}{4/5} = \tfrac14$.
    $\tfrac15$
    That’s only the first term; the rest add a little more.
    It diverges
    $|r| = \tfrac15 \lt 1$, so it converges.

    If $\sum_{i=1}^{10} x_i = 30$, what is $\sum_{i=1}^{10} (2x_i - 1)$?

    59
    The $-1$ is added ten times, not once.
    50
    $2\cdot 30 - 10 = 50$.
    60
    Don’t drop the $-1$ terms.
    29
    The factor 2 multiplies the whole sum of $x_i$.

    Which series has no finite sum?

    $1 - \tfrac12 + \tfrac14 - \tfrac18 + \cdots$
    Ratio $-\tfrac12$: $|r| \lt 1$, so it converges (to ⅔).
    $1 + 1.1 + 1.21 + 1.331 + \cdots$
    Ratio 1.1 ≥ 1: the terms grow, so the total grows without bound.
    $0.9 + 0.81 + 0.729 + \cdots$
    Ratio 0.9 is below 1, so it converges (to 9).
    $\tfrac12 + \tfrac14 + \tfrac18 + \cdots$
    The classic convergent series; it sums to 1.

    Sets: the language of “and”, “or” and “not”

    A set is a collection of distinct things, and union, intersection and complement are just “or”, “and” and “not” made precise.

    In probability, an event is a set of outcomes. In databases, relational algebra is set algebra. In Python, sets are a data type GATE writes code questions about. Learn this vocabulary once and you’ll use it in three modules.

    It’s like filtering a player list: "batters or wicket-keepers“ is a union, ”batters and left-handed“ is an intersection, ”everyone except bowlers" is a complement.

    Where it shows up in GATE DA

    Everywhere events are combined, in relational algebra (∪, ∩, ∖), and in Python set code.

    2024 Q12 · P(T ∩ S) for coin events2024 Q26 · set difference in relational algebra2025 Q47 · Python sets A − B, A | B2026 Q19 · counting subsetsSample Q47 · independent events
    Heat: every year, across probability, databases and Python

    A set is written with curly braces: $A = \{1, 2, 3\}$. Order doesn’t matter and repeats don’t count, so $\{3, 1, 2, 2\}$ is the same set. We write $2 \in A$ (“2 is in A”) and $5 \notin A$. The empty set $\varnothing$ has nothing in it. $|A|$ is the number of elements, here 3.

    $A \subseteq B$ (“A is a subset of B”) means every element of A is also in B. We usually work inside a universe $U$: all the things under discussion. For a coin tossed twice, $U = \{HH, HT, TH, TT\}$.

    Sets also let you write sets of numbers by a rule: $\{x \in \R : x \ge 0\}$ reads "all real numbers $x$ such that $x \ge 0$". The colon (sometimes a bar, $|$) is read “such that”.

    OperationSymbolIn wordsWith $A=\{1,2,3,4\}$, $B=\{3,4,5\}$, $U=\{1,\dots,6\}$
    Union$A \cup B$in A or B (or both)$\{1,2,3,4,5\}$
    Intersection$A \cap B$in A and B$\{3,4\}$
    Complement$A^c$not in A$\{5,6\}$
    Difference$A \setminus B$ or $A - B$in A but not B$\{1,2\}$
    Disjoint$A \cap B = \varnothing$nothing in common$\{1,2\}$ and $\{5,6\}$
    Try it

    Pick an expression and see which regions of the Venn diagram it shades. Then change the counts in each region and watch the sizes update. Check that $(A \cup B)^c$ and $A^c \cap B^c$ always shade the same region: that’s De Morgan’s law.

    $$|A \cup B| = |A| + |B| - |A \cap B|.$$ Adding $|A|$ and $|B|$ counts the overlap twice, so subtract it once. For three sets: $|A\cup B\cup C| = |A|+|B|+|C| - |A\cap B| - |A\cap C| - |B\cap C| + |A\cap B\cap C|$.

    $(A \cup B)^c = A^c \cap B^c$ (“not (A or B)” = “not A and not B”), and $(A \cap B)^c = A^c \cup B^c$. In logic, the same law reads $\neg(p \lor q) \equiv \neg p \land \neg q$; you’ll use it in the AI module.

    Two counting facts

    • A set with $n$ elements has $2^n$ subsets (each element is either in or out: $n$ yes/no choices). Including the empty set and the set itself.
    • The Cartesian product $A \times B$ is the set of all pairs $(a, b)$, and $|A \times B| = |A|\cdot|B|$. Two dice give $6 \times 6 = 36$ outcomes. A database CROSS JOIN is exactly this.

    From sets to probability, in one line

    In probability, each possible result of an experiment is an outcome, the universe of all outcomes is the sample space, and any set of outcomes is an event. When every outcome is equally likely, $$P(E) = \frac{|E|}{|U|} = \frac{\text{outcomes in the event}}{\text{all outcomes}}.$$ Toss a coin twice: “at least one head” is the event $\{HH, HT, TH\}$, so its probability is $\tfrac34$. That’s all the probability you need for the question below; the Probability module builds the rest.

    GATE DA 2024 · Q12 · MCQ · 1 mark

    Three fair coins are tossed independently. $T$ is the event that two or more tosses result in heads. $S$ is the event that two or more tosses result in tails. What is the probability of the event $T \cap S$?

    1. 0
    2. 0.5
    3. 0.25
    4. 1
    1. The universe has $2^3 = 8$ outcomes: HHH, HHT, HTH, THH, HTT, THT, TTH, TTT.

      Each coin has 2 results, and there are 3 coins: $2 \times 2 \times 2$.

    2. $T$ (two or more heads) $= \{HHH, HHT, HTH, THH\}$. $S$ (two or more tails) $= \{TTT, HTT, THT, TTH\}$.

      Writing events as explicit sets turns a wordy question into a mechanical one.

    3. $T \cap S$ is the set of outcomes in both lists. There are none: $T \cap S = \varnothing$.

      With only 3 tosses, “at least 2 heads” and “at least 2 tails” would need at least 4 tosses. The events are disjoint.

    4. The probability of an impossible event is 0. Answer (A).

      Notice that $T \cup S$ is the whole universe, so $P(T \cup S) = 1$. Option (D) is the trap for anyone who mixes up ∩ and ∪. Official key: (A).

    Warm-up. Let $A = \{2, 4, 6, 8, 10\}$ and $B = \{3, 6, 9\}$. Find $|A \cap B|$ and $|A \cup B|$.

    List what’s in both (for ∩), then use $|A \cup B| = |A| + |B| - |A \cap B|$.

    Only 6 is in both, so $|A \cap B| = 1$. Then $|A \cup B| = 5 + 3 - 1 = 7$: the set $\{2, 3, 4, 6, 8, 9, 10\}$.

    Warm-up. How many subsets does $\{a, b, c\}$ have?

    Each element is either in or out: three yes/no choices. Don’t forget $\varnothing$ and the whole set.

    $2^3 = 8$: $\varnothing$, $\{a\}$, $\{b\}$, $\{c\}$, $\{a,b\}$, $\{a,c\}$, $\{b,c\}$, $\{a,b,c\}$.

    In a survey of league fans, 30 follow the Bengaluru Backprops, 25 follow the Nagpur Neural Nets, and 10 follow both. How many follow at least one of the two teams?

    $|A \cup B| = |A| + |B| - |A \cap B|$.

    $30 + 25 - 10 = 45$. The 10 who follow both were counted in both the 30 and the 25.

    How many subsets does $\{a, b, c, d, e\}$ have (including $\varnothing$ and the set itself)?

    Each of the 5 elements is either in or out.

    $2^5 = 32$.

    Which of these always equal $(A \cup B)^c$? (Select all that apply.)

    (A) $A^c \cap B^c$   (B) $A^c \cup B^c$   (C) $U \setminus (A \cup B)$   (D) $(A \cap B)^c$

    “Not (A or B)” means “not A and not B”. Use the Venn widget above to test each one.

    (A) is De Morgan’s law ✓. (C) is the definition of a complement ✓. (B) equals $(A \cap B)^c$ (the other De Morgan law), which is bigger in general, and (D) is the same set as (B). Both ✗.

    A team must pick a captain from 4 senior players and a vice-captain from 6 juniors. How many (captain, vice-captain) pairs are possible?

    This is $|A \times B|$.

    $4 \times 6 = 24$ pairs.

    Of 60 analysts at the league office, 30 know Python, 25 know SQL and 20 know R. Ten know both Python and SQL, 8 know Python and R, 6 know SQL and R, and 3 know all three. How many know exactly one of the three languages?

    Fill a three-circle Venn diagram from the centre outwards: the triple overlap first, then the “exactly two” regions, then the “only one” regions.

    Centre (all three): 3.

    Exactly two: Python and SQL only $10 - 3 = 7$; Python and R only $8 - 3 = 5$; SQL and R only $6 - 3 = 3$.

    Only one: Python only $30 - 7 - 5 - 3 = 15$; SQL only $25 - 7 - 3 - 3 = 12$; R only $20 - 5 - 3 - 3 = 9$.

    Exactly one: $15 + 12 + 9 =$ 36.

    Check with inclusion–exclusion: at least one $= 75 - 24 + 3 = 54$, and $36 + (7 + 5 + 3) + 3 = 54$ ✓. So 6 analysts know none. Answering 54 counts “at least one”, not “exactly one”.

    How many subsets $S$ of $\{1, 2, \ldots, 10\}$ contain at least one of the numbers 1 and 2, but do not contain 3?

    Decide each element separately, then multiply. The element 3 has only one allowed choice; 4 to 10 are free; for the pair $\{1, 2\}$, count the in/out patterns and remove the one that breaks the rule.

    Build $S$ one decision at a time and multiply the numbers of choices.

    Element 3: must be out, 1 way. Elements 4 to 10: seven elements, each in or out, $2^7 = 128$ ways. Elements 1 and 2: $2^2 = 4$ in/out patterns, minus the one with both out, 3 ways.

    Total: $1 \times 128 \times 3 =$ 384.

    Check by complement: subsets without 3 number $2^9 = 512$; of those, the ones with neither 1 nor 2 number $2^7 = 128$; $512 - 128 = 384$ ✓.

    In a universal set $U$ with $|U| = 50$, the sets $A$ and $B$ have $|A| = 20$, $|B| = 25$ and $|A \cap B| = 8$. Which of the following is/are true?

    1. $|A^c \cap B^c| = 13$
    2. $|A \cup B^c| = 33$
    3. $|A^c \cup B^c| = 13$
    4. $A \cap B$ has 16 subsets.

    Find $|A \cup B|$ first. De Morgan’s laws turn a statement about complements into the complement of a union or of an intersection.

    Inclusion–exclusion: $|A \cup B| = 20 + 25 - 8 = 37$.

    (A) True. By De Morgan, $A^c \cap B^c = (A \cup B)^c$, so its size is $50 - 37 = 13$.

    (B) True. $A \cup B^c$ leaves out only the elements in $B$ but not in $A$. There are $25 - 8 = 17$ of those, so $|A \cup B^c| = 50 - 17 = 33$.

    (C) False. By De Morgan, $A^c \cup B^c = (A \cap B)^c$, of size $50 - 8 = 42$. The 13 comes from mixing up the two laws.

    (D) False. $A \cap B$ has 8 elements, so it has $2^8 = 256$ subsets. The 16 doubles 8 instead of raising 2 to the power 8.

    Correct: A, B.

    • Translate words into symbols first: “or” → ∪, “and” → ∩, “not” → complement, “but not” → ∖.
    • When outcomes are few, list them explicitly. It’s fast and almost impossible to get wrong.
    • Draw a Venn diagram for any question with two or three overlapping groups.
    • Adding group sizes without subtracting the overlap.
    • Confusing disjoint (no overlap) with independent (a probability idea; Probability, Part 1 explains the difference).
    • Treating $\{1, 2\}$ and $\{1, 2, 2\}$ as different sets.
    1. Union, intersection, complement and difference are “or”, “and”, “not” and “but not”.
    2. |A ∪ B| = |A| + |B| − |A ∩ B|, and De Morgan swaps ∪ and ∩ when you take a complement.
    3. An n-element set has 2ⁿ subsets; |A × B| = |A|·|B|. Probability events, database relations and Python sets all obey these rules.

    $A = \{2, 4, 6, 8\}$, $B = \{1, 2, 3, 4\}$. What is $A \setminus B$?

    $\{1, 3\}$
    That’s $B \setminus A$: elements of B that aren’t in A.
    $\{6, 8\}$
    Elements of A that are not in B.
    $\{2, 4\}$
    That’s the intersection.
    $\{1, 3, 6, 8\}$
    That’s the symmetric difference: in exactly one of the two sets.

    If $A \cap B = \varnothing$, then $|A \cup B|$ is

    $|A| + |B| - 1$
    The overlap term is $|A \cap B|$, which here is 0.
    $|A|\cdot|B|$
    That’s the size of the Cartesian product, not the union.
    $|A| + |B|$
    Disjoint sets have no overlap to subtract.
    $\max(|A|, |B|)$
    That would only happen if one set contained the other.

    In GATE 2024 Q26, a database check says “every name in Team appears in Defender or Forward”. As sets: $\text{Team} \subseteq D \cup F$. This holds exactly when

    $(D \cup F) \setminus \text{Team} = \varnothing$
    That says every Defender or Forward is in Team: the subset relation the wrong way round.
    $\text{Team} \setminus (D \cup F) = \varnothing$
    Nothing in Team lies outside $D \cup F$. This is option (C) in that question, and the official answer.
    $\text{Team} \setminus (D \cap F) = \varnothing$
    That would require every name to be in both D and F, which is too strong.
    $\text{Team} \cap (D \cup F) = \varnothing$
    That says Team has nothing in common with D ∪ F: the opposite of what we want.

    By De Morgan, “not (rain and wind)” is the same as

    no rain and no wind
    That’s the complement of "rain or wind".
    no rain or no wind
    $(R \cap W)^c = R^c \cup W^c$. A day with rain but no wind counts.
    rain or wind
    That’s not a complement of anything here.
    neither rain nor wind
    Same as “no rain and no wind”, which is too strong.

    $\displaystyle\sum_{k=0}^{\infty} \left(\tfrac23\right)^k$ equals

    2
    The first term here (k = 0) is 1, not ⅔.
    3
    $\frac{1}{1 - 2/3} = 3$.
    ⅔
    That’s only the k = 1 term.
    It diverges
    $|r| = \tfrac23 \lt 1$.

    Two dice are rolled. How many outcomes have the first die showing 6 or the second die showing 6?

    12
    The outcome (6, 6) is in both groups; it has been counted twice.
    11
    $6 + 6 - 1 = 11$, by inclusion–exclusion.
    36
    That’s every outcome.
    1
    That’s the “and” case, (6, 6).

    $\displaystyle\sum_{k=1}^{\infty} e^{-k}$ equals

    $\dfrac{1}{1 - e^{-1}}$
    That’s the sum starting from $k = 0$. Here the first term is $e^{-1}$.
    $\dfrac{1}{e - 1}$
    $a = r = e^{-1}$: $\frac{e^{-1}}{1 - e^{-1}}$; multiply top and bottom by $e$.
    $e$
    The terms are less than 1 and shrink fast; the total is well under 1.
    It diverges
    $e^{-1} \approx 0.37 \lt 1$.

    A set has 10 elements. How many of its subsets are non-empty?

    1024
    That includes the empty set.
    1023
    $2^{10} - 1$. GATE 2026 Q19 uses exactly this count, with 2026 elements.
    100
    Subsets come from yes/no choices: powers of 2, not squares.
    10
    That counts single-element subsets only.

    Just enough calculus to work in probability and machine learning. Derivatives measure how fast something changes. Integrals add up area, which is how continuous probabilities are computed. Gradients extend derivatives to many variables, which is how every machine-learning model is trained. The Calculus & optimization module goes deeper; this part gives you the working tools.

    You need: Part 1 (functions, exponentials, logs) and Part 2 (sums).

    Derivatives: the slope at a single point

    The derivative $f'(x)$ is the slope of the curve at the point $x$: how fast the output changes when you nudge the input.

    Finding maxima and minima, training neural networks with backpropagation, and the sigmoid’s famous $\sigma(1-\sigma)$ all come down to derivatives. GATE asks one directly almost every year.

    It’s like the speedometer in a car. The odometer tells you distance (the function); the speedometer tells you how fast that distance is changing right now (the derivative).

    Where it shows up in GATE DA

    Directly in calculus questions, and inside every optimisation and neural-network question.

    2024 Q33 · sigmoid derivative2024 Q15 · f′ = 0, f″ > 02025 Q14 · 10th derivative2025 Q42 · backprop ∂y/∂a2024 Q50, 2025 Q49, 2026 Q27 · maxima/minima
    Heat: every year, 2–8 marks including optimisation

    For a straight line the slope is easy: rise over run, the same everywhere. A curve’s steepness changes from point to point. To find the slope at one point $x$, pick a second point a tiny step $h$ away, draw the line through both (a secant), and measure its slope:

    $$\frac{f(x+h) - f(x)}{h}.$$

    Now shrink $h$ towards 0. The secant swings round and settles on the tangent line, the line that just touches the curve at $x$. Its slope is the derivative.

    Watch the slope settle

    Take $f(x) = x^2$ at $x = 3$ and compute the secant slope for smaller and smaller steps $h$:

    step $h$$\dfrac{f(3+h) - f(3)}{h}$
    1$(16 - 9)/1 = 7$
    0.1$(9.61 - 9)/0.1 = 6.1$
    0.01$(9.0601 - 9)/0.01 = 6.01$
    0.001$6.001$

    The slopes close in on 6. We can never put $h = 0$ (that would divide by zero), but we can say what the slopes approach as $h$ shrinks. That is what a limit means: $\lim_{h\to 0}$ reads "the value this gets closer and closer to as $h$ gets closer and closer to 0". So the slope of $x^2$ at $x = 3$ is exactly 6, and the rule $\frac{d}{dx}x^2 = 2x$ in the table below agrees: $2 \cdot 3 = 6$.

    $$f'(x) = \lim_{h\to 0}\frac{f(x+h)-f(x)}{h}.$$ Other notations: $\dfrac{df}{dx}$, $\dfrac{d}{dx}f(x)$. If $f'(x) \gt 0$ the function is rising at $x$; if $f'(x) \lt 0$ it is falling; if $f'(x) = 0$ it is momentarily flat (a candidate for a peak or valley).

    Try it

    Drag the point along the curve. The orange line is a secant through $x$ and $x + h$; shrink $h$ and watch it become the tangent. Compare the secant slope with the exact derivative in the readout. Try the sigmoid and find where its slope is largest.

    $f(x)$$f'(x)$Note
    $c$ (constant)$0$flat line
    $x^n$$n x^{n-1}$works for any power: $\sqrt x = x^{1/2} \to \tfrac12 x^{-1/2}$
    $e^x$$e^x$its own slope; that’s what makes $e$ special
    $e^{ax}$$a e^{ax}$chain rule (below)
    $\ln x$$1/x$for $x \gt 0$
    $\sin x$, $\cos x$$\cos x$, $-\sin x$$x$ in radians
    • Sum and constant: $(af + bg)' = af' + bg'$.
    • Product: $(fg)' = f'g + fg'$.
    • Quotient: $\left(\dfrac fg\right)' = \dfrac{f'g - fg'}{g^2}$.
    • Chain (a function inside a function): $\dfrac{d}{dx} f(g(x)) = f'(g(x))\cdot g'(x)$. Differentiate the outside, keep the inside, then multiply by the derivative of the inside. Backpropagation in neural networks is just the chain rule applied layer by layer.

    The chain rule, slowly. To differentiate $(3x + 1)^2$, see it as an outside function $u^2$ with the inside $u = 3x + 1$. Outside: $u^2 \to 2u$. Inside: $3x + 1 \to 3$. Multiply: $2(3x + 1) \cdot 3 = 6(3x + 1)$. Check by expanding: $(3x+1)^2 = 9x^2 + 6x + 1$, whose derivative is $18x + 6 = 6(3x + 1)$ ✓. In the same way, $e^{-x}$ has outside $e^u$ and inside $-x$, so its derivative is $e^{-x} \cdot (-1) = -e^{-x}$.

    The second derivative

    Differentiate twice and you get $f''(x)$, which measures how the slope itself is changing: the curve’s bend. $f'' \gt 0$ means the curve bends upward like a cup (∪); $f'' \lt 0$ means it bends down like a cap (∩). So if $f'(x^*) = 0$ and $f''(x^*) \gt 0$, the curve is flat at the bottom of a cup: a local minimum. That is exactly GATE 2024 Q15 (answer: local minimum, not necessarily global).

    GATE DA 2024 · Q33 · NAT · 1 mark

    Let $f:\R\to\R$ be the function $f(x) = \dfrac{1}{1+e^{-x}}$. The value of the derivative of $f$ at $x$ where $f(x) = 0.4$ is ______ (rounded off to two decimal places).

    This $f$ is the sigmoid, written $\sigma(x)$. It squashes any number into the range (0, 1) and is the heart of logistic regression.

    1. Write $f(x) = (1 + e^{-x})^{-1}$ and use the chain rule. Outside: $u^{-1} \to -u^{-2}$. Inside: $u = 1 + e^{-x}$, with $u' = -e^{-x}$. So $$f'(x) = -(1+e^{-x})^{-2}\cdot(-e^{-x}) = \frac{e^{-x}}{(1+e^{-x})^2}.$$

      Two minus signs cancel. Notice we also used $\frac{d}{dx}e^{-x} = -e^{-x}$, which is the chain rule again.

    2. Split it: $\dfrac{e^{-x}}{(1+e^{-x})^2} = \dfrac{1}{1+e^{-x}}\cdot\dfrac{e^{-x}}{1+e^{-x}} = f(x)\,\bigl(1 - f(x)\bigr).$

      Because $\frac{e^{-x}}{1+e^{-x}} = \frac{(1+e^{-x}) - 1}{1+e^{-x}} = 1 - f(x)$. This identity, $\sigma' = \sigma(1-\sigma)$, is worth memorising.

    3. We never need $x$ itself: $f'(x) = 0.4 \times (1 - 0.4) = $ 0.24.

      The question deliberately gives $f(x)$, not $x$. Solving for $x$ first ($x = \ln(2/3)$) would work but wastes time. Official key: 0.24.

    Go deeper: why the derivative of eˣ is eˣ

    $\dfrac{e^{x+h}-e^x}{h} = e^x\cdot\dfrac{e^h - 1}{h}$. The number $e$ is exactly the base for which $\frac{e^h - 1}{h} \to 1$ as $h\to 0$. (For base 2 the limit is $\ln 2 \approx 0.693$; for base 3 it’s $\ln 3 \approx 1.099$; $e$ sits in between where the limit is exactly 1.)

    Warm-up. For $f(x) = 4x^3$, what is $f'(1)$?

    Power rule: $x^n \to n x^{n-1}$, and the constant 4 just comes along.

    $f'(x) = 4 \cdot 3x^2 = 12x^2$, so $f'(1) = 12$.

    Warm-up. Where is the slope of $f(x) = x^2 - 4x$ equal to zero?

    Differentiate term by term, then solve $f'(x) = 0$.

    $f'(x) = 2x - 4 = 0$ gives $x = 2$. That’s the bottom of this U-shaped parabola, matching $-b/(2a) = 4/2$ from Chapter 1.2.

    $f(x) = 3x^4 - 2x + 7$. Find $f'(1)$.

    Power rule term by term: $3x^4 \to 12x^3$.

    $f'(x) = 12x^3 - 2$, so $f'(1) = 10$.

    What is the slope of $e^{-2x}$ at $x = 0$?

    $\frac{d}{dx}e^{ax} = a e^{ax}$.

    $-2e^{-2x}$ at $x = 0$ is $-2$. The curve is falling, and fast.

    Differentiate $\ln(x^2 + 1)$ and evaluate at $x = 1$.

    Chain rule: the outside is $\ln u \to 1/u$; the inside is $x^2+1$, with derivative $2x$.

    $\dfrac{2x}{x^2+1}$ at $x = 1$ gives $2/2 = 1$.

    Using the product rule, find the derivative of $x e^x$ at $x = 0$.

    $(fg)' = f'g + fg'$ with $f = x$, $g = e^x$.

    $1\cdot e^x + x e^x$; at 0 this is $1 + 0 = 1$.

    Find the largest value of $f(x) = x\,e^{-x/2}$ for $x \ge 0$. (Round off to two decimal places.)

    Use the product rule, with the chain rule for $e^{-x/2}$. Set $f'(x) = 0$, then make sure the point you find is a top and not a bottom.

    Product rule, with the chain rule giving $\dfrac{d}{dx}e^{-x/2} = -\tfrac12 e^{-x/2}$:

    $$f'(x) = 1\cdot e^{-x/2} + x\cdot\left(-\tfrac12\right)e^{-x/2} = e^{-x/2}\left(1 - \frac{x}{2}\right).$$

    $e^{-x/2}$ is never zero, so $f'(x) = 0$ only at $x = 2$.

    For $x \lt 2$ the bracket is positive ($f$ rising); for $x \gt 2$ it is negative ($f$ falling). So $x = 2$ is the top. (Also $f(0) = 0$, and $f$ shrinks towards 0 as $x$ grows.)

    Largest value: $f(2) = 2e^{-1} = \dfrac{2}{e} \approx$ 0.74.

    In 10 overs, a bowler takes a wicket in 3 of them. If her chance of a wicket in any over is $p$, independently, the probability of this record is proportional to $L(p) = p^3(1 - p)^7$. Which $p$ in $(0, 1)$ makes $L(p)$ largest?

    Maximising $L$ is the same as maximising $\ln L$, because $\ln$ is increasing. The log turns the product into a sum, which is much easier to differentiate.

    Take logs: $\ln L(p) = 3\ln p + 7\ln(1 - p)$.

    Differentiate (chain rule: the derivative of $\ln(1 - p)$ is $-\dfrac{1}{1 - p}$): $$\frac{d}{dp}\ln L = \frac{3}{p} - \frac{7}{1 - p}.$$

    Set it to zero: $3(1 - p) = 7p$, so $3 = 10p$ and $p = 0.3$.

    It is a maximum: the derivative is positive for $p \lt 0.3$ and negative for $p \gt 0.3$. Answer: 0.3, the observed fraction $3/10$. This is maximum likelihood estimation, which you’ll meet properly in Statistics.

    For $f(x) = x^3 - 6x^2 + 9x + 1$, which statement is correct?

    1. $f$ has a local maximum at $x = 1$ (value 5) and a local minimum at $x = 3$ (value 1).
    2. $f$ has a local minimum at $x = 1$ and a local maximum at $x = 3$.
    3. $f$ has a local maximum at $x = 2$, where $f''(x) = 0$.
    4. $f$ has local minima at both $x = 1$ and $x = 3$, because $f'(x) = 0$ there.

    Find where $f' = 0$. Then look at the sign of $f''$ at each of those points: negative means the curve bends downwards, like a hilltop.

    $f'(x) = 3x^2 - 12x + 9 = 3(x - 1)(x - 3)$, which is zero at $x = 1$ and $x = 3$.

    $f''(x) = 6x - 12$. At $x = 1$: $f''(1) = -6 \lt 0$, a local maximum, with $f(1) = 1 - 6 + 9 + 1 = 5$. At $x = 3$: $f''(3) = 6 \gt 0$, a local minimum, with $f(3) = 27 - 54 + 27 + 1 = 1$.

    Answer (A).

    (B) reads the sign of $f''$ backwards. (C) $f''(2) = 0$ marks where the bending changes direction, not a peak; there $f'(2) = -3 \ne 0$, so the curve is still falling. (D) $f' = 0$ only says the tangent is flat: it can be a top or a bottom.

    • Rewrite roots and fractions as powers before differentiating: $1/x^2 = x^{-2}$.
    • For nested functions, name the inside $u$ and apply the chain rule deliberately.
    • Look for shortcuts like $\sigma' = \sigma(1-\sigma)$ when the question gives you $f(x)$ instead of $x$.
    • Forgetting the inner derivative: $\frac{d}{dx}e^{-x} = -e^{-x}$, not $e^{-x}$.
    • Writing $(fg)' = f'g'$. The product rule has two terms.
    • Assuming $f'(x) = 0$ means a minimum. It could be a maximum or a flat inflection; check $f''$.
    1. The derivative is the slope of the tangent: the limit of rise/run as the run shrinks to zero.
    2. Power, exponential and log rules, combined with the sum, product, quotient and chain rules, handle everything GATE asks.
    3. f′ = 0 marks a flat point; f″ > 0 there means a local minimum, f″ < 0 a local maximum.

    The derivative of $5x^3$ is

    $5x^2$
    The power comes down as a multiplier too.
    $15x^2$
    $5 \cdot 3x^{2}$.
    $15x^3$
    The power drops by one.
    $\tfrac54 x^4$
    That’s integration (going the other way).

    At which $x$ is the sigmoid $\sigma(x)$ steepest, and what is the slope there?

    $x = 1$, slope 1
    $\sigma(1-\sigma)$ is largest when $\sigma = \tfrac12$. Where does that happen?
    $x = 0$, slope 0.25
    $\sigma(0) = \tfrac12$, and $\tfrac12\cdot\tfrac12 = \tfrac14$ is the largest value of $\sigma(1-\sigma)$.
    $x = 0$, slope 0.5
    The position is right; recompute $\sigma(1-\sigma)$ at $\sigma = \tfrac12$.
    It’s equally steep everywhere
    The sigmoid is flat at both ends and steep in the middle; try the widget.

    $\frac{d}{dx}\,e^{x^2}$ equals

    $e^{x^2}$
    The inside is $x^2$, not $x$; the chain rule adds a factor.
    $x^2 e^{x^2 - 1}$
    The power rule doesn’t apply to $e^{(\cdot)}$.
    $2x\,e^{x^2}$
    The outside derivative is $e^{x^2}$; multiply by the inside derivative $2x$.
    $2e^{x}$
    Keep the inside intact in the outer derivative.

    If $f'(2) = 0$ and $f''(2) = -3$, then at $x = 2$, $f$ has

    a local minimum
    A negative second derivative means the curve bends down, like a cap.
    a local maximum
    Flat, and bending downward: the top of a hill.
    no turning point
    The slope is zero and the bend is not, so it’s a turning point.
    a global maximum
    The test only tells you about the neighbourhood; the function might go higher elsewhere.

    Integrals: adding up area under a curve

    The integral $\int_a^b f(x)\,dx$ is the area under the curve of $f$ between $a$ and $b$, and you compute it by running a derivative backwards.

    For continuous random variables, probability is area under a curve. Every exponential, normal or uniform question in GATE hides an integral, and many of them can be done with plain geometry.

    It’s like filling a petrol tank: the pump’s flow rate changes over time, and the total fuel is the area under the flow-rate curve.

    Where it shows up in GATE DA

    Rarely asked as “integrate this”, but needed for continuous probability: densities, means and variances.

    2024 Q56 · P(X ≥ Y) for uniforms2024 Q57 · exponential mean and variance2025 Q39 · probabilities from a CDFSample Q33 · variance of a uniformSample Q36 · conditional density
    Heat: every year, inside probability questions

    Slice the area under $f$ between $a$ and $b$ into thin rectangles of width $\Delta x$. Each has area about $f(x)\,\Delta x$. Add them up and you have an approximation of the area; make the slices thinner and the approximation becomes exact. The integral sign $\int$ is a stretched S for “sum”:

    $$\int_a^b f(x)\,dx \approx \sum f(x_i)\,\Delta x.$$

    Area below the axis counts as negative. The $dx$ at the end is a reminder of the slice width $\Delta x$ and tells you which letter is the input; read the whole thing as: the area under $f$ from $a$ to $b$. The integral of a function is that area.

    Try it

    Change the number of rectangles and watch the approximation close in on the exact area. Move the limits $a$ and $b$. For the exponential density, set $a = 0$ and push $b$ far right: the total area approaches 1, as every probability density must.

    If $F'(x) = f(x)$ (we call $F$ an antiderivative of $f$), then $$\int_a^b f(x)\,dx = F(b) - F(a),\quad\text{often written } \Big[F(x)\Big]_a^b.$$ So to integrate, ask: what function has $f$ as its derivative?

    Find the area under $f(x) = x$ from $x = 0$ to $x = 2$, first by geometry and then with the theorem.

    1. Geometry: the region is a right triangle with base 2 and height $f(2) = 2$, so its area is $\tfrac12 \cdot 2 \cdot 2 = 2$.

      The graph of $f(x) = x$ is a straight line through the origin, so the region under it is a triangle.

    2. Theorem: which function has derivative $x$? $F(x) = \tfrac{x^2}{2}$, because $\frac{d}{dx}\tfrac{x^2}{2} = \tfrac{2x}{2} = x$.

      Ask the question backwards: what would I differentiate to get $x$?

    3. $\displaystyle\int_0^2 x\,dx = F(2) - F(0) = \tfrac{4}{2} - 0 = 2$. Both methods agree.

      Any constant could be added to $F$ ($\tfrac{x^2}{2} + 7$ also has derivative $x$), but it cancels in $F(b) - F(a)$, so for areas we can ignore it.

    $f(x)$antiderivative $F(x)$Check by differentiating
    $x^n$ ($n \ne -1$)$\dfrac{x^{n+1}}{n+1}$$\frac{(n+1)x^n}{n+1} = x^n$ ✓
    $1/x$$\ln x$✓ (for $x \gt 0$)
    $e^{ax}$$\dfrac{e^{ax}}{a}$✓
    $\lambda e^{-\lambda x}$$-e^{-\lambda x}$✓

    Integrals to infinity work by taking a limit: $\int_0^\infty \lambda e^{-\lambda x}dx = \Big[-e^{-\lambda x}\Big]_0^\infty = 0 - (-1) = 1$, because $e^{-\lambda x} \to 0$ as $x \to \infty$.

    Use geometry when you can. If $f$ is flat or a straight line, the area is a rectangle, triangle or trapezium. For uniform distributions this is almost always faster than integrating.

    Two variables. If a point is equally likely to land anywhere in a square, the probability it lands in some region is (area of region) ÷ (area of square). This is a double integral of a constant, which is just area. GATE loves this.

    GATE DA 2024 · Q56 · NAT · 2 marks

    Let $X$ be a random variable uniformly distributed in the interval $[1, 3]$ and $Y$ be a random variable uniformly distributed in the interval $[2, 4]$. If $X$ and $Y$ are independent of each other, the probability $P(X \ge Y)$ is ______ (rounded off to three decimal places).

    "Uniformly distributed in $[1,3]$" means every value in the interval is equally likely. Independent uniforms make the pair $(X, Y)$ equally likely to be anywhere in the rectangle $[1,3]\times[2,4]$.

    1. The pair $(X, Y)$ lives in a 2 × 2 square: $x$ from 1 to 3, $y$ from 2 to 4. Its area is 4.

      Equally likely everywhere ⇒ probability = (favourable area)/(total area).

    2. The event $X \ge Y$ is the part of the square on or below the line $y = x$. Inside the square, that line runs from $(2, 2)$ to $(3, 3)$.

      The line enters at the bottom edge $y = 2$ (where $x = 2$) and leaves at the right edge $x = 3$ (where $y = 3$). Sketch it; it takes ten seconds.

    3. The region below the line is a right triangle with corners $(2,2)$, $(3,2)$, $(3,3)$: legs of length 1, area $\tfrac12$.

      Area of a right triangle = ½ × base × height.

    4. $P(X \ge Y) = \dfrac{1/2}{4} = \tfrac18 = $ 0.125.

      No integration needed. Official key: 0.125.

    Go deeper: the same answer by integration

    The joint density is $\tfrac14$ on the square. $P(X\ge Y) = \int_{2}^{3}\int_{y}^{3}\tfrac14\,dx\,dy = \tfrac14\int_2^3 (3 - y)\,dy = \tfrac14\Big[3y - \tfrac{y^2}{2}\Big]_2^3 = \tfrac14(4.5 - 4) = \tfrac18$. Same result; geometry was just faster.

    Warm-up. Compute $\displaystyle\int_0^3 2\,dx$.

    The graph of $f(x) = 2$ is a flat line. What shape is the region under it?

    A rectangle 3 wide and 2 tall: area 6. With the theorem: $F(x) = 2x$, and $F(3) - F(0) = 6$.

    Warm-up. Compute $\displaystyle\int_1^2 3x^2\,dx$.

    An antiderivative of $3x^2$ is $x^3$. Evaluate at 2 and at 1, then subtract.

    $\big[x^3\big]_1^2 = 8 - 1 = 7$.

    Compute $\displaystyle\int_0^2 3x^2\,dx$.

    An antiderivative of $3x^2$ is $x^3$.

    $\big[x^3\big]_0^2 = 8 - 0 = 8$.

    Compute $\displaystyle\int_0^\infty e^{-2x}\,dx$.

    Antiderivative $-\tfrac12 e^{-2x}$; it goes to 0 at infinity.

    $0 - (-\tfrac12) = \tfrac12$.

    Compute $\displaystyle\int_1^{e} \frac{1}{x}\,dx$.

    Antiderivative $\ln x$.

    $\ln e - \ln 1 = 1 - 0 = 1$.

    For $X$ uniform on $[0, 1]$ (density 1 there), the mean is $\int_0^1 x\,dx$ and $E[X^2] = \int_0^1 x^2\,dx$. The variance is $E[X^2] - (\text{mean})^2$. Find it. (This is the 2024 sample paper’s Q33.)

    $\int_0^1 x\,dx = \tfrac12$ and $\int_0^1 x^2\,dx = \tfrac13$.

    $\tfrac13 - \tfrac14 = \tfrac1{12} \approx 0.0833$.

    A function is $f(x) = c\,x^2$ for $0 \le x \le 3$ and $0$ elsewhere. The constant $c$ is chosen so that the total area under $f$ is 1, which makes $f$ a probability density. Find the area under $f$ from $x = 2$ to $x = 3$, which is $P(X \gt 2)$. (Round off to three decimal places.)

    Two integrals of the same function: first $\int_0^3 cx^2\,dx = 1$ gives $c$; then integrate from 2 to 3.

    Total area: $\displaystyle\int_0^3 x^2\,dx = \left[\frac{x^3}{3}\right]_0^3 = 9$, so $9c = 1$ and $c = \tfrac19$.

    Area from 2 to 3: $\displaystyle\int_2^3 \frac{x^2}{9}\,dx = \frac19\left[\frac{x^3}{3}\right]_2^3 = \frac{27 - 8}{27} = \frac{19}{27} \approx$ 0.704.

    Forgetting $c$ gives $19/3 \approx 6.33$, which cannot be a probability.

    What is the area of the region enclosed between the line $y = x$ and the parabola $y = x^2$?

    1. $\tfrac16$
    2. $\tfrac12$
    3. $\tfrac13$
    4. $\tfrac56$

    Find where the two graphs cross. Between those points, which one is on top? The area is the integral of (top − bottom).

    They cross where $x = x^2$, that is $x(x - 1) = 0$: at $x = 0$ and $x = 1$.

    Between them the line is on top: at $x = \tfrac12$, $\tfrac12 \gt \tfrac14$.

    Area $= \displaystyle\int_0^1 (x - x^2)\,dx = \left[\frac{x^2}{2} - \frac{x^3}{3}\right]_0^1 = \frac12 - \frac13 = \frac16$. Answer (A).

    (B) is the area under the line alone, (C) the area under the parabola alone, and (D) adds the two areas instead of subtracting.

    Which of the following is/are true?

    1. $\displaystyle\int_{-1}^{2} |x|\,dx = \tfrac52$
    2. $\displaystyle\int_{0}^{\infty} e^{-x/2}\,dx = 2$
    3. $\displaystyle\int_{-2}^{2} x^3\,dx = 8$
    4. $\displaystyle\int_{1}^{e^2} \frac1x\,dx = e^2 - 1$

    $|x|$ changes formula at 0, so split there. For (C), compare the signed area left of 0 with the area right of 0. For (D), which function has derivative $\frac1x$?

    (A) True. Split at 0: $\int_{-1}^{0} (-x)\,dx + \int_0^2 x\,dx = \tfrac12 + 2 = \tfrac52$. Ignoring the bars gives $\left[\tfrac{x^2}{2}\right]_{-1}^{2} = 2 - \tfrac12 = \tfrac32$.

    (B) True. An antiderivative is $-2e^{-x/2}$, so the integral is $0 - (-2) = 2$.

    (C) False. $\left[\tfrac{x^4}{4}\right]_{-2}^{2} = 4 - 4 = 0$: $x^3$ is negative left of 0 and the two pieces cancel. The 8 is the total shaded area with both pieces counted as positive, which is not the integral.

    (D) False. $\int \tfrac1x\,dx = \ln x$, so the value is $\ln e^2 - \ln 1 = 2$. The figure $e^2 - 1$ is what integrating 1 instead of $\tfrac1x$ would give.

    Correct: A, B.

    • Sketch the region first. Many GATE integrals are triangles and rectangles in disguise.
    • Check an antiderivative by differentiating it.
    • For uniform pairs, compute favourable area ÷ total area.
    • Forgetting that $\big[F\big]_a^b$ means $F(b) - F(a)$, top minus bottom.
    • Applying $x^{n+1}/(n+1)$ with $n = -1$: the integral of $1/x$ is $\ln x$.
    • Forgetting the $1/a$ in $\int e^{ax}dx = e^{ax}/a$.
    1. An integral is accumulated area: a sum of thin slices f(x)·Δx.
    2. Integrate by running differentiation backwards: ∫ₐᵇ f = F(b) − F(a).
    3. For flat densities, probability is area. Use geometry before calculus.

    $\displaystyle\int_0^3 2\,dx$ equals

    2
    That’s the height. Area = height × width.
    6
    A rectangle of height 2 and width 3.
    3
    That’s the width only.
    9
    Recheck: the height is 2, not 3.

    A point is chosen uniformly at random in the unit square $[0,1]\times[0,1]$. What is $P(X + Y \le 1)$?

    1
    Some of the square lies above the line $x + y = 1$.
    ½
    The region below $x + y = 1$ is a triangle of area ½ in a square of area 1.
    ¼
    The triangle’s legs have length 1, not ½.
    ⅓
    Sketch the line $x + y = 1$ in the square and compute the triangle’s area.

    For an exponential density $\lambda e^{-\lambda x}$ ($x \ge 0$), $P(X \gt 3) = \int_3^\infty \lambda e^{-\lambda x}dx$ equals

    $1 - e^{-3\lambda}$
    That’s $P(X \le 3)$, the area from 0 to 3.
    $e^{-3\lambda}$
    $\big[-e^{-\lambda x}\big]_3^\infty = 0 + e^{-3\lambda}$. You used this in Part 1.
    $\lambda e^{-3\lambda}$
    That’s the height of the density at 3, not an area.
    $3\lambda$
    Integrate first; an area under a decaying curve can’t grow like this.

    Which is an antiderivative of $4x^3 + e^{2x}$?

    $12x^2 + 2e^{2x}$
    That’s the derivative, not the antiderivative.
    $x^4 + e^{2x}$
    Differentiate $e^{2x}$: you get $2e^{2x}$, which is too much.
    $x^4 + \tfrac12 e^{2x}$
    Differentiating gives back $4x^3 + e^{2x}$.
    $x^4 + 2e^{2x}$
    You need to divide by 2, not multiply.

    Gradients: which way is downhill?

    For a function of several variables, each partial derivative measures the slope in one direction, and the gradient collects them into an arrow pointing uphill.

    Machine learning trains models by walking downhill on a loss surface (gradient descent). GATE has asked you to perform one step of it, and to compute gradients through a neural network.

    It’s like standing on a foggy hillside: you can’t see the valley, but you can feel which way the ground slopes under your feet, and you step that way.

    Where it shows up in GATE DA

    Inside machine-learning questions: gradient-descent updates, losses and backpropagation.

    2026 Q29 · one SGD step2025 Q42 · ∂y/∂a in a ReLU network2026 Q55 · ridge loss2025 Q22 · perceptron update
    Heat: most years, inside ML

    A function can take two inputs: $f(x, y) = x^2 + 3y^2$. In machine learning a model has many inputs to tune (its parameters), so this is the normal case, not an exotic one. Its graph is a surface, like a landscape. To draw it on paper we use a contour map: curves joining points of equal height, exactly like the contour lines on a hiking map.

    To measure slope, freeze all inputs but one. The partial derivative $\dfrac{\partial f}{\partial x}$ treats $y$ as a constant and differentiates in $x$ as usual. For $f = x^2 + 3y^2$: $\dfrac{\partial f}{\partial x} = 2x$ and $\dfrac{\partial f}{\partial y} = 6y$.

    $$\nabla f = \left(\frac{\partial f}{\partial x},\ \frac{\partial f}{\partial y}\right).$$ At each point, $\nabla f$ is an arrow pointing in the direction of steepest ascent, and it’s perpendicular to the contour line through that point. Its length is how steep it is. So $-\nabla f$ points steepest downhill.

    A pair like $(2x, 6y)$ is a vector: an ordered list of numbers that you can draw as an arrow, “so many steps across, so many steps up”. Part 4 covers vectors properly; here you only need to read the arrow. Vectors are printed in bold, so a point with several coordinates is written $\mathbf w$.

    Start at some point $\mathbf w$. Repeat: $$\mathbf w \leftarrow \mathbf w - \eta\,\nabla f(\mathbf w),$$ where $\eta \gt 0$ (eta) is the learning rate, the step size. Too small and progress is slow; too large and you overshoot the valley and may bounce out of it. Stochastic gradient descent (SGD) uses the gradient computed on one data point at a time.

    Take one gradient-descent step on $f(x, y) = x^2 + 3y^2$ from the point $(2, 1)$ with learning rate $\eta = 0.1$.

    1. Gradient: $\nabla f = (2x, 6y) = (4, 6)$ at $(2, 1)$.

      Each partial derivative treats the other letter as a constant.

    2. Step against it: $(2, 1) - 0.1 \cdot (4, 6) = (2 - 0.4,\ 1 - 0.6) = (1.6, 0.4)$.

      The minus sign turns “uphill” into “downhill”; $\eta$ sets how far we go.

    3. Check it helped: $f(2, 1) = 4 + 3 = 7$, and $f(1.6, 0.4) = 2.56 + 0.48 = 3.04$. Lower, as it should be.

      Repeating this step is how every neural network is trained.

    Try it

    Drag the dot anywhere on the contour map. The teal arrow is $-\nabla f$, the downhill direction; notice it always crosses the contours at right angles. Press “Step” to take gradient-descent steps. Then raise the learning rate until the path starts zig-zagging, and beyond, until it flies off.

    GATE DA 2026 · Q29 · NAT · 1 mark

    Consider that for a supervised learning task, the objective function being minimized is $f_w(x) = wx$, where $x\in\R$ is the input and $w\in\R$ is the parameter. Stochastic Gradient Descent with learning rate of 0.10 is used for parameter updates. Suppose that at the end of iteration $i$, the value of $w$ becomes 10.00. Let $x = 10.00$ be the input for iteration $(i + 1)$. The value of $w$ at the end of iteration $(i + 1)$ is ______. (Rounded off to two decimal places)

    1. We differentiate the objective with respect to the parameter $w$, not the input $x$: $\dfrac{\partial}{\partial w}(wx) = x$.

      During training the data $x$ is fixed and the parameter is what we adjust. This is the conceptual point the question tests.

    2. At this iteration $x = 10$, so the gradient is $10$.

      The current value of $w$ doesn’t affect this gradient, because $f$ is linear in $w$.

    3. Update: $w \leftarrow 10 - 0.10 \times 10 = $ 9.00.

      $w_{\text{new}} = w_{\text{old}} - \eta \cdot \text{gradient}$. Official answer range: 8.90 to 9.10.

    Warm-up. For $f(x, y) = 3x + y^2$, compute $\dfrac{\partial f}{\partial y}$ at $(1, 2)$.

    Treat $x$ as a constant: the $3x$ term has slope 0 in the $y$ direction.

    $\dfrac{\partial f}{\partial y} = 2y = 4$ at $y = 2$.

    Warm-up. Minimise $f(w) = w^2$ by gradient descent. From $w = 3$ with learning rate $0.25$, what is $w$ after one step?

    The gradient of $w^2$ is $2w$. Update: $w - \eta \cdot 2w$.

    Gradient $= 6$, so $w \leftarrow 3 - 0.25 \times 6 = 1.5$. Closer to the minimum at 0.

    $f(x, y) = x^2 y + 3y$. Find both partial derivatives at $(2, 1)$.

    For $\partial f/\partial x$, treat $y$ as a number: $x^2 y \to 2xy$ and $3y \to 0$. For $\partial f/\partial y$, treat $x$ as a number.

    $\partial f/\partial x = 2xy = 4$. $\partial f/\partial y = x^2 + 3 = 7$.

    Minimise $L(w) = (w - 3)^2$ by gradient descent with $\eta = 0.1$, starting at $w = 0$. What is $w$ after one step?

    $L'(w) = 2(w - 3)$. Evaluate at $w = 0$, then update.

    $L'(0) = -6$. So $w \leftarrow 0 - 0.1(-6) = 0.6$, a step towards the minimum at 3.

    For $f(x, y) = x^2 + y^2$, how long is the gradient arrow at $(3, 4)$?

    $\nabla f = (2x, 2y)$. Length of $(a, b)$ is $\sqrt{a^2 + b^2}$.

    $\nabla f = (6, 8)$, length $\sqrt{36 + 64} = 10$.

    For $L(w) = w^2$, gradient descent is $w \leftarrow w - \eta\cdot 2w = (1 - 2\eta)w$. What happens with $\eta = 1.5$?

    Compute $1 - 2\eta$ and think about what repeatedly multiplying by it does.

    $1 - 3 = -2$: every step multiplies $w$ by $-2$, so $|w|$ doubles each step while the sign flips. It overshoots further each time and diverges. (Gradient descent here converges only when $|1 - 2\eta| \lt 1$, i.e. $0 \lt \eta \lt 1$.)

    Minimise $f(x, y) = x^2 + 3y^2$ by gradient descent with learning rate $\eta = 0.1$, starting at $(x, y) = (2, 1)$. Where are you after two steps?

    The gradient is $(2x, 6y)$. Each step: new point = old point − $\eta$ × gradient at the old point. Recompute the gradient before the second step.

    $\nabla f = \left(\dfrac{\partial f}{\partial x}, \dfrac{\partial f}{\partial y}\right) = (2x,\ 6y)$.

    Step 1: $\nabla f(2, 1) = (4, 6)$, so the new point is $(2, 1) - 0.1(4, 6) = (1.6,\ 0.4)$.

    Step 2: $\nabla f(1.6, 0.4) = (3.2, 2.4)$, so the new point is $(1.6, 0.4) - 0.1(3.2, 2.4) = $ (1.28, 0.16).

    Each step multiplies $x$ by $1 - 0.2 = 0.8$ and $y$ by $1 - 0.6 = 0.4$, so $y$, the steeper direction, shrinks faster. The value of $f$ falls from 7 to $1.6384 + 0.0768 = 1.7152$.

    For $f(x, y) = e^{xy} + x^2$, what is the steepest rate at which $f$ can increase from the point $(1, 0)$? (Round off to two decimal places.)

    The steepest rate of increase is the length of the gradient. For $\dfrac{\partial}{\partial x}e^{xy}$, treat $y$ as a constant and use the chain rule.

    Partial derivatives (chain rule on $e^{xy}$, holding the other variable fixed):

    $\dfrac{\partial f}{\partial x} = y\,e^{xy} + 2x$ and $\dfrac{\partial f}{\partial y} = x\,e^{xy}$.

    At $(1, 0)$, $e^{0} = 1$, so $\dfrac{\partial f}{\partial x} = 0 + 2 = 2$ and $\dfrac{\partial f}{\partial y} = 1$. The gradient is $(2, 1)$.

    The steepest rate is its length: $\sqrt{2^2 + 1^2} = \sqrt5 \approx$ 2.24, in the direction $(2, 1)$.

    Gradient descent on $L(w) = 2(w - 1)^2$ uses the update $w \leftarrow w - \eta\,L'(w)$. For which learning rates $\eta$ does $w$ approach the minimiser $w = 1$ from every starting point?

    1. $0 \lt \eta \lt 0.5$
    2. $0 \lt \eta \lt 1$
    3. $0 \lt \eta \lt 0.25$
    4. $0 \lt \eta \le 0.5$

    Track the distance $w - 1$ from the minimiser. One step multiplies it by a fixed number. When does repeated multiplication by a number shrink to 0?

    $L'(w) = 4(w - 1)$. After one step, $w_{\text{new}} - 1 = (w - 1) - 4\eta(w - 1) = (1 - 4\eta)(w - 1)$.

    After $n$ steps the distance is $(1 - 4\eta)^n$ times the starting distance. That goes to 0 exactly when $|1 - 4\eta| \lt 1$, that is $-1 \lt 1 - 4\eta \lt 1$, which gives $0 \lt \eta \lt 0.5$. Answer (A).

    (B) is the range for $L(w) = w^2$, where the factor is $1 - 2\eta$; the extra factor 2 here makes the loss steeper and halves the safe range. (C) is where $1 - 4\eta$ stays positive, so $w$ never overshoots; but for $0.25 \le \eta \lt 0.5$ it still converges, zig-zagging. (D) includes $\eta = 0.5$, where the factor is $-1$ and $w$ bounces between two points forever.

    • Ask “derivative with respect to what?” In ML it’s almost always the parameters (weights), not the data.
    • Move against the gradient to minimise: subtract $\eta\nabla f$.
    • Treat every other variable as a constant when taking a partial derivative.
    • Adding the gradient instead of subtracting it, which climbs uphill.
    • Differentiating with respect to the input $x$ when the question updates $w$.
    • Assuming a bigger learning rate is always faster. Past a point it diverges.
    1. A partial derivative is an ordinary derivative with every other variable frozen.
    2. The gradient points uphill, perpendicular to contours; −∇f points downhill.
    3. Gradient descent: w ← w − η∇f(w). The learning rate controls the step, and too large a rate diverges.

    For $f(x, y) = 3x + 5y^2$, $\dfrac{\partial f}{\partial y}$ is

    $3 + 10y$
    $3x$ doesn’t depend on $y$, so it differentiates to 0.
    $10y$
    Only the $5y^2$ term changes with $y$.
    $3$
    That’s $\partial f/\partial x$.
    $5y^2$
    Differentiate: the power comes down and drops by one.

    The gradient at a point is always

    parallel to the contour line there
    Moving along a contour keeps the height constant, so that direction has zero slope.
    perpendicular to the contour line there
    It points straight uphill, across the contours.
    pointing to the global minimum
    It only knows about the slope where you’re standing; it points uphill.
    zero
    It is zero only at flat points like the bottom of a valley.

    One gradient-descent step on $L(w_1, w_2) = w_1^2 + w_2^2$ from $(1, 2)$ with $\eta = 0.25$ lands at

    $(1.5, 3)$
    That moved uphill; you added the gradient.
    $(0.75, 1.75)$
    The gradient is $(2w_1, 2w_2)$, not $(1, 1)$.
    $(0.5, 1)$
    $\nabla L = (2, 4)$; subtract $0.25 \times (2, 4) = (0.5, 1)$.
    $(0, 0)$
    That would need $\eta = 0.5$ here. Recompute with 0.25.

    If $\sigma(x) = 0.9$, then $\sigma'(x)$ is

    0.9
    Use $\sigma' = \sigma(1 - \sigma)$.
    0.09
    $0.9 \times 0.1$.
    0.81
    That’s $\sigma^2$.
    0.1
    That’s $1 - \sigma$ alone.

    $X$ and $Y$ are independent and uniform on $[0, 2]$. $P(X \le 1 \text{ and } Y \le 1)$ is

    ½
    That’s the chance for one of them. Both must happen.
    ¼
    The favourable region is a 1 × 1 square inside a 2 × 2 square.
    1
    Half the range is excluded for each variable.
    ¾
    That’s $P(X \le 1 \text{ or } Y \le 1)$.

    The derivative of $\ln(e^{3x})$ is

    $3e^{3x}$
    Simplify first: $\ln(e^{3x})$ is just $3x$.
    3
    $\ln(e^{3x}) = 3x$, whose slope is 3.
    $1/e^{3x}$
    The chain rule gives $\frac{1}{e^{3x}}\cdot 3e^{3x} = 3$. Simplifying first is easier.
    $3x$
    That’s the function after simplifying, not its derivative.

    In gradient descent, doubling the learning rate always

    halves the number of steps needed
    Not always: it can overshoot and even diverge.
    doubles the step taken from the current point
    The step is $\eta\nabla f$. Whether that helps depends on the landscape.
    finds a lower minimum
    The learning rate controls step size, not which valley exists.
    changes the gradient
    The gradient depends only on the function and the point.

    The objects linear algebra and machine learning are built from. A vector is a list of numbers that you can also picture as an arrow; a matrix is a table of numbers that you can also picture as a machine that moves arrows around. By the end you’ll be able to compute dot products, lengths, distances and matrix products, and read a neural network’s weights as matrices.

    You need: Part 1 (functions) and Part 2 (sums).

    Vectors: lists of numbers that are also arrows

    A vector is an ordered list of numbers, and the dot product of two vectors measures how much they point the same way.

    Every data point in machine learning is a vector. Distances between vectors drive k-means, k-NN and clustering; dot products drive SVMs, PCA and neural networks. You’ll use these few operations in nearly every ML question.

    It’s like a player’s scorecard: (runs, wickets, catches) = (412, 9, 6). One list, three numbers, and we can compare two players by comparing their lists.

    Where it shows up in GATE DA

    Every year, inside ML and linear-algebra questions: distances, angles and perpendicularity.

    2026 Q36 · Manhattan distance in clustering2026 Q11 · angle between principal components2025 Q55 · distance to class meansSample Q18 · perpendicular vectorsSample Q51 · normalising vectors
    Heat: every year, 2–6 marks

    Why lists? To compare two players fairly you want all their numbers at once, not one at a time; to describe a data point with 30 features you need 30 numbers kept in order. A vector is exactly that.

    A vector in $\R^n$ (read “R n”: lists of $n$ real numbers) is a list of $n$ real numbers, written as a column: $\v = \begin{bmatrix}3\\1\end{bmatrix}$. In two dimensions you can draw it as an arrow from the origin to the point $(3, 1)$. In 3 or 100 dimensions you can’t draw it, but every rule below still works.

    • Add entry by entry: $\begin{bmatrix}3\\1\end{bmatrix} + \begin{bmatrix}1\\2\end{bmatrix} = \begin{bmatrix}4\\3\end{bmatrix}$. As arrows: place the second at the tip of the first.
    • Scale by a number: $2\v = \begin{bmatrix}6\\2\end{bmatrix}$, the same direction and twice as long. A negative number flips the direction.
    • Length (norm): $\norm{\v} = \sqrt{v_1^2 + v_2^2 + \cdots + v_n^2}$. This is Pythagoras: $\norm{(3,4)} = 5$.
    • A unit vector has length 1. Dividing any non-zero vector by its length gives a unit vector in the same direction (“normalising”).

    A little trigonometry first

    The dot product below mentions $\cos\theta$, the cosine of the angle $\theta$ between two arrows. You only need its behaviour, not its triangle definition: $\cos 0^\circ = 1$ (arrows point the same way), $\cos 60^\circ = 0.5$, $\cos 90^\circ = 0$ (arrows at right angles), $\cos 180^\circ = -1$ (arrows point opposite ways). In between it slides smoothly. Angles are sometimes measured in radians instead of degrees: $180^\circ = \pi$ radians, so $90^\circ = \pi/2$.

    A tiny example before the definition: for $\u = (3, 1)$ and $\v = (1, 2)$, multiply matching entries and add: $3\cdot1 + 1\cdot2 = 5$. That single number is the dot product.

    $$\u\cdot\v = \u\T\v = u_1v_1 + u_2v_2 + \cdots + u_nv_n = \norm{\u}\,\norm{\v}\cos\theta,$$ where $\theta$ is the angle between the arrows. Multiply matching entries and add. Positive means the vectors point broadly the same way, zero means they’re perpendicular (orthogonal), negative means they point broadly opposite ways. Note $\v\cdot\v = \norm{\v}^2$. The form $\u\T\v$ is the same product written with the transpose (next chapter); for now read it as “u dot v”.

    Try it

    Drag the tips of $\u$ and $\v$. Watch the dot product change sign as the angle passes 90°. The dashed line shows the projection of $\u$ onto $\v$: the shadow $\u$ casts on the line through $\v$. Make them perpendicular and the shadow disappears.

    Projection and distance

    The projection of $\u$ onto $\v$ is the part of $\u$ that points along $\v$: $\displaystyle \text{proj}_{\v}\u = \frac{\u\cdot\v}{\v\cdot\v}\,\v$. It’s the foundation of least squares, PCA and projection matrices in the linear-algebra module.

    Two common ways to measure the distance between points $\x$ and $\y$:

    • Euclidean (straight line): $\norm{\x - \y} = \sqrt{\sum (x_i - y_i)^2}$.
    • Manhattan (city blocks): $\sum |x_i - y_i|$, as if you could only walk along streets.
    GATE DA 2026 · Q36 · MCQ · 2 marks

    Let four points in three-dimensional space be: P1: [2, 3, −1], P2: [3, 1, 1], P3: [5, −2, 3] and P4: [3, 3, 3]. Hierarchical Agglomerative Clustering is used to cluster the above points. If Manhattan Distance is used as the distance metric during clustering, which of the following options indicates the two points that will be merged first?

    1. P1, P2
    2. P2, P3
    3. P3, P4
    4. P2, P4

    You’ll study the clustering algorithm in the ML module. Its first step is all you need here: merge the two closest points.

    1. Manhattan distance adds the absolute differences in each coordinate. P1–P2: $|2-3| + |3-1| + |-1-1| = 1 + 2 + 2 = 5$.

      Subtract coordinate by coordinate, drop the signs, add.

    2. The others: P1–P3: $3 + 5 + 4 = 12$; P1–P4: $1 + 0 + 4 = 5$; P2–P3: $2 + 3 + 2 = 7$; P2–P4: $0 + 2 + 2 = 4$; P3–P4: $2 + 5 + 0 = 7$.

      With 4 points there are $\binom42 = 6$ pairs. Write them all down so you don’t miss one.

    3. The smallest distance is 4, between P2 and P4. Answer (D).

      Option (A) is a trap: P1–P2 is 5, which would tie with P1–P4 for the minimum if you made one slip. Official key: (D).

    Go deeper: why u·v = ‖u‖‖v‖cos θ

    Apply the law of cosines to the triangle with sides $\u$, $\v$ and $\u - \v$: $\norm{\u-\v}^2 = \norm{\u}^2 + \norm{\v}^2 - 2\norm{\u}\norm{\v}\cos\theta$. Expanding the left side with dot products gives $\norm{\u}^2 + \norm{\v}^2 - 2\,\u\cdot\v$. Compare the two. The same expansion, $\norm{\x - \mu}^2 = \norm{\x}^2 - 2\,\mu\cdot\x + \norm{\mu}^2$, is the key to GATE 2025 Q55.

    Warm-up. Compute $(2, -1, 3)\cdot(1, 4, 0)$.

    Multiply matching entries, then add the three products.

    $2\cdot1 + (-1)\cdot4 + 3\cdot0 = 2 - 4 + 0 = -2$. Negative: the arrows point broadly in opposite directions.

    Warm-up. What is the length of $(6, 8)$?

    Square each entry, add, take the square root.

    $\sqrt{36 + 64} = \sqrt{100} = 10$.

    Compute $(1, 2, 3)\cdot(4, -5, 6)$.

    Multiply matching entries, then add.

    $4 - 10 + 18 = 12$.

    For which $k$ are $(2, k)$ and $(3, -6)$ perpendicular?

    Perpendicular means the dot product is zero.

    $6 - 6k = 0$, so $k = 1$.

    Find the Euclidean and the Manhattan distance between $(1, 2)$ and $(4, 6)$.

    The differences are 3 and 4.

    Euclidean: $\sqrt{9 + 16} = 5$. Manhattan: $3 + 4 = 7$. Manhattan is never smaller than Euclidean.

    What is the angle between $(1, 0)$ and $(1, 1)$, in degrees?

    $\cos\theta = \dfrac{\u\cdot\v}{\norm\u\norm\v}$.

    $\cos\theta = \frac{1}{1\cdot\sqrt2}$, so $\theta = 45°$.

    Let $\u = (3, 4, 0)$ and $\v = (1, 2, 2)$. Find the distance from the point $\u$ to the line through the origin along $\v$: the length of $\u$ minus its projection onto $\v$. (Round off to two decimal places.)

    The projection of $\u$ onto $\v$ is $\dfrac{\u\cdot\v}{\v\cdot\v}\,\v$. Subtract it from $\u$ and take the length. Or use Pythagoras: $\norm{\u}^2 = (\text{projection length})^2 + (\text{distance})^2$.

    $\u\cdot\v = 3 + 8 + 0 = 11$ and $\v\cdot\v = 1 + 4 + 4 = 9$.

    Projection: $\dfrac{11}{9}(1, 2, 2) = \left(\dfrac{11}{9}, \dfrac{22}{9}, \dfrac{22}{9}\right)$.

    $\u$ minus the projection: $\left(\dfrac{16}{9}, \dfrac{14}{9}, -\dfrac{22}{9}\right)$, whose squared length is $\dfrac{256 + 196 + 484}{81} = \dfrac{936}{81} = \dfrac{104}{9}$.

    Distance $= \dfrac{\sqrt{104}}{3} \approx$ 3.40.

    Pythagoras check: $\norm{\u}^2 = 25$ and the projection has squared length $\dfrac{121}{81}\cdot 9 = \dfrac{121}{9}$, so the distance squared is $25 - \dfrac{121}{9} = \dfrac{104}{9}$ ✓.

    Three players stand at $A = (1, 2)$, $B = (4, 6)$ and $C = (5, -1)$ on a field. Find the angle $\angle ABC$ at $B$, in degrees.

    The angle at $B$ is the angle between the arrows from $B$ to $A$ and from $B$ to $C$. Subtract coordinates to get them, then use $\cos\theta = \dfrac{\a\cdot\b}{\norm{\a}\,\norm{\b}}$.

    Arrows from $B$: $\overrightarrow{BA} = A - B = (-3, -4)$ and $\overrightarrow{BC} = C - B = (1, -7)$.

    Dot product: $(-3)(1) + (-4)(-7) = -3 + 28 = 25$. Lengths: $\sqrt{9 + 16} = 5$ and $\sqrt{1 + 49} = \sqrt{50} = 5\sqrt2$.

    $\cos\theta = \dfrac{25}{5\cdot5\sqrt2} = \dfrac{1}{\sqrt2}$, so $\theta =$ 45°.

    A common slip is to use the position vectors of $A$ and $C$ themselves; those measure the angle at the origin, not at $B$.

    Let $\u = (1, -2, 2)$ and $\v = (2, 1, 0)$. Which of the following is/are true?

    1. $\norm{\u + \v} = \sqrt{14}$
    2. $\norm{\u + \v} = \norm{\u} + \norm{\v}$
    3. The unit vector in the direction of $\u$ is $\left(\tfrac13, -\tfrac23, \tfrac23\right)$.
    4. The Euclidean distance between $\u$ and $\v$ is 6.

    Start with $\u\cdot\v$. When two vectors are perpendicular, Pythagoras applies to their sum. For distances, subtract first, then decide which length you are taking.

    $\u\cdot\v = 2 - 2 + 0 = 0$, so the vectors are perpendicular. $\norm{\u} = \sqrt{1 + 4 + 4} = 3$ and $\norm{\v} = \sqrt5$.

    (A) True. $\u + \v = (3, -1, 2)$ has length $\sqrt{9 + 1 + 4} = \sqrt{14}$. (Pythagoras agrees: $9 + 5 = 14$.)

    (B) False. $3 + \sqrt5 \approx 5.24$, but $\sqrt{14} \approx 3.74$. Lengths add only when the vectors point the same way.

    (C) True. $\u/\norm{\u} = (1, -2, 2)/3$.

    (D) False. $\u - \v = (-1, -3, 2)$, so the Euclidean distance is $\sqrt{1 + 9 + 4} = \sqrt{14} \approx 3.74$. The 6 is $1 + 3 + 2$, the Manhattan distance.

    Correct: A, C.

    • Check perpendicularity with the dot product: it’s one line of arithmetic.
    • List every pair when comparing distances; it’s quick and avoids misses.
    • Normalise (divide by the length) when only direction matters.
    • Forgetting the square root in Euclidean length.
    • Mixing up Manhattan (sum of absolute differences) and Euclidean (root of sum of squares).
    • Thinking a dot product is a vector. It’s a single number.
    1. Vectors add entry by entry and scale by stretching; length is the square root of the sum of squares.
    2. u·v = Σuᵢvᵢ = ‖u‖‖v‖cos θ. Zero means perpendicular.
    3. Euclidean and Manhattan distances measure how far apart data points are; projection extracts the part of one vector along another.

    The length of $(2, -1, 2)$ is

    1
    You added the entries: $2 - 1 + 2$. Square them first.
    3
    $\sqrt{4 + 1 + 4} = 3$: square, add, take the root.
    9
    That’s the squared length; take the root.
    5
    That’s the sum of absolute values (a Manhattan-style length).

    PCA reduces 100 features to 10 principal components. GATE 2026 Q11 asks for the angle between the 1st and 10th components. Given that principal components are mutually orthogonal, the angle is

    0°
    That would mean they point the same way. Each component captures a new, independent direction.
    90°
    Orthogonal means a dot product of 0, which means a 90° angle. Official key: (B).
    Between 0° and 90°
    That would make their dot product positive, not zero.
    It depends on the data
    The data decides which directions, but they always come out orthogonal.

    If $\u\cdot\v \lt 0$, the angle between $\u$ and $\v$ is

    less than 90°
    That gives a positive dot product.
    exactly 90°
    That gives zero.
    more than 90°
    $\cos\theta \lt 0$ for angles between 90° and 180°.
    impossible to say
    The sign of the dot product is the sign of $\cos\theta$.

    Matrices: tables that transform vectors

    A matrix is a rectangular table of numbers; multiplying a vector by it produces a new vector, so a matrix is a machine that transforms space.

    The entire linear algebra module is about matrices. In ML, each layer of a neural network is a matrix; counting its entries is a standard GATE question.

    It’s like a recipe card. The table says how much of each ingredient (input) goes into each dish (output). Multiply by the quantities you have, and out come the dishes.

    Where it shows up in GATE DA

    The whole linear algebra section, plus neural-network shapes and parameter counts.

    2026 Q56 · MLP parameter count2026 Q21 · powers of a rotation matrix2024 Q35 · determinant of M² + 12M2025 Q13 · row sums and Bx = 02024 Q43 · equivalent neural networks
    Heat: every year, 8–14 marks across LA and ML

    The league keeps a table of three players’ runs and wickets in two matches. As a matrix with 3 rows and 2 columns (a “3 × 2 matrix”):

    $$A = \begin{bmatrix} 45 & 12 \\ 8 & 30 \\ 22 & 0 \end{bmatrix}.$$

    The entry in row $i$, column $j$ is written $a_{ij}$; here $a_{21} = 8$. Rows first, columns second, always.

    Matrix times vector

    $A\x$ takes each row of $A$, dots it with $\x$, and stacks the results:

    $$\begin{bmatrix}1&2\\3&4\end{bmatrix}\begin{bmatrix}5\\6\end{bmatrix} = \begin{bmatrix}1\cdot5+2\cdot6\\3\cdot5+4\cdot6\end{bmatrix} = \begin{bmatrix}17\\39\end{bmatrix}.$$

    There’s a second, very useful way to read the same product: $A\x$ is a combination of the columns of $A$, weighted by the entries of $\x$: $5\begin{bmatrix}1\\3\end{bmatrix} + 6\begin{bmatrix}2\\4\end{bmatrix}$. You’ll lean on this “column picture” throughout linear algebra.

    If $A$ is $m\times n$ and $B$ is $n\times p$, then $AB$ is $m\times p$, with entry $(AB)_{ij}$ = (row $i$ of $A$) · (column $j$ of $B$). The inner sizes must match: $(m\times \mathbf{n})(\mathbf{n}\times p)$. Order matters: usually $AB \ne BA$.

    Multiply $A = \begin{bmatrix}1&2\\3&4\end{bmatrix}$ by $B = \begin{bmatrix}0&1\\1&0\end{bmatrix}$ both ways, $AB$ and $BA$.

    1. $AB$: row 1 of $A$ dotted with column 1 of $B$ is $1\cdot0 + 2\cdot1 = 2$; with column 2 it is $1\cdot1 + 2\cdot0 = 1$. Row 2 gives $3\cdot0 + 4\cdot1 = 4$ and $3\cdot1 + 4\cdot0 = 3$. So $AB = \begin{bmatrix}2&1\\4&3\end{bmatrix}$.

      Entry $(i, j)$ is always row $i$ of the left matrix dotted with column $j$ of the right one.

    2. $BA$: row 1 of $B$ is $(0, 1)$, which picks out row 2 of $A$; row 2 of $B$ picks out row 1. So $BA = \begin{bmatrix}3&4\\1&2\end{bmatrix}$.

      Multiplying on the left by $B$ swapped the rows of $A$; multiplying on the right swapped its columns.

    3. $AB \ne BA$. Order matters for matrices, unlike for ordinary numbers.

      Think of a matrix as an action: “swap, then stretch” is usually different from “stretch, then swap”.

    • Identity $I$: 1s on the diagonal, 0s elsewhere. $I\x = \x$ and $AI = IA = A$.
    • Transpose $A\T$: swap rows and columns. $(AB)\T = B\T A\T$ (the order reverses). $A$ is symmetric if $A\T = A$.
    • Inverse $A^{-1}$: the matrix that undoes $A$, with $AA^{-1} = I$. For 2 × 2: $\begin{bmatrix}a&b\\c&d\end{bmatrix}^{-1} = \dfrac{1}{ad-bc}\begin{bmatrix}d&-b\\-c&a\end{bmatrix}$, which exists only if $ad - bc \ne 0$. That number $ad - bc$ is the determinant.
    • Trace: the sum of the diagonal entries. It will turn out to equal the sum of the eigenvalues, a favourite GATE shortcut.
    Try it

    A 2 × 2 matrix moves every point of the plane. Pick a preset, or set the four entries yourself, and watch the grid and the unit square transform. The first column of the matrix is where $(1,0)$ lands (teal), and the second column is where $(0,1)$ lands (orange). Find a matrix that squashes the square flat; its determinant will be 0.

    GATE DA 2026 · Q56 · NAT · 2 marks

    Consider a fully-connected feed-forward multi-layer perceptron. It has 30 neurons in the input layer, followed by two hidden layers and an output layer. The first hidden layer has 4 neurons and the second hidden layer has 3 neurons. The output layer has only one neuron. Assume that no bias parameters are used. The number of learnable parameters in the multi-layer perceptron is ______. (Answer in integer)

    “Fully connected” means each neuron receives a weighted sum of every neuron in the previous layer. A layer that maps $n$ inputs to $m$ outputs is exactly a matrix–vector product with an $m\times n$ weight matrix.

    1. Input → hidden 1: a $4\times 30$ weight matrix, $120$ weights.

      One weight for every (input, hidden neuron) pair: $30 \times 4$.

    2. Hidden 1 → hidden 2: $3\times 4$, $12$ weights. Hidden 2 → output: $1\times 3$, $3$ weights.

      Same rule each time: (size of next layer) × (size of previous layer).

    3. Total: $120 + 12 + 3 = $ 135.

      No biases, as stated. With biases you’d add one per non-input neuron: $4 + 3 + 1 = 8$ more (the 2024 sample paper’s Q43 includes biases). Official key: 135.

    Warm-up. Compute $\begin{bmatrix}2&0\\1&3\end{bmatrix}\begin{bmatrix}1\\2\end{bmatrix}$.

    Dot each row of the matrix with the vector $(1, 2)$.

    Row 1: $2\cdot1 + 0\cdot2 = 2$. Row 2: $1\cdot1 + 3\cdot2 = 7$. So the result is $(2, 7)$.

    Warm-up. $A$ is $2\times3$ and $B$ is $3\times4$. What size is $AB$?

    The inner sizes (3 and 3) must match and then disappear; the outer sizes remain.

    $(2\times\mathbf{3})(\mathbf{3}\times4)$ gives a $2\times4$ matrix: 2 rows, 4 columns.

    Compute $\begin{bmatrix}1&2\\3&4\end{bmatrix}\begin{bmatrix}5\\6\end{bmatrix}$. (Try it yourself before scrolling up.)

    Row 1 dotted with $(5, 6)$, then row 2 dotted with $(5, 6)$.

    $5 + 12 = 17$ and $15 + 24 = 39$.

    $A$ is $3\times 2$ and $B$ is $2\times 5$. What is the size of $AB$?

    $(m\times n)(n\times p)$ gives $m\times p$.

    The inner 2s match, and the outer sizes give $3\times 5$. ($BA$ would be $(2\times5)(3\times2)$: inner sizes 5 and 3 don’t match, so it’s not defined.)

    For $A = \begin{bmatrix}2&1\\5&3\end{bmatrix}$, find $\det A$ and the top-left and bottom-left entries of $A^{-1}$.

    $\det = ad - bc$. Then swap $a$ and $d$, negate $b$ and $c$, and divide by the determinant.

    $\det A = 6 - 5 = 1$. $A^{-1} = \begin{bmatrix}3&-1\\-5&2\end{bmatrix}$. Check: $\begin{bmatrix}2&1\\5&3\end{bmatrix}\begin{bmatrix}3&-1\\-5&2\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}$ ✓.

    An MLP has 5 inputs, one hidden layer of 10 neurons and 3 outputs. How many parameters does it have without biases?

    Two weight matrices: $10\times5$ and $3\times10$.

    Input → hidden: $10 \times 5 = 50$ weights. Hidden → output: $3 \times 10 = 30$ weights. Total $80$. (With a bias on each of the 13 non-input neurons it would be 93, the answer to the 2024 sample paper’s Q43.)

    Let $A = \begin{bmatrix}1&2\\3&4\end{bmatrix}$. Find the vector $\x = (x_1, x_2)$ with $A^2\x = \begin{bmatrix}5\\11\end{bmatrix}$.

    Compute $A^2 = AA$ first, row times column. Then use the $2\times2$ inverse: swap the diagonal entries, negate the other two, divide by the determinant.

    $A^2 = \begin{bmatrix}1\cdot1 + 2\cdot3 & 1\cdot2 + 2\cdot4\\ 3\cdot1 + 4\cdot3 & 3\cdot2 + 4\cdot4\end{bmatrix} = \begin{bmatrix}7&10\\15&22\end{bmatrix}$.

    $\det(A^2) = 7\cdot22 - 10\cdot15 = 154 - 150 = 4$, so $(A^2)^{-1} = \dfrac14\begin{bmatrix}22&-10\\-15&7\end{bmatrix}$.

    $\x = \dfrac14\begin{bmatrix}22\cdot5 - 10\cdot11\\ -15\cdot5 + 7\cdot11\end{bmatrix} = \dfrac14\begin{bmatrix}0\\2\end{bmatrix} = \begin{bmatrix}0\\0.5\end{bmatrix}$.

    Check: $7(0) + 10(0.5) = 5$ and $15(0) + 22(0.5) = 11$ ✓. So $x_1 = 0$, $x_2 = 0.5$. (Squaring each entry of $A$ gives $\begin{bmatrix}1&4\\9&16\end{bmatrix}$, which is not $A^2$: a matrix power means a matrix product.)

    A data matrix $X$ is $100\times5$, and weight matrices $W_1$ and $W_2$ are $5\times10$ and $10\times3$. Multiplying an $m\times n$ matrix by an $n\times p$ matrix with the usual row-times-column rule takes $mnp$ scalar multiplications. What is the smallest number of scalar multiplications needed to compute $XW_1W_2$?

    1. 8000
    2. 1650
    3. 15000
    4. 1500

    Matrix multiplication is associative, $(XW_1)W_2 = X(W_1W_2)$, but the two orders can cost very different amounts. Work out the size of the in-between product each time.

    Left pair first: $XW_1$ is $100\times10$ and costs $100\cdot5\cdot10 = 5000$; then $(XW_1)W_2$ costs $100\cdot10\cdot3 = 3000$. Total 8000.

    Right pair first: $W_1W_2$ is $5\times3$ and costs $5\cdot10\cdot3 = 150$; then $X(W_1W_2)$ costs $100\cdot5\cdot3 = 1500$. Total 1650.

    The smaller is 1650. Answer (B).

    (A) is the left-to-right order. (C) multiplies all four sizes together, $100\cdot5\cdot10\cdot3$. (D) counts only the final product and forgets the 150 for $W_1W_2$.

    Let $A = \begin{bmatrix}1&2\\3&4\end{bmatrix}$ and $B = \begin{bmatrix}0&1\\1&0\end{bmatrix}$. Which of the following is/are true?

    1. $AB \ne BA$
    2. $(AB)\T = A\T B\T$
    3. $B^2 = I$, so $B^{-1} = B$.
    4. $\det(A + B) = \det A + \det B$

    Compute $AB$ and $BA$, and notice what multiplying by $B$ does to rows or columns. For a transpose of a product, remember that the order reverses.

    (A) True. $AB = \begin{bmatrix}2&1\\4&3\end{bmatrix}$ (the columns of $A$ swapped) and $BA = \begin{bmatrix}3&4\\1&2\end{bmatrix}$ (the rows swapped).

    (B) False. $(AB)\T = B\T A\T = \begin{bmatrix}2&4\\1&3\end{bmatrix}$, while $A\T B\T = \begin{bmatrix}3&1\\4&2\end{bmatrix}$.

    (C) True. $B^2 = \begin{bmatrix}0\cdot0 + 1\cdot1 & 0\cdot1 + 1\cdot0\\ 1\cdot0 + 0\cdot1 & 1\cdot1 + 0\cdot0\end{bmatrix} = I$: swapping twice changes nothing, so $B$ undoes itself.

    (D) False. $A + B = \begin{bmatrix}1&3\\4&4\end{bmatrix}$ has determinant $4 - 12 = -8$, but $\det A + \det B = (4 - 6) + (0 - 1) = -3$.

    Correct: A, C.

    • Write the sizes under each matrix before multiplying: the inner ones must match.
    • Read a matrix’s columns as “where the basis arrows land”.
    • Check an inverse by multiplying back to $I$.
    • Assuming $AB = BA$. Matrix multiplication is not commutative.
    • Writing $(AB)\T = A\T B\T$. The order reverses.
    • Multiplying matrices entry by entry. That’s a different operation (the Hadamard product), not the matrix product.
    1. An m × n matrix has m rows and n columns; entry aᵢⱼ is row i, column j.
    2. Ax = row-dot-products, or equivalently a weighted combination of A’s columns. AB needs matching inner sizes and is usually ≠ BA.
    3. A matrix transforms space: its columns are where the basis vectors land, and its determinant measures how much it scales area.

    $\begin{bmatrix}2&0\\0&3\end{bmatrix}$ does what to the plane?

    Rotates it by 90°
    Where does $(1,0)$ go? Read the first column.
    Stretches x by 2 and y by 3
    $(1,0) \to (2,0)$ and $(0,1) \to (0,3)$.
    Squashes it onto a line
    The determinant is $6 \ne 0$, so nothing is squashed.
    Reflects it
    No sign flips here.

    GATE 2026 Q21: $M$ rotates the plane by $\theta = 2\pi/5$. Which is $M^{2026}$?

    $I$
    $M^5 = I$ (five rotations of 72° make a full turn). Is 2026 a multiple of 5?
    $M$
    $2026 = 5\times405 + 1$, so $M^{2026} = (M^5)^{405}M = M$. Official key: (B).
    $M^2$
    Find the remainder of 2026 when divided by 5.
    $M^{-1}$
    $M^{-1} = M^4$, which would need a remainder of 4.

    If $A$ is $4\times 3$, then $A\T A$ is

    $4\times4$
    That’s $AA\T$.
    $3\times3$
    $(3\times4)(4\times3) = 3\times3$. It’s also symmetric, which matters in PCA.
    $4\times3$
    Multiply the sizes out: the outer dimensions survive.
    not defined
    The inner sizes are both 4, so it is defined.

    The unit vector in the direction of $(0, 3, 4)$ is

    $(0, 3, 4)$
    Its length is 5, not 1.
    $(0, 0.6, 0.8)$
    Divide by the length 5.
    $(0, \tfrac13, \tfrac14)$
    Divide by the length, not entry by entry.
    $(0, 0.75, 1)$
    Dividing by the largest entry doesn’t give length 1.

    The trace of $\begin{bmatrix}4&7\\-2&1\end{bmatrix}$ is

    18
    That’s the determinant.
    5
    $4 + 1$: the sum of the diagonal.
    10
    The trace uses only the diagonal entries.
    4
    Add both diagonal entries.

    The gradient of $f(\x) = \x\cdot\x$ (for $\x\in\R^2$) at $(1, 2)$ is

    $(1, 2)$
    $f = x_1^2 + x_2^2$; each partial derivative is $2x_i$.
    $(2, 4)$
    $\nabla(\x\cdot\x) = 2\x$.
    5
    That’s $f(1,2)$; the gradient is a vector.
    $(1, 4)$
    Differentiate each coordinate the same way.

    $\displaystyle\sum_{k=0}^{\infty} \frac{\ln 2}{2^k}$ equals

    $\ln 2$
    $\ln 2$ is only the first term.
    $2\ln 2 = \ln 4$
    $\ln 2 \cdot \frac{1}{1 - 1/2}$.
    $\ln 2 / 2$
    The geometric sum $1 + \tfrac12 + \tfrac14 + \cdots$ is 2.
    It diverges
    Ratio ½: it converges.

    $\displaystyle\int_0^1 (6x^2 - 2x)\,dx$ equals

    4
    That’s $12x - 2$ evaluated somewhere. Integrate, don’t differentiate.
    1
    $\big[2x^3 - x^2\big]_0^1 = 2 - 1$.
    3
    Don’t forget the $-x^2$ term.
    0
    Evaluate $2x^3 - x^2$ at 1.
    Every module complete

    Every question, answered right.

    You worked through every quiz and every practice problem in GATE Data Science & AI. That took real effort, and the understanding is yours to keep. Add your name to make a certificate.