Definition · Interval partitioningGiven n intervals, assign every one of them to a room so that no room holds two overlapping intervals, using as few rooms as possible. Unlike interval scheduling, nothing may be discarded: the question is not which intervals to keep but how many rooms they need.
Definition · DepthFor an instant t, the intervals alive at t are those with s ≤ t < f. The depth of an instance is the largest number of intervals alive at any single instant. The panel reports the instant that attains it alongside the number.
The lab opens on ten lectures: A 0-3, B 1-4, C 2-5, D 4-7, E 5-8, F 6-9, G 8-11, H 9-12, I 10-13, J 12-15. Greedy by start time opens three rooms and fills them A D G J, B E H and C F I. Every room is checked: no room holds two intervals that overlap, and all ten intervals were placed exactly once.
Example · The certificate at t = 2The depth is 3, attained at t = 2, where A 0-3, B 1-4 and C 2-5 are all alive. Those three pairwise overlap, so no schedule of any kind can put two of them in one room, so no schedule uses fewer than three rooms. Greedy used three. The two numbers were computed by separate routines and they agree, which is optimality demonstrated rather than asserted.
Theorem · Greedy by start time uses exactly the depthSorting the intervals by start time and assigning each to the lowest-numbered room whose last booking has already finished opens exactly d rooms, where d is the depth. Hence it is optimal on every instance.
Suppose the rule opens room number d + 1 while placing some interval x. It only opens a new room when every one of rooms 1 through d is busy, which means each of those rooms holds an interval that has not finished by s(x).
Every such interval started at or before s(x), because the rule processes intervals in increasing start order and each of them was placed earlier. So each of those d intervals satisfies s ≤ s(x) and f > s(x), and is alive at the instant s(x). Together with x itself that is d + 1 intervals alive at one instant.
So the depth is at least d + 1, contradicting the assumption that it is d. The rule therefore never opens more than d rooms, and since no schedule can use fewer, it uses exactly d.
□
That proof needs the start order and uses it twice. The panel offers a second order — by finish time — and the theorem says nothing about it. On all four shipped instances the finish order opens the same number of rooms as the start order: three, two, five and one. A reader who moved that control on the presets and concluded the order does not matter would have measured four inputs and generalised to all of them.
It does matter, and the instance is small. Type 0-1, 1-4, 2-5, 4-9, 5-8. The depth is 2, attained at t = 2. By start time greedy opens two rooms, A B D and C E. By finish time it opens three: A B E, C and D. The finish order places E 5-8 into the first room because B finished at 4, and then D 4-9 fits nowhere. Same intervals, same rule shape, one more room than the bound.
Why this proof looks different from the two before it
The earlier arguments on this course both compare greedy with an optimal solution: stays ahead of it, or can be reached from it by swaps. This one never mentions an optimal solution. It proves a fact about every schedule — at least d rooms — and separately a fact about this one — at most d rooms. Two inequalities from two arguments, meeting.
That shape recurs for the rest of this path. An approximation ratio is the same construction with the two sides not meeting: a bound on every solution on one side, a measured quantity on the other, and the gap between them as the guarantee. This is the page where the gap happens to be zero, and noticing that it is a special case rather than the normal case is most of what the page is for.
What the panel checks that a reader would otherwise assume
Three things, and each exists because the corresponding claim is otherwise unverifiable. roomsValid confirms that every room's intervals are pairwise disjoint and that every input interval appears in exactly one room — an assignment that quietly dropped an interval would use fewer rooms and look better. liveAt lists the intervals alive at the certifying instant rather than reporting their number. mutuallyOverlapping then confirms that those listed intervals really do pairwise overlap, which is the step that makes the bound a bound.
Measured on this page: on the ten lectures greedy by start opens 3 rooms, the depth is 3, the certifying instant is t = 2, and the three intervals there pairwise overlap; on the five-interval pile-up all five are alive at t = 4 and five rooms are used; on the disjoint instance the depth is 1. Proved on this page: the start-order rule uses exactly the depth on every instance. The finish order has no such theorem, and the five-interval instance above is why.