What is the VC dimension of the class of closed intervals on the real line, and why?
Learning theory, VC dimension
Level L2 Elementary. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you can prove a VC dimension exactly, both by shattering a set and by finding a labelling that cannot occur.
Key idea
Two points can be shattered but three cannot, because the labelling is impossible for an interval. So .
Steps
- Lower bound: take . Labelling : an interval covering both. : an interval around that stops before . : the mirror image. : an interval far from both points. All four labellings occur, so .
- Upper bound: take any three points and the labelling .
- An interval is a single connected piece. If it contains and it contains everything in between, including . So would be labelled , a contradiction.
- So no set of three points is shattered (and the same argument works for any larger set). Hence .
Common mistakes
- Checking only that some three points fail. You need that every three points fail, which the argument gives for any order of points.
- Forgetting the labelling . It is realised by an interval placed away from the points (or an empty interval).
- Guessing "number of parameters, so 2" without a proof. That coincides here but is not a proof.
How long your answer should be
Half a page; about 3 minutes.
Last checked on 4 December 2026.
Read this
Previous in Learning theory: Using Hoeffding's inequality, how large must a test set be so that the measured error of a fixed classifier is within of its true error with probability at least 95%?
Next in Learning theory: The halving algorithm is run on a finite class of hypotheses and the labels are realisable (some hypothesis in the class is always correct). What is the largest number of mistakes it can make, and why?