Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

12
  • 8
    $\begingroup$ The half-intervals decomposing into half-intervals is a nice touch. Dijkstra's explanation does good job of justifying the use of the common scheme within CS as it was becoming a modern science. $\endgroup$ Commented Sep 3, 2018 at 6:53
  • 31
    $\begingroup$ Nice contribution and good insight. You've made this corner of the internet a better place :) Welcome to Computer Science Educators. Take a look around, I'd love to know what else you can add. $\endgroup$ Commented Sep 3, 2018 at 12:11
  • 4
    $\begingroup$ While a good reason to start indexing at 0, it feels much easier and more natural to mentally parse (d) and especially (c) than (a) or (b) - "numbers from x to y" in natural language usually means inclusive of both (or exclusive of both) $\endgroup$ Commented Sep 4, 2018 at 13:34
  • 4
    $\begingroup$ @msam: Fully closed or fully open may be "more natural," but the subtraction property of half-open is extremely important. The interval [a, a+b) is exactly b elements long, without any pesky +1 or -1 terms. You simply cannot avoid having +1s and -1s everywhere when you use fully closed or fully open intervals. $\endgroup$ Commented Sep 5, 2018 at 1:30
  • 11
    $\begingroup$ This also matches the behavior of the modulo operator, the return value of which lies in [0, n). number_of_values_ending_in_a_particular_digit[x % 10] += 1 $\endgroup$ Commented Sep 5, 2018 at 1:48