If my initial/known interval is [0,20) or length 19
And the 3 intervals are: [0,5), [5,10), [10,20)
Using the standard interval addition formula:
[a,b]+[c,d] = [a+c,b+d] I get the result [15,35) [1] not [0,20)
How do I multiply them to check if they add up to the known interval?
Also, there are cases where the 3 intervals don't add up: [0,5), [5,10), [15,20) - in this case, the complete puzzle is missing interval [10,15), so how do I check for that?
I understand you mean intervals of integers, e.g., $[0,5)=\{0,1,2,3,4\}$ (
rangein Python). To check whether given intervals $[a_i,b_i)$, $i=1,\dots,n$, form a partition of $[A,B)$, you can do the following: