Back to the 2025 paper

Unit 3: Classification & Regression

20257m

Explain the Perceptron learning algorithm. How does it update weights? Discuss its convergence properties.

Worked SolutionAI Assisted

Perceptron Learning Algorithm (Rosenblatt 1957):

Linear binary classifier f(x)=sign(wTx+b)f(x)=sign(w^T x + b), y∈{−1,1}y\in\{-1,1\} (or {0,1}\{0,1\}).

Algorithm:
Initialize w=0,b=0w=0, b=0
Repeat until convergence:
For each (xi,yi)(x_i,y_i) in training (random order):
Compute z=wTxi+bz = w^T x_i + b
Predict y^=sign(z)\hat y = sign(z)
If yiz≤0y_i z \le 0 (misclassified):
w:=w+ηyixiw := w + \eta y_i x_i
b:=b+ηyib := b + \eta y_i
else no update
η>0\eta>0 learning rate (often 1).

Weight Update Intuition: Move weight vector toward misclassified positive example (+yx+y x) and away from negative, increasing score for correct class.

With {0,1}\{0,1\} labels: w:=w+η(y−y^)xw:=w+\eta(y-\hat y)x, b:=b+η(y−y^)b:=b+\eta(y-\hat y)

Convergence Properties:

  • Perceptron Convergence Theorem: If data is linearly separable with margin γ>0\gamma>0 and radius R=max⁡∣∣xi∣∣R=\max||x_i||, perceptron makes at most (R/γ)2(R/\gamma)^2 mistakes and converges to a separating hyperplane in finite steps, regardless of initialization or order. Does not guarantee maximum margin (unlike SVM).
  • If data not separable, algorithm never converges, cycles — use Pocket algorithm (keep best weights) or averaging.
  • Not sensitive to η\eta when separable (scaling).
  • Online algorithm, mistake-driven, O(nd)O(nd) per epoch, fast.

Limitations: Cannot solve XOR, needs separable data; output is hard threshold, no probabilities. Extensions: kernel perceptron, voted perceptron, averaged perceptron for stability.
Example: AND gate converges in few steps; XOR never converges without hidden layer.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.