Geometric discrepancy and range spaces
Balance finite geometric ranges, compare random-coloring bounds with interval structure, and distinguish coloring from sampling.
On this page
The question for today
What you’ll understand
- Define coloring discrepancy as a worst-case range imbalance.
- Prove an exact interval bound by alternating colors in sorted order.
- Use a finite-family tail bound and explain the role of range-space complexity.
A point set can contain exactly as many red points as blue points overall while one local region contains almost only red. Discrepancy asks for a coloring that controls the worst imbalance over an entire prescribed family of regions. The family matters as much as the points: intervals, disks, halfspaces, and arbitrary subsets impose very different demands. We will prove a sharp bound for intervals, derive a general random-coloring guarantee, and identify why geometric structure can outperform that generic estimate.
Define the ground set and its traces
Let X be a finite set of n points, and let a family of geometric regions induce subsets R ∩ X, called ranges or traces. A coloring χ assigns either plus one or minus one to each point. The signed sum over a range is its color imbalance, and the discrepancy of the coloring is the largest absolute imbalance among all ranges. The discrepancy of the range space minimizes that worst-case quantity over all colorings.
Only distinct traces matter, even when infinitely many geometric regions produce them. For a fixed finite X there are finitely many possible traces. This formulation is combinatorial discrepancy, distinct from star discrepancy, which compares uncolored sample proportions with a reference volume measure. Both study unevenness, but their inputs and normalizations differ. A bound for random sampling error is not automatically a theorem about a best two-coloring of a fixed point set.
One-dimensional order gives a sharp construction
For distinct points on the real line, color them alternately in sorted order. Every interval selects a consecutive block, so the positive and negative colors cancel in pairs and leave imbalance at most one. If the family contains all intervals and X is nonempty, singleton ranges force discrepancy at least one, proving the bound is exact. No probability is needed; the geometry supplies an order compatible with every range.
The same idea does not automatically work in higher dimensions, where a single sorted order need not make every disk or halfspace a consecutive block. For the family containing every subset, a fixed coloring has worst imbalance equal to the size of its larger color class: selecting all points of that color attains it, and no subset can exceed it. The optimum is therefore ceiling(n/2), attained by balancing the two class sizes as evenly as possible. The latter exact value shows why one must compute the worst range carefully rather than confusing it with the signed sum over the entire set.
Random signs give a baseline, not the geometric optimum
Choose independent unbiased signs. For a fixed range with k points, an exponential tail bound gives probability at most 2 exp(−u²/(2k)) for absolute imbalance exceeding u. Replacing k by n and applying a union bound over M nonempty distinct traces shows that u = square root of 2n log(4M) succeeds for all ranges with probability at least one-half. Thus some coloring achieves that bound, though geometry may allow much smaller discrepancy.
A subset is shattered when every one of its subsets occurs as a trace, and VC dimension is the largest size of a shattered subset. For a range family of VC dimension v, the Sauer–Shelah counting lemma bounds the number of distinct traces on n points by the sum of binomial coefficients through v, with v at most n. We state that lemma rather than prove it here. For fixed v, polynomial trace complexity turns the generic random bound into a square-root-n logarithmic estimate, but this does not prove the optimal geometric rate. Interval ranges already show the gap: random-sign reasoning gives a growing bound while the deterministic alternating construction gives one.
Work it through
Balance all intervals, not only the whole set
Let X = {1, 2, 3, 4, 5, 6} and let the ranges be all interval traces. Find the exact discrepancy and compare a globally balanced block coloring.
Color the sorted points +, −, +, −, +, −. Every interval trace is consecutive, so neighboring opposite signs cancel and its absolute imbalance is at most one.
A singleton interval contains exactly one sign, so every coloring has some range imbalance one. Combining this lower bound with the construction proves discrepancy exactly one.
The block coloring +, +, +, −, −, − also has total sum zero, but the interval [1, 3] has sum three. Its discrepancy is at least three, demonstrating that global balance does not control all local ranges.
The exact interval discrepancy is 1. Equal total color counts alone permit substantially larger local imbalance.
The living notebook
Explore the model
Interactive lab · probability
A random range imbalance has a binomial law
Pause and Reset, then set success probability p = 0.5 and trials n = 10. Interpret K as the number of positive signs in one fixed ten-point range. Predict mean K = 5 and variance K = 2.5, while signed imbalance 2K − 10 has mean zero and variance ten. The central bar has mass 252/1024. The lab displays exact binomial probabilities, not sampled colorings or simultaneous optimization across a geometric range family.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forRandom cancellation controls one range probabilistically; one coloring must control every range to establish discrepancy.
Pause & reason
Check your understanding
Your turn
Try it yourself
For eight ordered points on a line, count the distinct interval traces including the empty trace. Then give the exact discrepancy for all interval traces and explain why a generic random-coloring bound can be loose.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Every nonempty interval trace is specified by its first and last selected point. Alternating signs controls all such blocks at once.
Compare with the solution
There are 8 × 9/2 = 36 nonempty consecutive blocks and one empty trace, for 37 distinct traces. Alternating colors makes each block imbalance at most one, while a singleton forces at least one, so the discrepancy is exactly one. A generic union bound with n = 8 and M = 36 yields a much larger square-root expression and ignores the shared order structure. The empty trace contributes no failure event and can be omitted from that probability bound without changing the discrepancy.
Keep the idea
Take it with you
- Discrepancy minimizes a worst-case local color imbalance using one shared coloring.
- Ordered interval structure gives an exact constant bound by alternating colors.
- Tail bounds and trace complexity provide generic existence guarantees that need not be geometrically sharp.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.