Phase 1: Prepare
Step 1 Warm-up recall
From M4.L3: what does a larger k do to the boundary?
Private: nothing you type here is sent or stored.
Step 2 Learning goal
By the end of this lesson you can:
- say what linearly separable means (Foundation);
- test small examples for separability (Core);
- explain the trade-off of a more flexible boundary (Core).
Phase 2: Teach
Step 3 A familiar example
A security system should raise an alarm when exactly one of two sensors is triggered, but not when both or neither are. No single straight cut through the sensor readings can express that.
Step 4 Clear explanation
Two classes are linearly separable if some straight line puts all of one class on one side and all of the other on the other. Cases such as (1, 1) and (2, 2) in one class and (4, 4) and (5, 5) in the other are separable: the line x + y = 6 does it, since the first class has x + y of 2 and 4, and the second has 8 and 10.
Now take the exclusive-or table, where the answer is Yes only when exactly one input is 1.
| Input 1 | Input 2 | Class |
|---|---|---|
| 0 | 0 | No |
| 1 | 1 | No |
| 0 | 1 | Yes |
| 1 | 0 | Yes |
The two Yes points are on opposite corners of a square, and so are the two No points. Any line that puts both Yes points on one side also catches a No point. A linear classifier, including the simple scoring rule of Lesson 2, cannot get this table right.
There are two ways out. One is a more flexible boundary, such as the curved or ragged boundary that nearest neighbours produce. The other is to build a new feature from the old ones: add one that equals 1 only when both inputs are 1, and the classes become separable.
Flexibility has a price. A boundary that bends to fit every training case can score 100% on those cases and still do badly on new ones. Module 5 shows how to detect that.
Step 5 Worked example (4 marks)
Four points are (1, 1) class X, (5, 5) class X, (1, 5) class O and (5, 1) class O. Can one straight line separate them?
- The two X points are on one diagonal and the two O points on the other. (1 mark)
- A line that keeps (1, 1) and (5, 5) together must pass between them and crosses the diagonal where an O point lies, or leaves an O point on their side. (1 mark)
- So no single line works; this is the exclusive-or pattern. (1 mark)
- Answer: not linearly separable. (1 mark)
Go deeper: the professor's notes
One line.
No line.
Check.
Exclusive-or
| Input 1 | Input 2 | Class |
|---|---|---|
| 0 | 0 | No |
| 1 | 1 | No |
| 0 | 1 | Yes |
| 1 | 0 | Yes |
At work: Sensors
Alarm only when exactly one sensor fires.
- Plot the four cases.
- Look for a separating line.
What a careful practitioner decides. No single line works, so change the boundary or the features.
Phase 3: Practise
Step 6 Learner practice (instant-marked)
1. Linearly separable means:
A single line works.
2. The exclusive-or table is:
The classes sit on opposite diagonals.
3. A way to handle a non-separable pattern is to:
Change the boundary or the features.
4. A boundary that fits every training case perfectly may:
Flexibility can overfit.
Phase 4: Close
Step 7 Recap
- Linearly separable means one line splits the classes.
- Exclusive-or is not separable by one line.
- Flexible boundaries and new features help, but fit on training data can flatter.
Step 8 Exit ticket (ungraded)
Points (0, 0) and (1, 1) are class A and (4, 4) and (5, 5) are class B. Is one line enough?
Private: nothing you type here is sent or stored.
Step 9 Go further (Extension)
Think of a real decision where the right answer depends on exactly one of two conditions.
In industry: The limit was narrower than the legend
The 1969 result applies to single-layer perceptrons. Minsky and Papert already knew that networks with extra layers could handle patterns such as exclusive-or, and a second layer is enough to solve many non-separable problems. Reading the book as a ban on all neural networks was a mistake that affected research funding for years.
Link to this lesson. Report a limit exactly as far as the evidence goes: a flaw in one kind of model is not a flaw in every model.
Source: Perceptron, Wikipedia; Cornell Virtual Workshop, The XOR problem
Common mistakes
| Mistake | Why it fails |
|---|---|
| Assuming a line always works | Check by plotting or by trying small cases. |
| Adding flexibility without testing | Check on cases not used to fit. |
| Ignoring useful new features | A new feature can turn a hard problem into an easy one. |
Limits. Real data are usually not perfectly separable, so the aim is the fewest mistakes on new cases.