Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.A tiny decision maker
An artificial neuron takes several numbers, multiplies each by a weight that says how much it matters, adds them up with a bias, and then decides: if the total is high enough, it fires. Every deep network is millions of these simple units, wired into a computation graph that a computer evaluates step by step.
Flight software, perception stacks and onboard fault detectors increasingly contain neural networks. Underneath any framework, a network is a computation graph of weighted sums and activations. Knowing that structure is the basis for counting parameters and memory, checking what a model can and cannot represent, and later for differentiating it.
- 1. A neuron's output depends on…
- 2. A single step-activation neuron can compute…
- 3. A computation graph is evaluated…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.The neuron by hand
Model. y = φ(z) with z = w·x + b = Σᵢ wᵢxᵢ + b. Here w is the weight vector, b the bias and φ the activation.
- Step: φ(z) = 1 if z > 0, else 0.
- Sigmoid: φ(z) = 1/(1 + e⁻ᶻ).
Example. For x = (1, 2, 3), w = (0.5, −1, 2) and b = 0.5: z = 0.5 − 2 + 6 + 0.5 = 5.
Logic gates with weights (1, 1). On binary inputs (each 0 or 1):
- bias −1.5 fires only for (1, 1): AND;
- bias −0.5 fires unless both are 0: OR;
- weights (−1, −1) with bias 1.5 give NAND.
Parameters. A layer of k neurons on n inputs has k(n + 1) parameters (weights plus biases). For 100 neurons on a 28 × 28 image, that is 100 × 785 = 78 500.
Computation graph. Write each operation as a node: inputs and constants, multiplications, sums and activations. Edges show which values each node needs. One neuron with two inputs needs 2 multiplications, 1 sum (with the bias) and 1 activation.
- 1. z for x = (2, 1), w = (1, −3), b = 1?
- 2. Parameters in a layer of 10 neurons on 5 inputs?
- 3. Weights (1, 1) with bias −1.5 on binary inputs give…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 30 minUndergraduate students and practising engineers.Geometry and graphs
A neuron is a hyperplane. The set w·x + b = 0 is a line in 2-D (a hyperplane in general). A step neuron outputs 1 on one side and 0 on the other, and the weight vector points toward the “1” side. So a single neuron can compute exactly the linearly separable functions.
XOR is not separable. It needs (0, 1) and (1, 0) on one side, and (0, 0) and (1, 1) on the other, which no straight line can do. Two layers can: XOR(x₁, x₂) = AND(OR(x₁, x₂), NAND(x₁, x₂)).
Evaluating a graph. Order the nodes so that each comes after its parents (a topological order, found by depth-first search or Kahn’s algorithm), then compute each node’s value from its parents’ values. Frameworks record this graph as you compute; it is reused for gradients (E0-3).
Exercise 1. Single neurons computed AND, OR and NAND. A graph of three neurons (OR and NAND feeding AND) computed XOR as (0, 1, 1, 0). Built from primitive nodes, that XOR network has 23 nodes:
- 2 inputs and 9 constants (6 weights and 3 biases);
- 6 multiplications, 3 sums and 3 step activations.
import torch, torch.nn as nn
layer = nn.Linear(2, 1) # weights w and bias b
y = (layer(torch.tensor([[1.0, 1.0]])) > 0).float() # step activation- 1. The weight vector of a step neuron points…
- 2. XOR can be built as…
- 3. A topological order guarantees…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
McCulloch–Pitts and threshold logic. McCulloch and Pitts (1943) showed that networks of threshold units can compute any Boolean function. A two-layer network suffices (one hidden neuron per true input pattern, then an OR), but it may need exponentially many neurons.
Counting dichotomies. Cover (1965) counted how many of the 2ᵐ labelings of m points in general position in ℝᵈ a hyperplane through the origin can realise: C(m, d) = 2 Σₖ₌₀^(d−1) C(m − 1, k). For a neuron with bias on n inputs, d = n + 1. Points on the Boolean cube are not in general position, so the true counts are lower.
Capacity. For points in general position, a single neuron can realise all labelings of up to d points, and about half of them at m = 2d. This gives the classic “capacity of 2 bits per weight” (Cover, 1965; Gardner, 1988).
Graphs as programs. A computation graph is a directed acyclic graph. Evaluation is linear in the number of edges, and memory can be reduced by freeing values no later node needs. Static graphs (TensorFlow 1, XLA) are optimised before running. Dynamic graphs (PyTorch) are recorded as the code runs.
Interview questions.
- Why must a computation graph be acyclic? So that each value depends only on earlier ones. Recurrences are unrolled in time into an acyclic graph (E11).
- Why is a bias needed? Without it every decision hyperplane passes through the origin, and the input (0, 0) always gives z = 0. A step neuron then outputs 0 there, so functions such as NAND, which must output 1 at (0, 0), become impossible.
- 1. Cover's count C(m, d) applies to points…
- 2. Without a bias, a neuron's decision boundary…
- 3. PyTorch builds its graph…
Level 4: Expert
★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.How much can one neuron compute?
History.
- W. McCulloch and W. Pitts (1943) introduced the threshold neuron.
- F. Rosenblatt (1958) introduced the perceptron.
- T. Cover (1965) counted the dichotomies a hyperplane can realise.
- M. Minsky and S. Papert (1969) analysed the limits of single-layer perceptrons, including XOR and parity.
- Reverse-mode differentiation on computation graphs (Linnainmaa, 1970) later made multilayer training practical.
Exercise 2. Every Boolean function of n inputs was tested with the perceptron, run on all 2^(2ⁿ) functions at once for 60 epochs (a linearly separable function is learned exactly; others never are).
| inputs n | Boolean functions | computable by one neuron | share | Cover bound (general position) | worst-case epochs to converge |
|---|---|---|---|---|---|
| 1 | 4 | 4 | 1.0000 | 4 | 3 |
| 2 | 16 | 14 | 0.8750 | 14 | 8 |
| 3 | 256 | 104 | 0.4062 | 128 | 19 |
| 4 | 65 536 | 1882 | 0.0287 | 3882 | 52 |
- One neuron’s reach collapses with the number of inputs. It computes 14 of 16 functions of 2 inputs (only XOR and XNOR fail), but under 3% of the 65 536 functions of 4 inputs.
- The cube is far from general position. For 4 inputs the true count is less than half of Cover’s bound. Many corners line up on common hyperplanes, which removes labelings.
- Learning gets slower too. The worst separable function needed 52 passes for n = 4, against 3 for n = 1, because its margin is tiny.
- Hence depth: layers of neurons compose these simple splits into functions no single neuron can represent.
Neurons and graphs in AI, robotics and aerospace
- Model sizing: counting parameters and operations per layer, from the graph, to fit a network into flight-computer memory and timing budgets.
- Certification and analysis: verification tools for neural controllers work directly on the computation graph of weighted sums and activations.
- Hardware: FPGA and neuromorphic implementations map each neuron’s multiply–accumulate and activation onto circuits.
References
- W. S. McCulloch, W. Pitts (1943). “A logical calculus of the ideas immanent in nervous activity.” Bulletin of Mathematical Biophysics 5.
- F. Rosenblatt (1958). “The perceptron: a probabilistic model for information storage and organization in the brain.” Psychological Review 65(6).
- T. M. Cover (1965). “Geometrical and statistical properties of systems of linear inequalities with applications in pattern recognition.” IEEE Trans. Electronic Computers 14(3).
- M. Minsky, S. Papert (1969). Perceptrons. MIT Press.
- I. Goodfellow, Y. Bengio, A. Courville (2016). Deep Learning, chapter 6. MIT Press.