# F22 Q7b

Subject: Deep Learning

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/#tee/read/15/tee-c15-s16

Canonical: https://deep-learning-study-room.vercel.app/read/dl/tee/section/tee-c15-s16/

## Question

**Question (10 marks).** Justify that single-layer perceptrons cannot classify nonlinearly separable data using an example, and suggest a solution.

## Answer — step by step

A single perceptron forms a weighted sum and applies a threshold. Its decision boundary is linear: w·x+b = 0. It can learn linearly separable patterns such as AND and OR under suitable learning conditions, but cannot represent XOR with one linear separator.

![Opposite corners for XOR cannot be split by one straight line](https://deep-learning-study-room.vercel.app/assets/figures/xor.svg)

Diagram: Opposite corners for XOR cannot be split by one straight line. Labels: x1 | x2 | 0 | 1 | 1 | 0 | XOR labels occupy opposite corners | 0 | 1 | 0 | 1 | One straight decision boundary cannot separate the two classes.

Opposite corners for XOR cannot be split by one straight line Tap the diagram to enlarge.

For binary AND, w₁ = w₂ = 1 and b = −1.5 give preactivations −1.5, −0.5, −0.5 and 0.5 for 00, 10, 01 and 11. A step that returns 1 at nonnegative inputs produces 0,0,0,1.

For XOR, use h₁ = step(x₁+x₂−0.5) for OR and h₂ = step(x₁+x₂−1.5) for AND. Then XOR = step(h₁−2h₂−0.5). For inputs 00,01,10,11, the hidden pairs are (0,0), (1,0), (1,0), (1,1), producing 0,1,1,0. XNOR = step(−h₁+2h₂+0.5), producing 1,0,0,1. This is a multilayer construction, not a claim that a single perceptron solves XOR.

A multilayer feedforward network adds hidden nonlinear features before the final boundary. Without hidden nonlinearities, adding linear layers still produces one affine map.
