REVISION AND PRACTICE

How to Solve Week 4 Questions

13 min read
On this page 9 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.

15 of 15 questions

Start here Week 4 questions ask you to run a few optimiser steps by hand, count updates per epoch, read loss graphs, or pick true statements about GD, momentum, NAG and SGD. This page has every Week 4 question from five past Quiz 1 papers (2025 T1, T2, T3 and 2026 T1, T2). Make a small table, one row per step. All answers were checked with code.

Type 1 — Counting updates (epochs and steps)

Learn the method

Algorithm Updates per epoch
Vanilla (batch) GD 1
SGD(B=1)SGD (B = 1) N
Mini-batch GD N / B (round up if it doesn’t divide)

Total updates == (updates per epoch) × (number of epochs).

Past-paper question
2025 T1 Quiz 1Q633 marks

Question: A network is trained on 5000 data points using mini-batch gradient descent with batch size 50, for 100 epochs. How many times does each parameter get updated?

Reveal answer and solution

Answer: 10000

How to solve:

  1. Updates per epoch =5000/50=100= 5000 / 50 = 100.
  2. Total =100×100== 100 \times 100 = 10,000.
Past-paper question
2025 T2 Quiz 1Q662 marks

Question: Mini-batch gradient descent is run on a dataset of size 1000 with batch size 25 for 10 epochs. Find the number of times each parameter is updated.

Reveal answer and solution

Answer: 400

How to solve:

  1. 1000/25=401000 / 25 = 40 updates per epoch.
  2. 40×10=40 \times 10 = 400.
Past-paper question
2026 T2 Quiz 1Q18–192 + 2 marks

Question: You classify 200 bird species from 100,000 audio clips, starting with vanilla gradient descent. Q18: How many parameter updates per epoch? Q19: You switch to mini-batch GD with B=50B = 50. How many updates per epoch now?

Reveal answer and solution

Answer: Q18: 1 · Q19: 2000

How to solve:

  1. Vanilla GD uses all the data for one update → 1 per epoch. (The 200 classes don’t matter.)
  2. Mini-batch: 100,000/50=100,000 / 50 = 2000.
Past-paper question
2026 T1 Quiz 1Q63 marks

Question: 12 training samples, vanilla gradient descent for 4 epochs. Learning rate ηt=0.8exp⁡(−0.2t)\eta _{t} = 0.8 \exp (-0.2t), where t starts at 0 and increases only when the parameters are updated. What is ηt\eta _{t} at the end of training? (3 decimals)

Reveal answer and solution

Answer: 0.439 (key range 0.436–0.442)

How to solve:

  1. Vanilla GD → 1 update per epoch → 4 updates in total, made at t=0,1,2,3t = 0, 1, 2, 3.
  2. The last update uses t=3:η3=0.8×e−0.6=0.8×0.5488=t = 3: \eta _{3} = 0.8 \times e^{-0.6} = 0.8 \times 0.5488 = 0.439.
  3. Note: the key treats “end of training” as the rate used in the last update (t=3)(t = 3). If you counted one more step (t=4)you(t = 4) you would get0.8×e−0.8=0.359get 0.8 \times e^{-0.8} = 0.359, which the key does not accept.

Type 2 — Gradient descent and momentum steps by hand

Learn the method

  • GD:w←w−η∇w. w ← w - \eta \nabla w.
  • Momentum (lecture form): ut=βut−1+∇wtu_{t} = \beta u_{t-1} + \nabla w_{t}, then wt+1=wt−ηutw_{t+1} = w_{t} - \eta u_{t} (start u−1=0u_{-1} = 0).
  • Some questions write it as ut=βut−1−∇wt,wt=wt−1+ηutu_{t} = \beta u_{t-1} - \nabla w_{t}, w_{t} = w_{t-1} + \eta u_{t} — the same idea with u pointing downhill. Always use the exact rule given in the question.
  • ForL=(w−c)2,∇=2(w−c)For L = (w - c)^{2}, \nabla = 2(w - c). Forf=x2+y2,∇=(2x,2y)For f = x^{2} + y^{2}, \nabla = (2x, 2y).
  • “w did not change” → the step ηut\eta u_{t} was 0→ut=00 \to u_{t} = 0.
Past-paper question
2025 T3 Quiz 1Q524 marks

Question: Minimise L(w)=(w+3)2L(w) = (w + 3)^{2} with momentum: ut=βut−1−∇wt,wt=wt−1+ηutu_{t} = \beta u_{t-1} - \nabla w_{t}, w_{t} = w_{t-1} + \eta u_{t}. η=0.2,β=0.8,w0=5,u0=0\eta = 0.2, \beta = 0.8, w_{0} = 5, u_{0} = 0. Find w2w_{2} (2 decimals).

Reveal answer and solution

Answer: −2.68 (key range −2.72 to −2.64)

How to solve:

  1. ∇=2(w+3).\nabla = 2(w + 3).
  2. Step 1:∇1: \nabla at w0=5→2×8=16w_{0} = 5 \to 2 \times 8 = 16. u1=0.8×0−16=−16u_{1} = 0.8 \times 0 - 16 = -16. w1=5+0.2×(−16)=5−3.2=w_{1} = 5 + 0.2 \times (-16) = 5 - 3.2 = 1.8.
  3. Step 2:∇2: \nabla at 1.8→2×4.8=9.61.8 \to 2 \times 4.8 = 9.6. u2=0.8×(−16)−9.6=−12.8−9.6=−22.4u_{2} = 0.8 \times (-16) - 9.6 = -12.8 - 9.6 = -22.4. w2=1.8+0.2×(−22.4)=1.8−4.48=w_{2} = 1.8 + 0.2 \times (-22.4) = 1.8 - 4.48 = −2.68.
  4. The minimum is at −3, so momentum got very close in only 2 steps.
Past-paper question
2026 T1 Quiz 1Q14–153 + 3 marks

Question: Linear regression y^=wx\hat{y} = wx with J(w)=12m∑(wxi−yi)2J(w) = \frac{1}{2m} \sum (wx_{i} - y_{i})^{2}, mini-batch size m=2,η=0.1,β=0.9,w0=1,u−1=0m = 2, \eta = 0.1, \beta = 0.9, w_{0} = 1, u_{-1} = 0. Rules: ut=βut−1+∇J(wt),wt+1=wt−ηutu_{t} = \beta u_{t-1} + \nabla J(w_{t}), w_{t+1} = w_{t} - \eta u_{t}. First mini-batch: (x,y)=(1,2)(x, y) = (1, 2) and (2, 4). Q14:∇J(w0)Q14: \nabla J(w_{0}) for this batch? (−2.5 · −5.0 · −7.5 · 5.0) Q15: the velocity u0u_{0} after the first iteration (1 decimal)?

Reveal answer and solution

Answer: Q14: −2.5 · Q15: −2.5

How to solve:

  1. ∇J=(1/m)∑(wxi−yi)⋅xi\nabla J = (1/m) \sum (wx_{i} - y_{i})\cdot x_{i} (the ½ cancels the 2 from the square).
  2. Point 1:(1×1−2)×1=−11: (1\times 1 - 2) \times 1 = -1. Point 2:(1×2−4)×2=−42: (1\times 2 - 4) \times 2 = -4.
  3. ∇J=(−1−4)/2=\nabla J = (-1 - 4)/2 = −2.5.
  4. u0=0.9×0+(−2.5)=u_{0} = 0.9 \times 0 + (-2.5) = −2.5 (the first velocity is just the first gradient).
Past-paper question
2025 T1 Quiz 1Q66–672 + 2 marks

Question: Momentum GD with β=0.8\beta = 0.8 and η=0.1\eta = 0.1 optimises f(w) of two parameters. At time t the history vector is ut−1=(1,−1)u_{t-1} = (1, -1). After one iteration, wt+1=wtw_{t+1} = w_{t}. Q66: Find ∇wt\nabla w_{t}. ((−0.8, 0.8) · (0.08, −0.08) · (−0.08, 0.08) · (1, −1)) Q67: the angle between ut−1u_{t-1} and ∇wt\nabla w_{t} in degrees, in [0, 360]?

Reveal answer and solution

Answer: Q66: (−0.8, 0.8) · Q67: 180

How to solve:

  1. wt+1=wt−ηut=wt→ηut=0→w_{t+1} = w_{t} - \eta u_{t} = w_{t} \to \eta u_{t} = 0 \to ut=0u_{t} = 0.
  2. ut=βut−1+∇wt=0→∇wt=−0.8×(1,−1)=u_{t} = \beta u_{t-1} + \nabla w_{t} = 0 \to \nabla w_{t} = -0.8 \times (1, -1) = (−0.8, 0.8).
  3. ∇wt=−0.8×ut−1\nabla w_{t} = -0.8 \times u_{t-1} — exactly the opposite direction → angle == 180°. (The new gradient cancelled the momentum.)
Past-paper question
2025 T2 Quiz 1Q74–754 + 6 marks

Question: Minimise f(x,y)=x2+y2f(x, y) = x^{2} + y^{2} from any point (x0,y0)≠(x_{0}, y_{0}) \ne origin. Q74: Run two steps of GD with η=0.2\eta = 0.2 to get(x2,y2)=α(x0,y0)get (x_{2}, y_{2}) = \alpha (x_{0}, y_{0}). Find α (2 decimals). Q75: Momentum with u−1=(0,0),η=0.2:ut=βut−1+∇f(xt,yt),(xt+1,yt+1)=(xt,yt)−ηutu_{-1} = (0, 0), \eta = 0.2: u_{t} = \beta u_{t-1} + \nabla f(x_{t}, y_{t}), (x_{t+1}, y_{t+1}) = (x_{t}, y_{t}) - \eta u_{t}. What β\beta makes two steps reach the global minimum, i.e. (x2,y2)=(0,0)(x_{2}, y_{2}) = (0, 0)? (2 decimals)

Reveal answer and solution

Answer: Q74:α=0.36⋅Q75:β=0.90Q74: \alpha = 0.36 \cdot Q75: \beta = 0.90 (key ranges 0.35–0.37, 0.89–0.91)

How to solve:

  1. ∇f=(2x,2y)\nabla f = (2x, 2y), so each coordinate can be done on its own. Use x.
  2. Q74:x1=x0−0.2×2x0=0.6x0;x2=0.6x1=0.36x0→Q74: x_{1} = x_{0} - 0.2 \times 2x_{0} = 0.6x_{0}; x_{2} = 0.6x_{1} = 0.36x_{0} \to α=0.36\alpha = 0.36.
  3. Q75, step 1:u0=0+2x0=2x0;x1=x0−0.2×2x0=0.6x01: u_{0} = 0 + 2x_{0} = 2x_{0}; x_{1} = x_{0} - 0.2 \times 2x_{0} = 0.6x_{0}.
  4. Step 2:u1=β×2x0+2×0.6x0=(2β+1.2)x0;x2=0.6x0−0.2(2β+1.2)x0=(0.36−0.4β)x02: u_{1} = \beta \times 2x_{0} + 2 \times 0.6x_{0} = (2\beta + 1.2)x_{0}; x_{2} = 0.6x_{0} - 0.2(2\beta + 1.2)x_{0} = (0.36 - 0.4\beta )x_{0}.
  5. x2=0→0.4β=0.36→x_{2} = 0 \to 0.4\beta = 0.36 \to β=0.9\beta = 0.9.

Type 3 — Reading loss graphs (learning rate and β)

Learn the method

What the curve does Cause
Falls smoothly but slowly ηtoo\eta too small (or β=0\beta = 0 on a flat surface)
Falls fast to a low value η\eta about right
Bounces up and down, never settles ηtoo\eta too large
Grows bigger and bigger (blows up) ηtoo\eta too large to converge at all
Momentum: bigger β\beta faster at first, but more and longer oscillations

ForL=w2:GDFor L = w^{2}: GD gives w ← (1−2η)w(1 - 2\eta )w. It converges only if ∣1−2η∣<1,i|1 - 2\eta | < 1, i.e. 0<η<10 < \eta < 1.

Past-paper question
2025 T3 Quiz 1Q463 marks

Question: The graph shows training loss across epochs for learning rates 0.001, 0.01 and 1.0. Graph A: smooth but very slow convergence. Graph B: fast convergence to a low loss. Graph C: oscillates and does not converge. Match each graph to its learning rate.

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 → 0.001, B → 0.01, C → 1.0

How to solve:

  1. Slow, smooth → smallest η=\eta = 0.001 (A).
  2. Bouncing, no convergence → biggest η=\eta = 1.0 (C).
  3. The one left, fast and low → 0.01 (B).
Past-paper question
2026 T2 Quiz 1Q42 marks

Question: Two runs of gradient descent on L(w)=w2L(w) = w^{2} from the same start w0=2w_{0} = 2 give Graph X and Graph Y with two learning rates. Which could be correct? (X uses η=1.1,Y\eta = 1.1, Y uses η=0.3\eta = 0.3) · (X uses η=0.3,Y\eta = 0.3, Y uses η=1.1\eta = 1.1)

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: X uses η=0.3,Y\eta = 0.3, Y uses η=1.1\eta = 1.1

How to solve:

  1. GD on w2:ww^{2}: w ← w−η×2w=(1−2η)ww - \eta \times 2w = (1 - 2\eta )w.
  2. η=0.3\eta = 0.3: factor 0.4→w=2,0.8,0.32…→0.4 \to w = 2, 0.8, 0.32 \ldots \to loss 4, 0.64, 0.10 … falls fast → Graph X.
  3. η=1.1\eta = 1.1: factor −1.2 → |w| grows by 1.2 each step → loss × 1.44 each step: 4×1.4411≈2204 \times 1.44^{11} \approx 220 at step 11 → Graph Y.
Past-paper question
2026 T2 Quiz 1Q52 marks

Question: L(w)=(w−5)2L(w) = (w - 5)^{2} is minimised from w0=−5w_{0} = -5 with η=0.04\eta = 0.04 using vanilla GD(β=0)GD (\beta = 0) and momentum GD with β∈{0.5,0.9,0.99}\beta \in \{0.5, 0.9, 0.99\}. Match each curve to its β\beta .

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: S:β=0,T:β=0.5,U:β=0.9,V:β=0.99S: \beta = 0, T: \beta = 0.5, U: \beta = 0.9, V: \beta = 0.99

How to solve:

  1. No momentum → smooth fall with no bounce at all → S(β=0). (\beta = 0).
  2. Small momentum → fastest fall with almost no overshoot → T(β=0.5). (\beta = 0.5).
  3. More momentum → a few overshoots that die out → U(β=0.9). (\beta = 0.9).
  4. Huge momentum → keeps swinging for 100+ steps → V (β=0.99)(\beta = 0.99). (The figure above was made by running exactly these four settings in code.)

Type 4 — Concept statements (GD, momentum, NAG, SGD)

Learn the method

  • Batch GD: true gradient; each step lowers the loss for small η\eta ; very expensive on huge data.
  • SGD: gradient from one point → cheap, noisy, no guarantee per step.
  • Mini-batch: ⌈N/B⌉ updates per epoch; less noisy than SGD.
  • Momentum: uses past gradients; fast on flat areas; can overshoot narrow valleys.
  • NAG: gradient at the look-ahead point; smaller U-turns. Neither momentum nor NAG changes the learning rate.
  • Update size ∝ slope: steep → big steps; gentle → tiny steps.
Past-paper question
2025 T1 Quiz 1Q603 marks

Question: Which statement correctly distinguishes the Momentum optimiser from Nesterov Accelerated Gradient (NAG)?

  1. Momentum uses the current gradient to update the velocity, while NAG uses a look-ahead gradient based on a tentative future position. (b) Momentum is computationally faster because it skips the look-ahead gradient. (c) NAG adjusts the step size dynamically. (d) Momentum uses an adaptive learning rate, NAG a fixed one.
Reveal answer and solution

Answer: (a)

How to solve:

  1. This is exactly the lecture’s “look before you leap” idea → (a) ✔.
    1. Both compute one gradient per step (just at different points) ✘.
  2. (c), (d) Neither is an adaptive-learning-rate method (that is AdaGrad / RMSProp / Adam) ✘.
Past-paper question
2025 T1 Quiz 1Q623 marks

Question: For gradient descent wt+1=wt−η∇wtw_{t+1} = w_{t} - \eta \nabla w_{t}, select the correct behaviours: (a) update is tiny on a gentle loss surface (b) tiny on a steep surface (c) large on a steep surface (d) large on a gentle surface.

Reveal answer and solution

Answer: (a) and (c)

How to solve:

  1. Step size =η×= \eta \times slope.
  2. Gentle → small slope → tiny step (a) ✔. Steep → big slope → large step (c) ✔.
Past-paper question
2025 T3 Quiz 1Q483 marks

Question: Training on billions of data points, batch gradient descent is computationally infeasible. What is the main reason, requiring an alternative like SGD?

Reveal answer and solution

Answer: Batch GD must compute the gradient over the entire dataset for a single update, which is very expensive.

How to solve:

  1. One step of batch GD=GD = one gradient per data point, summed → billions of calculations per update.
  2. Wrong options: “can’t fit in RAM” (data can be streamed), “gradient too noisy” (batch GD is the least noisy), “guaranteed to get stuck in sharp minima” (not a lecture fact).
Past-paper question
2026 T2 Quiz 1Q73 marks

Question: Which statements about training neural networks are TRUE?

  1. SGD(B=1)SGD (B = 1) computes the true gradient of the total loss at each step. (b) Mini-batch GD with batch size B on N points does ⌈N/B⌉ updates per epoch. (c) Momentum GD can overshoot a narrow valley because accumulated velocity carries the parameters past the minimum. (d) In vanilla (batch) GD, each step is guaranteed to decrease the loss for a small enough learning rate on a smooth loss.
Reveal answer and solution

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

How to solve:

    1. SGD uses one point → an estimate, not the true gradient ✘.
    1. ✔ (the last batch may be smaller, hence the ceiling).
    1. ✔ — the U-turns from the lecture.
    1. ✔ — the true gradient always points downhill locally.

Practice set (new questions)

P1. N=2400,B=64,5N = 2400, B = 64, 5 epochs. Updates? ⌈2400/64⌉ == ⌈37.5⌉ =38per= 38 per epoch → 190.
P2. L=(w−2)2,w0=0,η=0.25L = (w - 2)^{2}, w_{0} = 0, \eta = 0.25. Two GD steps? ∇=2(w−2).w1=0−0.25(−4)=1.w2=1−0.25(−2)=1.5. \nabla = 2(w - 2). w_{1} = 0 - 0.25(-4) = 1. w_{2} = 1 - 0.25(-2) = 1.5.
P3. Same as P2 with momentum β=0.5(ut=βut−1+∇,w=w−ηu)\beta = 0.5 (u_{t} = \beta u_{t-1} + \nabla , w = w - \eta u). w2w_{2}? u0=−4,w1=1u_{0} = -4, w_{1} = 1. u1=0.5(−4)+(−2)=−4,w2=1−0.25(−4)=2u_{1} = 0.5(-4) + (-2) = -4, w_{2} = 1 - 0.25(-4) = 2 — exactly the minimum.
P4. ForL=w2For L = w^{2}, which η\eta values make GD converge? ∣1−2η∣<1→0<η<1|1 - 2\eta | < 1 \to 0 < \eta < 1. (η=0.5\eta = 0.5 reaches 0 in one step.)
P5. ηt=11+0.5t\eta _{t} = \frac{1}{1 + 0.5t}. Vanilla GD, 3 epochs, t starts at 0. Rate used in the last update? Updates at t=0,1,2→η2=11+1=0.5t = 0, 1, 2 \to \eta _{2} = \frac{1}{1 + 1} = 0.5.
P6. ut−1=(2,0),β=0.5u_{t-1} = (2, 0), \beta = 0.5, and w did not change after the step. ∇wt\nabla w_{t}? ut=0→∇wt=−0.5×(2,0)=(−1,0). u_{t} = 0 \to \nabla w_{t} = -0.5 \times (2, 0) = (-1, 0).
YOUR STUDY PROGRESS

Finished this section? Save your progress.

Back to top ↑