REVISION AND PRACTICE

How to Solve Week 2 Questions

8 min read
On this page 7 headings

Swipe long formulas, tables or code sideways to see the rest.

Practise past-paper questions

Try each question, then reveal the answer and worked solution.

8 of 8 questions

Start here Week 2 questions are mostly numbers: compute a sigmoid, a loss, a gradient, one update, or a Taylor approximation. This page has every Week 2 question from five past Quiz 1 papers (2025 T1, T2, T3 and 2026 T1, T2). Write every line out — most marks are lost to small slips. All answers were checked with code.

Type 1 — Sigmoid output and the meaning of w and b

Learn the method

  1. z=wTx+bz = w^{T}x + b. Then σ(z)=11+e−z\sigma (z) = \frac{1}{1 + e^{-z}}.
  2. Useful values: e0=1,e−1=0.368,e−2=0.135,e−2.5=0.082,σ(0)=0.5,σ(−z)=1−σ(z)e^{0} = 1, e^{-1} = 0.368, e^{-2} = 0.135, e^{-2.5} = 0.082, \sigma (0) = 0.5, \sigma (-z) = 1 - \sigma (z).
  3. Where is the middle of σ(x+a)\sigma (x + a)? Atx+a=0→At x + a = 0 \to x=−ax = -a. So a bigger a shifts the curve left.
  4. A bigger weight makes the curve steeper; very large w → almost a step (a perceptron).
Past-paper question
2025 T2 Quiz 1Q634 marks

Question: Two sigmoid functions f(x)=11+e−(x+a)f(x) = \frac{1}{1 + e^{-(x+a)}} and g(x)=11+e−(x+b)g(x) = \frac{1}{1 + e^{-(x+b)}} are shown. Which is true? a>b⋅a<b⋅a=ba > b \cdot a < b \cdot a = b

Question figure — open to inspect the labels.
Question figure — open to inspect the labels.
Open image ↗
Question figure (redrawn exactly from the paper)
Reveal answer and solution

Answer: a>ba > b

How to solve:

  1. Each curve is 0.5 at its middle point. f is 0.5 where x+a=0→x=−ax + a = 0 \to x = -a. g is 0.5 at x=−bx = -b.
  2. From the graph, f reaches 0.5 near x=−3x = -3 and g near x=−1x = -1.
  3. −a=−3→a=3;−b=−1→b=1-a = -3 \to a = 3; -b = -1 \to b = 1. So a>ba > b. (Quick rule: the curve further left has the bigger shift.)
Past-paper question
2026 T2 Quiz 1Q114 marks

Question: Which statements about perceptrons and sigmoid neurons are correct?

  1. A perceptron’s output changes abruptly at the threshold; a sigmoid’s changes smoothly. (b) The sigmoid is differentiable, so it suits gradient-based learning. (c) With large enough weights, a sigmoid neuron can closely approximate a perceptron. (d) A network of perceptrons with one hidden layer can represent any Boolean function exactly. (e) A network of sigmoid neurons with one hidden layer can approximate any continuous function to any precision, given enough hidden neurons. (f) A single sigmoid neuron can represent every non-linear decision boundary in Rn\mathbb{R}^{n}.
Reveal answer and solution

Answer: (a), (b), (c), (d), (e)

How to solve:

  1. (a), (b): the two key differences from the lecture ✔.
  2. (c): large w makes σ(wx+b)a\sigma (wx + b) a near-step ✔.
  3. (d): Week 1 theorem (2n2^{n} hidden perceptrons) ✔. (e): universal approximation theorem ✔.
  4. (f): one sigmoid neuron still has a linear boundary (σ=0.5\sigma = 0.5 exactly when wTx+b=0w^{T}x + b = 0) ✘.

Type 2 — Loss, gradient and one gradient-descent step

Learn the method

Fory^=σ(z),z=wTx+bFor \hat{y} = \sigma (z), z = w^{T}x + b, and L=12(y^−y)2L = \frac{1}{2}(\hat{y} - y)^{2}:

  • ∂L/∂z=(y^−y)⋅y^⋅(1−y^)\partial L/\partial z = (\hat{y} - y) \cdot \hat{y} \cdot (1 - \hat{y}) — call this g
  • ∇w=g⋅x\nabla w = g \cdot x (one entry per input), ∇b=g\nabla b = g
  • Update: w ← w−η∇w,bw - \eta \nabla w, b ← b−η∇bb - \eta \nabla b

If the loss is (y−y^)2(y - \hat{y})^{2} without the ½ (or (1/n)∑(1/n)\sum with n=1n = 1), every gradient is 2× bigger: g=2(y^−y)y^(1−y^)g = 2(\hat{y} - y)\hat{y}(1 - \hat{y}).

Past-paper question
2026 T2 Quiz 1Q153 marks

Question: Sigmoid neuron f(x)=11+e−(wx+b)f(x) = \frac{1}{1 + e^{-(wx+b)}}. Training example (x,y)=(2,0.8),w=0,b=0(x, y) = (2, 0.8), w = 0, b = 0, loss L=12(f(x)−y)2L = \frac{1}{2}(f(x) - y)^{2}. Find ∇\nabla _w L (2 decimals).

Reveal answer and solution

Answer: −0.15 (key range −0.17 to −0.13)

How to solve:

  1. z=0×2+0=0→f=σ(0)=0.5.z = 0 \times 2 + 0 = 0 \to f = \sigma (0) = 0.5.
  2. f−y=0.5−0.8=−0.3.f - y = 0.5 - 0.8 = -0.3.
  3. f(1−f)=0.5×0.5=0.25.f(1 - f) = 0.5 \times 0.5 = 0.25.
  4. ∇w=(−0.3)×0.25×2=\nabla w = (-0.3) \times 0.25 \times 2 = −0.15.
Past-paper question
2025 T1 Quiz 1Q71–741 + 1 + 1 + 3 marks

Question: A sigmoid neuron takes x=(1,0.5,1),w=(0.5,1,0.5),b=1;z=wTx+b,y^=11+e−zx = (1, 0.5, 1), w = (0.5, 1, 0.5), b = 1; z = w^{T}x + b, \hat{y} = \frac{1}{1 + e^{-z}}, loss L=12(y−y^)2L = \frac{1}{2}(y - \hat{y})^{2}. Q71: z? Q72:y^Q72: \hat{y}? Q73: with y=0y = 0, the loss? Q74: update the weights and bias once with gradient descent, η=2,y=0\eta = 2, y = 0. New loss? (2 decimals each)

Reveal answer and solution

Answer: Q71: 2.50 · Q72: 0.92 · Q73: 0.43 · Q74: 0.40 (key ranges 2.47–2.53, 0.89–0.95, 0.39–0.45, 0.36–0.42)

How to solve:

  1. Q71:z=0.5×1+1×0.5+0.5×1+1=0.5+0.5+0.5+1=Q71: z = 0.5\times 1 + 1\times 0.5 + 0.5\times 1 + 1 = 0.5 + 0.5 + 0.5 + 1 = 2.5.
  2. Q72:e−2.5=0.0821→y^=1/1.0821=Q72: e^{-2.5} = 0.0821 \to \hat{y} = 1/1.0821 = 0.924.
  3. Q73:L=12(0−0.924)2=12×0.854=Q73: L = \frac{1}{2}(0 - 0.924)^{2} = \frac{1}{2} \times 0.854 = 0.427.
  4. Q74 — gradients:
    • g=(y^−y)y^(1−y^)=0.924×0.924×0.076=g = (\hat{y} - y) \hat{y} (1 - \hat{y}) = 0.924 \times 0.924 \times 0.076 = 0.0648
    • ∇w=g⋅x=(0.0648,0.0324,0.0648);∇b=0.0648\nabla w = g\cdot x = (0.0648, 0.0324, 0.0648); \nabla b = 0.0648
  5. Update with η=2\eta = 2:
    • w=(0.5−0.1296,1−0.0648,0.5−0.1296)=(0.3704,0.9352,0.3704)w = (0.5 - 0.1296, 1 - 0.0648, 0.5 - 0.1296) = (0.3704, 0.9352, 0.3704)
    • b=1−0.1296=0.8704b = 1 - 0.1296 = 0.8704
  6. Newz=0.3704+0.4676+0.3704+0.8704=2.0789→y^=σ(2.0789)=0.8888New z = 0.3704 + 0.4676 + 0.3704 + 0.8704 = 2.0789 \to \hat{y} = \sigma (2.0789) = 0.8888
  7. New loss =12×0.88882=12×0.790== \frac{1}{2} \times 0.8888^{2} = \frac{1}{2} \times 0.790 = 0.395 — smaller than 0.427, as it should be.
Past-paper question
2026 T1 Quiz 1Q74 marks

Question: y^i=11+e−(wTxi+b)\hat{y}_{i} = \frac{1}{1 + e^{-(w^{T}x_{i}+b)}}, loss L(w,b)=(1/n)∑(yi−y^i)2L(w, b) = (1/n) \sum (y_{i} - \hat{y}_{i})^{2}. One example x=(1,1),y=1x = (1, 1), y = 1. Start w=(0,0),b=0w = (0, 0), b = 0. Compute the loss after one update of w and b with η=1\eta = 1 (2 decimals).

Reveal answer and solution

Answer: 0.10 (key range 0.08–0.12)

How to solve:

  1. n=1n = 1, so L=(1−y^)2L = (1 - \hat{y})^{2} — no ½, so the gradient has a factor 2.
  2. z=0→y^=0.5.z = 0 \to \hat{y} = 0.5.
  3. ∂L/∂z=−2(1−y^)⋅y^(1−y^)=−2×0.5×0.25=\partial L/\partial z = -2(1 - \hat{y}) \cdot \hat{y}(1 - \hat{y}) = -2 \times 0.5 \times 0.25 = −0.25.
  4. ∇w=−0.25×(1,1)=(−0.25,−0.25);∇b=−0.25.\nabla w = -0.25 \times (1, 1) = (-0.25, -0.25); \nabla b = -0.25.
  5. Update: w=(0,0)−1×(−0.25,−0.25)=(0.25,0.25);b=0.25w = (0, 0) - 1 \times (-0.25, -0.25) = (0.25, 0.25); b = 0.25.
  6. Newz=0.25+0.25+0.25=0.75→y^=11+e−0.75=1/1.4724=0.679New z = 0.25 + 0.25 + 0.25 = 0.75 \to \hat{y} = \frac{1}{1 + e^{-0.75}} = 1/1.4724 = 0.679.
  7. New loss =(1−0.679)2=0.3212== (1 - 0.679)^{2} = 0.321^{2} = 0.103.

Type 3 — Slopes and Taylor series

Learn the method

  1. Steepest slope at a point == largest |derivative| at that point. Differentiate each function, put in the x value.
  2. Taylor (quadratic) at w0w_{0}:L(w)≈L(w0)+L′(w0)(w−w0)+L′′(w0)/2⋅(w−w0)2. L(w) \approx L(w_{0}) + L'(w_{0})(w - w_{0}) + L''(w_{0})/2 \cdot (w - w_{0})^{2}.
  3. Taylor is only good near w0;farw_{0}; far away it gets worse.
Past-paper question
2025 T1 Quiz 1Q613 marks

Question: Which function has the steepest slope at x=1x = 1? log10(x)⋅ln⁡(x2)⋅x⋅x3log_{10}(x) \cdot \ln (x^{2}) \cdot \sqrt{x} \cdot x^{3}

Reveal answer and solution

Answer: x3x^{3}

How to solve:

  1. log10(x)log_{10}(x): derivative 1/(x ln 10) → at 1:1/2.303=1: 1/2.303 = 0.434
  2. ln⁡(x2)=2ln⁡x\ln (x^{2}) = 2 \ln x: derivative 2/x → at 1: 2
  3. x\sqrt{x}: derivative 12x→\frac{1}{2\sqrt{x}} \to at 1: 0.5
  4. x3x^{3}: derivative 3x2→3x^{2} \to at 1: 3 ← biggest
Past-paper question
2025 T3 Quiz 1Q493 marks

Question: L(w)=ln⁡(1+w)L(w) = \ln (1 + w). Using L(w)≈L(w0)+L′(w0)/1!(w−w0)+L′′(w0)/2!(w−w0)2L(w) \approx L(w_{0}) + L'(w_{0})/1! (w - w_{0}) + L''(w_{0})/2! (w - w_{0})^{2}, find the quadratic Taylor approximation at w0=0w_{0} = 0. Options: 0⋅w−w2/2⋅w+w2/2⋅−∞0 \cdot w - w^{2}/2 \cdot w + w^{2}/2 \cdot -\infty

Reveal answer and solution

Answer: w−w2/2w - w^{2}/2

How to solve:

  1. L(0)=ln⁡1=L(0) = \ln 1 = 0.
  2. L′(w)=11+w→L′(0)=L'(w) = \frac{1}{1 + w} \to L'(0) = 1.
  3. L′′(w)=−11+w2→L′′(0)=L''(w) = -\frac{1}{1 + w}^{2} \to L''(0) = −1.
  4. L(w)≈0+1⋅w+(−1)/2⋅w2=L(w) \approx 0 + 1\cdot w + (-1)/2 \cdot w^{2} = w−w2/2w - w^{2}/2.
Past-paper question
2026 T2 Quiz 1Q124 marks

Question: σ(z)=11+e−z\sigma (z) = \frac{1}{1 + e^{-z}}. Which are true?

  1. Using e−z≈1−z,σ(z)≈1/2+z/4e^{-z} \approx 1 - z, \sigma (z) \approx 1/2 + z/4 near z=0z = 0. (b)σ′(0)=1/4(b) \sigma '(0) = 1/4. (c) The first-order approximation means σ\sigma is exactly linear for all z. (d) As |z| grows, the linear approximation gets worse. (e) Smooth differentiability of σ\sigma enables gradient-based learning, unlike the hard-threshold perceptron.
Reveal answer and solution

Answer: (a), (b), (d), (e)

How to solve:

    1. σ≈11+1−z=12−z=12⋅11−z/2≈12(1+z/2)=\sigma \approx \frac{1}{1 + 1 - z} = \frac{1}{2 - z} = \frac{1}{2} \cdot \frac{1}{1 - z/2} \approx \frac{1}{2}(1 + z/2) = ½ + z/4 ✔ (using 11−u≈1+u\frac{1}{1 - u} \approx 1 + u for small u).
    1. σ′=σ(1−σ)=0.5×0.5=\sigma ' = \sigma (1 - \sigma ) = 0.5 \times 0.5 = ¼ ✔ — matches the slope of ½ + z/4.
    1. σ\sigma stays between 0 and 1, a line doesn’t → only approximately linear near 0 ✘.
    1. ✔ — e.g. at z=10z = 10 the line gives 3, but σ(10)≈1\sigma (10) \approx 1.
    1. ✔ — the lecture’s reason for moving to sigmoid neurons.

Practice set (new questions)

P1.σ(2)=? P1. \sigma (2) = ? 11+0.135=0.881. \frac{1}{1 + 0.135} = 0.881.
P2. f(x)=σ(x−1)f(x) = \sigma (x - 1), data (1,1),L=12(y−f)2(1, 1), L = \frac{1}{2}(y - f)^{2}. ∇w\nabla w and ∇b\nabla b? f=0.5.g=(0.5−1)(0.25)=−0.125.∇w=−0.125×1=−0.125;∇b=−0.125. f = 0.5. g = (0.5 - 1)(0.25) = -0.125. \nabla w = -0.125 \times 1 = -0.125; \nabla b = -0.125.
P3. Where is σ(4x+8)\sigma (4x + 8) equal to 0.5? 4x+8=0→x=−2. 4x + 8 = 0 \to x = -2.
P4. Quadratic Taylor of eʷ at w0=0w_{0} = 0? 1+w+w2/2. 1 + w + w^{2}/2.
P5. Which has the steepest slope at x=4:x,ln⁡x,x2/16x = 4: \sqrt{x}, \ln x, x^{2}/16? Derivatives: 12⋅2=0.25,1/4=0.25,2⋅4/16=0.5→x2/16\frac{1}{2\cdot 2} = 0.25, 1/4 = 0.25, 2\cdot 4/16 = 0.5 \to x^{2}/16.
P6. Same as 2026 T2 Q15 but y=0.2y = 0.2. ∇w\nabla w? (0.5−0.2)×0.25×2=+0.15. (0.5 - 0.2) \times 0.25 \times 2 = +0.15.
YOUR STUDY PROGRESS

Finished this section? Save your progress.

Back to top ↑