Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Learning from mistakes
The perceptron is a threshold neuron that learns. It looks at one example at a time; if it gets it right, nothing changes; if it gets it wrong, it nudges its weights towards the right answer by adding (or subtracting) the example itself. If the two classes can be separated by a straight boundary, this simple rule is guaranteed to find one after a limited number of mistakes. If they cannot, it never settles.
The perceptron was the first machine that learned from data, built in hardware in 1958. Its mistake bound is the template for online-learning guarantees, and its capacity result explains why a single layer can memorise only so much: a lesson that motivates depth.
- 1. The perceptron updates its weights…
- 2. On separable data it…
- 3. On non-separable data it…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Rule: predict sign(w·x); if y(w·x) ≤ 0, set w ← w + yx. Example: w = (0, 0), x = (1, 2), y = 1 → w = (1, 2); with w = (1, 0), x = (1, 2), y = −1 → w = (0, −2).
- Margin: γ = min yᵢ(u·xᵢ) for a unit vector u that separates the data; R = max ‖xᵢ‖.
- Novikoff’s bound: at most (R/γ)² mistakes. R = 1, γ = 0.1 → 100; R = 2, γ = 0.5 → 16.
- Cover’s count: N points in general position in ℝᵈ admit C(N, d) = 2Σ_(k < d) binom(N − 1, k) labelings separable by a hyperplane through the origin. Example: C(3, 2) = 6 of 8; C(10, 5) = 512 of 1024, exactly half.
- Capacity: about 2d random labels can be memorised.
- 1. Mistake bound for R = 2, γ = 0.5:
- 2. C(10, 5)/2¹⁰ is…
- 3. Capacity of a perceptron in d dimensions is about…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.The perceptron in code
Exercise 1. On unit-norm data in 5 dimensions with margins 0.3, 0.1 and 0.03, the perceptron made 3, 17 and 52 mistakes, within Novikoff’s bounds of 11, 100 and 1111, and always ended with zero training errors. The bound is a worst case and was far from tight.
Practice.
- For non-separable data, use the averaged perceptron or the pocket algorithm (D2-21), or move to logistic regression or an SVM.
- Shuffle the examples each epoch; the mistake bound holds for any order, but convergence speed and the final boundary depend on it.
- A bias is handled by appending a constant 1 to every input.
for x, t in zip(X, y):
if t * (w @ x) <= 0: w += t * x- 1. In exercise 1, mistakes at γ = 0.1 were…
- 2. A bias is added by…
- 3. For non-separable data use…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Novikoff’s proof. After k mistakes, w·u ≥ kγ (each mistake adds at least γ along u) and ‖w‖² ≤ kR² (each mistake adds at most R², since the cross term is non-positive). Then kγ ≤ w·u ≤ ‖w‖ ≤ √k·R, so k ≤ (R/γ)².
Cover’s theorem. Counting the regions into which N hyperplanes (one per point, in weight space) cut ℝᵈ gives C(N, d). For large d the separable fraction drops sharply from 1 to 0 around N = 2d, so a perceptron’s capacity is two patterns per weight.
Limits of one layer. Minsky and Papert (1969) showed that single-layer perceptrons cannot compute parity or connectedness without units that see the whole input, which slowed neural-network research until multilayer networks could be trained (E6-4).
Online learning. The perceptron is an online algorithm with a mistake bound independent of the number of examples and of the dimension, given R and γ. This idea leads to kernel perceptrons and to margin-based analyses of SVMs.
- 1. After k mistakes, w·u is at least…
- 2. Cover's transition is at N ≈…
- 3. Minsky and Papert showed one layer cannot compute…
Level 4: Expert
★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.How many labelings can a perceptron learn?
History.
- F. Rosenblatt (1958) introduced the perceptron and built the Mark I Perceptron.
- A. Novikoff (1962) proved the convergence theorem.
- T. Cover (1965) counted separable dichotomies.
- M. Minsky and S. Papert (1969) analysed its limits; Y. Freund and R. Schapire (1999) the voted perceptron.
Exercise 2. N random Gaussian points in 5 dimensions with random ±1 labels; the perceptron (no bias) is run on 300 labelings in parallel for up to 1000 epochs, and the fraction it separates is compared with Cover’s formula.
| N | Cover’s formula | perceptron separated |
|---|---|---|
| 5 | 1.000 | 0.997 |
| 8 | 0.773 | 0.753 |
| 10 | 0.500 | 0.447 |
| 12 | 0.274 | 0.263 |
| 15 | 0.090 | 0.080 |
| 20 | 0.010 | 0.017 |
- The separable fraction falls from 1 to 0 around N = 2d = 10, passing exactly 1/2 there.
- The perceptron’s fractions follow the formula, slightly below it near the transition, where some separable labelings have tiny margins and need more than 1000 epochs, as the mistake bound predicts.
- Lesson: one layer of d weights can memorise only about 2d arbitrary labels; more needs more units or layers.
The perceptron in AI, robotics and aerospace
- Online classifiers that update on each mistake, for example fault flags adapting to a new sensor, follow the perceptron pattern.
- Capacity thinking: a linear detector with d features cannot fit more than about 2d arbitrary cases; beyond that, it must generalise or fail.
- Hardware learning: the Mark I Perceptron was an early example of learning in analogue hardware, a theme revived in neuromorphic chips.
References
- F. Rosenblatt (1958). “The perceptron: a probabilistic model for information storage and organization in the brain.” Psychological Review 65(6).
- A. B. J. Novikoff (1962). “On convergence proofs on perceptrons.” Symposium on the Mathematical Theory of Automata.
- T. M. Cover (1965). “Geometrical and statistical properties of systems of linear inequalities with applications in pattern recognition.” IEEE Trans. Electronic Computers 14(3).
- M. Minsky, S. Papert (1969). Perceptrons. MIT Press.