On this page
"Learning from data" sounds mysterious. Inside a neural network it means something small and mechanical: a few numbers change, by a fixed rule, each time the network makes a mistake. Here you train a one-neuron classifier on paper and watch every number change.
What is a perceptron?
"The perceptron is a single-layer neural network – an algorithm that classifies input into two possible categories," as the Cornell Chronicle puts it. Frank Rosenblatt described it in a 1958 paper in Psychological Review. In a July 1958 demonstration by the US Office of Naval Research, the same Cornell article reports, an IBM 704 computer taught itself after 50 trials to tell punch cards marked on the left from cards marked on the right.
A perceptron multiplies each input by a number called a weight, adds the results plus one more number called the bias, and answers yes if the total is above zero. The weights and bias are the only things it can change. Learning means changing them.
How does a neural network learn, step by step?
The learning rule fits on one line. When the perceptron gets an example wrong, it adds that example's inputs to the weights if the answer should have been yes, and subtracts them if it should have been no. Cornell's machine learning course notes write this update as w + yx, where y is +1 for yes and −1 for no (Cornell CS4780 lecture notes). The bias moves by +1 or −1 in the same way. When it gets an example right, nothing changes. Mistakes push the numbers until the mistakes stop.
Try it: train a pass/fail classifier on paper
Take four made-up students: h is hours of revision per day, t is mock tests taken that week. The numbers are invented, not real exam data.
Student A: h = 0, t = 1, failed
Student B: h = 3, t = 2, passed
Student C: h = 1, t = 0, failed
Student D: h = 2, t = 3, passed
Your neuron computes score = w1 × h + w2 × t + b and predicts pass only if the score is above 0. Start with w1 = 0, w2 = 0, b = 0. Go through A, B, C, D, and repeat until a full round has no mistakes.
Round 1:
A: score 0, fail. Correct.
B: score 0, fail. Wrong, add B: w1 = 3, w2 = 2, b = 1.
C: score 3 + 0 + 1 = 4, pass. Wrong, subtract C: w1 = 2, w2 = 2, b = 0.
D: score 4 + 6 + 0 = 10, pass. Correct.
Round 2:
A: score 0 + 2 + 0 = 2, pass. Wrong, subtract A: w1 = 2, w2 = 1, b = −1.
B: score 6 + 2 − 1 = 7, pass. Correct.
C: score 2 + 0 − 1 = 1, pass. Wrong, subtract C: w1 = 1, w2 = 1, b = −2.
D: score 2 + 3 − 2 = 3, pass. Correct.
Round 3: A scores −1, B 3, C −1, D 3. All correct, so training stops.
The trained neuron says: pass if h + t is more than 2. Nobody gave it that rule. Four corrections produced it.
What does this show about real neural networks?
The weights are the memory. Everything the neuron knows is three numbers: 1, 1 and −2.
Only mistakes cause learning. Correct answers changed nothing.
One neuron can only draw a straight line. If a data set can be split by a straight line (linearly separable), the perceptron will find a separating line in a finite number of updates, according to the Cornell CS4780 lecture notes. The same notes give XOR, a pattern no single line can split, as the classic case it cannot learn.
Real networks stack many neurons. They use a smoother version of the same correct-the-mistake idea, explained in our post on how backpropagation taught neural networks to learn.
Other models draw other boundaries. Compare building a decision tree on paper.
How can you run this as a 30-minute class or home activity?
Five minutes: copy the four students onto a sheet and agree the rule (above 0 is pass).
Ten minutes: one person calculates scores, one judges right or wrong, one updates weights.
Ten minutes: train again in the order D, C, B, A. Is the final rule the same?
Five minutes: add student E, with h = 3, t = 3, who failed. Fails now sit at the bottom-left and top-right with passes between, so no straight line separates them and the weights never settle. That is why real networks use more than one neuron.
If a line splitting a plane still feels shaky, the Fermi Concept Library has a lesson for every concept in mathematics and computing. Not sure what to learn next? Fermi's AI tutor can work out what you already know and build a plan for the session.
Start every weight at zero and let the mistakes teach.



