A particle trapped between two walls has quantized energy levels because only standing waves fit inside. The allowed wave functions are sine half-waves; the number of half-oscillations is the quantum number n, and the energy grows as n².
Quantized states of a particle in a boxEnergy levels En = n² · h² / (8 · m · L²)
Wave function ψn(x) = √(2/L) · sin(nπx / L)
Probability |ψ|² dx — most likely positions
Nodes n − 1 points where ψ = 0
A non-classical surprise
In the n=2 state the particle is most likely to be found near the two peaks — never exactly at the middle where a classical bouncing particle would spend the most time.