Worked examples — The perceptron model and history
This is a Deep Dive child of the perceptron topic note. The parent gave you the machinery: the weighted sum, the step decision, the update rule. Here we do the opposite of theory — we hammer the perceptron with every kind of input it can meet, one at a time, until no scenario surprises you.
Before anything else, let us re-anchor the three symbols so this page stands on its own.

Look at the figure. The blue arrow is . The gray line is the fence . Everything shaded blue scores ; everything shaded orange scores . Every example below is just "which side did the point land on, and did we want it there?"
The scenario matrix
Here is every kind of situation a 2-input perceptron can be handed. Each example that follows is tagged with the cell it covers.
| Cell | Scenario class | What's tricky about it |
|---|---|---|
| A | Point clearly on class-1 side () | baseline, should predict 1 |
| B | Point clearly on class-0 side () | baseline, should predict 0 |
| C | Point exactly on the line () | the tie-break — must give 1 |
| D | Zero input | only the bias decides |
| E | Degenerate weights | there is no direction; bias sign alone rules (both and ) |
| F | A learning step, false positive () | weights must move away from point |
| G | A learning step, false negative () | weights must move toward point |
| H | Not-linearly-separable (XOR) | perceptron cannot converge — limiting failure |
| I | Real-world word problem | translate words → |
| J | Exam twist: same line, flipped weights | negating swaps all classes |
We now walk cells A→J. Together they touch every sign, the zero/degenerate inputs, the limiting failure, a word problem, and an exam trap.
Cells A, B, C — the three signs of
Forecast: guess the label of each before reading. Which side of the arrow does each sit on?
- Compute for P. . Why this step? The whole decision lives in the single number ; nothing else matters.
- Read the sign. . (cell A: clearly positive.) Why this step? The step function turns the continuous score into a label; a positive score means "front of the arrow", which is class 1 by definition.
- Compute for Q. . Sign is negative . (cell B.) Why this step? Q is behind the arrow — negative score is exactly what "behind" feels like numerically.
- Compute for R. . Exactly zero. Why this step? R lands on the fence. This is the case textbooks skip.
- Apply the tie-break. . R is class 1, not class 0. (cell C.) Why this step? Our fixed convention uses , so a point on the line is forced to class 1 rather than left undefined — the boundary belongs to class 1.
Verify: P scored (front of arrow → 1 ✓), Q scored (behind → 0 ✓), R scored (fence → 1 by our fixed convention ✓). The next figure plots all three: P sits in the blue region, Q in the orange, R exactly on the gray line.

Cells D, E — degenerate inputs
Forecast: when the input is all zeros, what can possibly decide the answer? And when the weights are all zeros — does the sign of the bias flip the whole plane's label?
- Case D: plug in the origin. . Why this step? Every weighted term dies because it's multiplied by . Only survives.
- Decide D. . Why this matters: at the origin the perceptron is the bias. The sign of alone labels the origin.
- Case E-neg: plug in the point with . . Why this step? With there is no "class-1 direction" — the arrow has vanished, so collapses to for every point.
- Case E-pos: same point with . . Why this matters: dead weights make a constant classifier, and the sign of the bias picks which constant. → everything is class 0; (or , by the tie-break) → everything is class 1. The whole plane flips with the bias sign.
Verify: D gives (positive → 1 ✓, matches "origin's label is decided by "). E-neg gives for any → always 0 ✓. E-pos gives for the same → always 1 ✓. All three degenerate cases collapse to "read the sign of the bias".
Forecast: the input is zero and the bias is zero — so is exactly . Does the machine refuse to answer, or does the tie-break rescue it?
- Compute . . Why this step? Both weighted terms and the bias are zero, so this is the only place all three vanish at once — the purest tie.
- Apply the tie-break. . Why this matters: without the convention this point would be undefined; the fixed rule forces it to class 1, so the classifier is total (defined everywhere).
Verify: and , so ✓ — the origin-on-the-fence resolves to class 1, exactly like point R in Example 1.
Cells F, G — one learning step each
Recall the update from the parent: The factor is on a false negative, on a false positive, when correct. This is the engine of learning by error.
Forecast: the machine thinks this point is class 1 but it isn't. Which way should the arrow move — toward the point or away?
- Predict. . Why this step? We update only on mistakes, so we must first find out we made one.
- Error signal. . It's a false positive. Why: the sign of this number is the direction of the whole correction.
- Update weights. . Why this step? Subtracting a multiple of tilts the arrow away from , lowering its score next time.
- Update bias. . Why: lowering shifts the whole fence so the point is more likely behind it.
Verify: re-score with new params: . Hmm — still positive, one step wasn't enough, but note the score fell from to — it moved the right way. That "score decreased" is the guaranteed effect of a false-positive step. ✓
Forecast: the machine says class 0, truth says class 1. Now which way does the arrow move?
- Predict. . Why this step? Just like cell F, learning only fires on an error, so we first evaluate the current label — here is negative, so the machine wrongly says class 0.
- Error signal. . False negative. Why: means "pull toward the point."
- Update weights. . Why this step? Adding swings the arrow toward , raising its score.
- Update bias. .
Verify: re-score: . The point is now correctly class 1, and its score jumped from to . A false-negative step raises the score — exactly opposite to cell F. ✓
Cell H — the limiting failure (XOR)
Forecast: guess whether any straight line can put the two "1" corners on one side and the two "0" corners on the other.
- Write the four inequalities. Class 1 needs , class 0 needs :
- :
- :
- :
- : Why this step? If no numbers satisfy all four at once, no perceptron exists.
- Add the two "class 1" lines. . Why: combining constraints exposes a contradiction.
- Compare with the last two. From step 1, and , so . Why: a negative plus a negative is negative.
- Contradiction. Step 2 says ; step 3 says it is . Impossible.
Verify: the two conclusions and about the same quantity cannot both hold, so no single perceptron classifies XOR. This is the historic 1969 wall; the escape is stacking neurons — see the MLP and how to train it. Geometrically, XOR's 1s and 0s sit on opposite diagonals — no straight line separates diagonals.

Cell I — a real-world word problem
Forecast: income pushes "approve", the existing loan pushes "reject". Which wins?
- Translate words to numbers. . Why this step? The perceptron only eats numbers; features must become coordinates.
- Read the weight signs as a story. : each income unit adds to approval. : each existing loan subtracts. That matches the bank's intent.
- Compute . . Why: one number decides the whole policy.
- Decide. approve. Why this step? A non-negative score means the applicant lands on the "class-1" side of the policy line, which the bank has defined as approve; the step function converts the score into the actual yes/no action.
Verify (units + sanity): income term "approval points", loan penalty , base threshold ; net approval points → approve ✓. Sanity check the edge: an applicant with the same income but 2 existing loans gives reject — one extra loan flips the decision, as a threshold model should. This is the same machinery behind a linear score classifier.
Cell J — the exam twist
Forecast: negating and negates . But watch the tie — does R survive the flip cleanly?
- Relate the scores. . Why this step? Every term flipped sign, so 's score is exactly minus 's score.
- P: (was 1). Flipped. Why this step? A strictly positive -score becomes strictly negative for , so the label crosses the boundary.
- Q: (was 0). Flipped. Why this step? Same logic mirrored: a strictly negative -score becomes strictly positive for .
- R (the trap): — and also gave R the label 1! Why this matters: because the tie-break is , a point on the line stays class 1 for both machines. Negating parameters flips every strict case but not the tie. That asymmetry is the exam trap.
Verify: P: ✓ flipped. Q: ✓ flipped. R: ✓ not flipped (the tie clings to class 1 on both sides). So negation is almost a mirror — it flips all strict labels but pins the fence-sitters to class 1. This subtlety separates a careful margin-based thinker from a careless one.
Recall
Recall Which quantity alone decides the label at
? The bias ::: because both weighted terms vanish, so and iff .
Recall With
, how does the whole plane's label depend on ? Sign of ::: labels every point class 0; labels every point class 1 (constant classifier).
Recall On a false positive (
), does the point's score go up or down after the update? Down ::: the update subtracts from and from , lowering next time.
Recall Why can no single perceptron solve XOR?
Its two class-1 points and two class-0 points sit on opposite diagonals ::: no straight line separates them, and the four inequalities are algebraically contradictory.
Recall If you negate
and , which points do NOT switch class? Points exactly on the line () ::: the tie-break keeps them class 1 for both machines.
Connections
- Parent: 3.1.1 The Perceptron Model and History
- Hinglish version: 3.1.01 The perceptron model and history (Hinglish)
- Roots: McCulloch-Pitts Neuron · geometry: Linear Separability · the step rule: Activation Functions
- Learning engine: Gradient Descent · the XOR escape: Multi-Layer Perceptron, Backpropagation
- Cousins that fix the tie/margin issues: Support Vector Machines, Logistic Regression