Each student is either on task (green) or disruptive (red). Off-task behaviour can start from boredom and spread to neighbours; routines and a teacher walking near students help them recover. Compare seating layouts and teacher modes.
The science
Every 0.5 s each student updates a two-state Markov rule. An on-task student turns disruptive with probability 1 − (1−s)(1−β)^k, where s is spontaneous boredom (reduced by clear routines: s·(1−0.6·rules)), β is the contagion chance per disruptive neighbour and k is the number of disruptive neighbours in the seating network. A disruptive student recovers with probability γ = γ0 + 0.1·rules + prox·exp(−d²/2σ²), where d is the distance to the teacher (σ = 1.6 desk spaces).
Layouts change only the network: rows (4 neighbours), groups of four (3), horseshoe (2) and exam spacing (0). Exact check: with β = 0 each student is an independent two-state chain with steady share s/(s+γ). Approximate check: a mean-field fixed point i·γ = (1−i)(1−(1−s)(1−β)^{k·i}) for the layout's mean degree, which ignores clustering and so only approximates the simulation.
Simplifications: binary behaviour, identical students, symmetric contagion, a Gaussian proximity effect and illustrative constants rather than classroom data. Real classrooms depend on relationships and teaching quality far beyond this toy model.