Live data from Hacker News

Show HN: I made a calculator that works over disjoint sets of intervals

victorpoughon.github.io

31–40 of 61 posts

Re: Show HN: I made a calculator that works over disjoint sets of intervals

#32
post #31

Very nice work. I was wondering if it might be useful to combine this with a library for arbitrary precision arithmetic. How difficult do you think that might be?

Thanks! Arbitrary precision arithmetic is definitely something I'd like to learn more about, yeah. Haven't had time to study it so much yet unfortunately.

Re: Show HN: I made a calculator that works over disjoint sets of intervals

#33
I recently implemented something somewhat similar, but from the perspective of set membership.

I therefore needed to include a complement operation, so that I could do full Boolean analysis of interval membership.

Your intervals are all closed sets, consequently the complements are open intervals. I chose not to distinguish between open and closed intervals, since for my practical purposes whether the end points are members of the set is unimportant.

Of course, with inexact arithmetic, the question of whether the set is open of closed probably not well-defined.

Re: Show HN: I made a calculator that works over disjoint sets of intervals

#36
I wish I had known about interval arithmetic when I first wrote tick, a time interval library in Clojure, which includes a. implementation of Allen's Interval Algebra. It also embraces the notion of sets of discrete intervals which are useful for practical work calculations, like determining the set of intervals of your vacations that are in a particular year (for HR calculations). I accidentally stumbled on benefits of these sets without knowing much beyond Allen's work.

https://github.com/juxt/tick

https://en.wikipedia.org/wiki/Allen's_interval_algebra

Re: Show HN: I made a calculator that works over disjoint sets of intervals

#37

Earlier quoted context omitted.

I was also a bit confused by this. I thought the standard notation was round brackets, but maybe doesn't work well in ASCII?

(0, 1) Is this an twice-open interval or a 2D vector? See, this is why Bourbaki introduced the ]0,1[ notation.

Is there any reasonable situation where you'd be confusing a vector with an interval? Having done mathematical writing and grading of tests using both styles of notation (simply adapting to what was used at the institution), I can't say that I ever noticed any practical difference between them.

Re: Show HN: I made a calculator that works over disjoint sets of intervals

#38
Expanding the logic to union of intervals looks cool, but what is the complexity of that? Since you introduce the the possibility of an operation on an interval producing two intervals I suspect executing N operations might have an exponential complexity, which unfortunately makes this unfeasible to use for some common intervals applciations like abstract interpretation, unless you start introducing approximations once you have enough intervals.
Post reply on HN