Lesson 2.2 · 7 min read · about 50 min to master at a very slow pace

Decision Boundaries and Linear Separability

A neuron with a threshold activation splits the input space with a straight line (a hyperplane). Which problems that can solve: AND and OR worked through, and the definition of linear separability.

Not startedJump to quiz

The decision boundary

With a sign activation, the neuron outputs when and when . The decision boundary is where :

In 2 dimensions this is a line, in 3 a plane, in a hyperplane. The weight vector is perpendicular (normal) to it and points towards the side classified ; the bias moves it away from the origin.

Linear separability

Two classes are linearly separable if some and put every positive example on one side and every negative example on the other: for all positives and for all negatives. A single neuron can only solve linearly separable problems.

AND and OR are separable

0101x₁x₂
AND: w = (1, 1), b = −1.5
0101x₁x₂
OR: w = (1, 1), b = −0.5
0101x₁x₂
XOR: no single line works
AND: OR:
(0, 0)−1.5 → −1−0.5 → −1
(1, 0)−0.5 → −10.5 → +1
(0, 1)−0.5 → −10.5 → +1
(1, 1)0.5 → +11.5 → +1

Same weights, different bias: the bias slides the line, turning AND into OR. XOR (true when exactly one input is 1) puts the two positives on opposite corners, and no line separates them. The next lesson proves it.

Exam phrasing

"A dataset is linearly separable if a hyperplane can separate the classes without error. AND and OR are linearly separable; XOR is not."

Stuck? Common doubts

Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.

First passWhy is perpendicular to the boundary?

Take two points and on the boundary: and . Subtracting gives , so is at right angles to every direction along the boundary. Moving in the direction of increases fastest, which is why points to the positive side.

Cheatsheet

Decision boundary

: a line (2-D), plane (3-D) or hyperplane. is normal to it and points to the positive side.

Separable or not

AND, OR: linearly separable (one neuron works). XOR: not separable (needs a hidden layer).

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1conceptFor a neuron with a sign activation, what is its decision boundary?
Q2calculateA neuron with weights , bias and a sign activation receives the four binary inputs. Which function does it compute?
Q3conceptWhich direction does the weight vector point relative to the decision boundary?
Q4applyWhich of these datasets is linearly separable?
Q5interpretYou keep but change the bias from to . What happens to the boundary?