How many mistakes does it take to learn an interval? Exact Littlestone dimensions of intervals and their unions

Miit Daga, Swarna Priya RamuarXiv 2026

Imagine you’re designing a heart rate monitor. You want it to trigger an alarm if the pulse falls outside a "safe" interval—say, 60 to 100 beats per minute. You don’t know the exact safe range yet, so you have to learn it online, one reading at a time.

Now, imagine your data isn't coming from a friendly patient, but from an adaptive adversary—a mathematical "troll" who sees your every guess and chooses the next data point specifically to make you look foolish. How many mistakes would you make before you finally pinned down that interval?

TL;DR

This paper solves a long-standing puzzle in machine learning: exactly how many mistakes an optimal learner makes when trying to identify a hidden interval (or a union of intervals) against a malicious adversary. The authors prove that the "obvious" strategy—waiting for a positive example and then binary searching the boundaries—is actually suboptimal, and they provide the first exact, machine-verified formulas for these mistake bounds.

What Problem Does This Paper Address?

In the world of online learning, we often talk about the Littlestone dimension (Ldim). Think of it as the "difficulty score" of a concept class. It represents the minimum number of mistakes a learner can guarantee they won't exceed, even if an adversary is picking the examples.

For simple things like "is this number greater than $x$?" (thresholds), we’ve known the answer for decades: it’s basically binary search ($\lfloor \log_2 n \rfloor$). But for intervals—rules defined by two boundaries—we only had rough estimates (asymptotic bounds). We knew it was roughly $2 \log n$, but the "roughly" hid a lot of interesting complexity.

The authors set out to find the exact value for intervals and unions of intervals on a discrete line of $m$ points.

Methods

The researchers treated the problem as a high-stakes game of cat and mouse. To find the exact mistake bound, they used several sophisticated tools:

  • The Cutting Game: They transformed the problem of learning an interval into a game where an adversary "cuts" a rod into smaller pieces. This allowed them to use admissible trees (a type of decision tree) to calculate the exact number of mistakes.
  • Block-Pairing Learner: They designed a new, optimal learning algorithm that groups points into pairs to "budget" its mistakes more efficiently than a standard binary search.
  • Lean 4 Verification: To ensure their complex combinatorial formulas weren't just "mostly right," they formally verified every single theorem using Lean 4, a state-of-the-art mathematical proof assistant. This means the results aren't just peer-reviewed; they are machine-checked for absolute logical consistency.
Figure 2: Structure of the proofs. The online mistake-bound game (1) is posed for intervals, unions of intervals and sequences with few switches (2). Reductions (3) turn sequences with 2j switches into the cycle family R2j, odd switch budgets into the gap family Gk, and intervals into a cutting game whose adversary strategies are admissible trees. Learner arguments give upper bounds and adversary arguments give lower bounds (4); the two meet in the three-regime law for Qk(d) (5). The branch from the cutting game treats randomised learners and gives lower and upper bounds on the randomised Littlestone dimension that differ by less than 0.64.

Datasets

As a theoretical paper, the "datasets" here are the mathematical structures themselves:

  • Discrete Intervals: Learning a single $[a, b]$ range on $m$ points.
  • Unions of $j$ Intervals: Learning a rule like "the value is in $[a, b]$ OR $[c, d]$."
  • Switch-Bounded Sequences: Binary strings that change from 0 to 1 (or vice versa) at most $k$ times.

The authors also ran extensive computational tests for all domain sizes up to $10^5$ to verify their closed-form formulas against brute-force results.

Key Insights and Ideas

  • The "Natural" Learner is Suboptimal: Most of us would use a "wait-then-search" strategy: wait for the first '1' to appear, then binary search for the left and right edges. The authors showed this is a trap! An adversary can force this learner into an extra mistake for about 51% of all possible domain sizes.
  • The Three-Regime Law: The difficulty of forcing mistakes doesn't grow linearly. It follows a three-stage pattern based on the "switch budget" $k$ (how many times the label can change along the line).
  • Regime 1: Every point added costs exactly one more mistake.
  • Regime 2: Every two points added cost one mistake.
  • Regime 3: You have to double the entire domain size just to force $k$ more mistakes.
The three regimes of the mistake-forcing function $Q_k(d)$.

Key Results

  • The Interval Sequence: For a single interval on $m$ points, the maximum mistakes follow a specific sequence: $1, 2, 3, 5, 7, 10, 14, 20, 28, 40, 56, 80 \dots$. If your domain size $m+1$ is less than or equal to a number in this sequence, that's your mistake bound.
  • Exact Formulas: They provided explicit, closed-form formulas for $Ldim(Int_m)$ involving $\log_2$ and specific oscillating constants.
  • Randomized Bounds: For learners allowed to flip coins (randomized learners), they narrowed the gap for the expected number of mistakes to within 0.64 of the absolute optimum.
Figure 1: From interval rules to exact mistake bounds. Left: examples of interval rules (the settings shown are illustrative), each learned online from one label at a time. Top: the online game. The strip shows a worst-case game against the natural wait-then-search learner on m = 7 points, with the learner’s guess above the true label on each card; the learner makes 5 mistakes, one more than Ldim(Int7) = 4. Bottom: the results; the bars are Ldim(Intm) for m ≤30. Right: what was known before and what this paper shows. Photographs, all from Wikimedia Commons: patient monitor by J. Stenberg, U.S. Navy (public domain); aircraft by T. Landis, NASA (public domain); road traffic by Kiwiev (CC0 1.0).

Limitations and Future Work

While the paper settles the one-dimensional case, the authors point out several open frontiers:

  • Higher Dimensions: What happens when we try to learn axis-parallel boxes in 2D or 3D? The exact values there remain a mystery.
  • Odd Switch Budgets: For certain specific configurations (odd $k$ on a path with free ends), the bounds are currently only conjectures supported by heavy computation, not yet fully proven for all $n$.
  • The Randomized Gap: While they got within 0.64 mistakes for randomized learners, they conjecture their "greedy adversary" strategy is actually perfectly exact, but a formal proof for that is still pending.

In short, the next time you're building a system to learn "safe zones" or "thresholds," remember: binary search is great, but when the adversary is smart, you might need a slightly more sophisticated playbook.

Summary updated

Abstract

The Littlestone dimension of a hypothesis class equals the smallest number of mistakes an online learner can guarantee against an adaptive adversary. For discrete intervals and unions of $j$ intervals on $m$ points, only its order of growth was known. We determine it exactly. For every switch budget $k$ (with both end labels fixed when $k$ is odd), the smallest size on which $d$ mistakes can be forced follows a three-regime law: $d+1$ while $d\le k$, then $2d-k+1$, and beyond $d=\lceil 3k/2\rceil+k-1$ doubling the size adds exactly $k$ mistakes. Unions of $j$ intervals on $m$ points correspond to $k=2j$ and size $m+1$, and a single interval gives the thresholds $1,2,3,5,7,10,14,20,\dots$. The natural learner that waits for a positive example and binary-searches both endpoints is not optimal: it can be forced into one extra mistake for 50,847 of the domain sizes below $10^5$. Upper bounds come from a gap potential and a block-pairing learner, and lower bounds from adversary strategies and a refinement step. These tools give an explicit optimal learner with $O(\log m)$ time per round, which on random streams makes more mistakes on average than the natural learner. For randomised learners, we compute the randomised Littlestone dimension of thresholds exactly and prove that a greedy adversary forces an explicit closed-form number of expected mistakes on intervals; this bound is within $0.64$ of optimal and, we conjecture, exact (confirmed for $m\le70$). Exact computation tests every result, and the formulas for every switch budget are machine-checked in Lean 4.
BibTeX
@misc{daga2026how,
  author = {Miit Daga and Swarna Priya Ramu},
  title = {{How many mistakes does it take to learn an interval? Exact Littlestone dimensions of intervals and their unions}},
  year = {2026},
  eprint = {2611.28727},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.28727},
}
Figure