| Right, I think the hotel room use case helps a lot with the intuitions here. And it helps to see the COUNTER EXAMPLE: * Hotel A [Jan 10, Jan 13] means 4 nights; same as [Jan 10, Jan 14). * Hotel B [Jan 13, Jan 15] means 3 nights; same as [Jan 13, Jan 16). These intervals overlap! That is, if I try to get them together I book Jan 13 on both Hotel A and Hotel B. With the half-open interval is really easy to spot: you cannot concatenate unless the open-end and the closed-begin are the same. So you can concat [Jan 10, Jan 14) with [Jan 14, Jan 16); BUT you have an overlap if you see this [Jan 10, Jan 14) with [Jan 13, Jan 16) as in the previous examples. With the closed interval this is hard to see. As in the example by @parekhnish; it seems that [Jan 10, Jan 13] and [Jan 13, Jan 15] are concatenable and there's no overlap. But the final operation ends up booking on Jan 13 twice. |
* Jan 14 - Jan 10 = 4 nights
* Jan 16 - Jan 13 = 3 nights
I actually had to edit my previous comment, because I said [Jan 10, Jan 13] was 3 nights INSTEAD of 4 nights.
I caught the error when I saw the [Jan 10, Jan 14) interval :-)