Now we'll repeat the same steps we made for (bounded, open) ranges, but changing the template to
select x from t where x >= low_x and x <= low_x + w
i.e. we'll move to the (bounded, closed) case.

Selection over an infinitesimal range

The "infinitesimal" range case is covered by the script range_sel_closed_inf.sql, which produces the red (num_distinct=2), green (num_distinct=3) and blue (num_distinct=4) line data for this graph:

Deductions (again, the ones labeled by [JLB] are already discussed in Jonathan Lewis' Book "Cost Based Oracle"): Selection over a finite range

The script range_sel_closed_finite.sql repeats the same steps for the open range case (fixed low_x = 0.1, high_x changing over the interval iterating over the same values), of course closing the range:
select x from t where x >= low_x and x <= high_x
The usual diagram (click to get the data sets for the red, green and blue line) is:
Deductions: Let's move to the semi-closed, semi-open range case.

For corrections / feedback:
alberto.dellera@gmail.com