3 ms·
I think that the implicit question is: Why someone choose this behavior? [spoiler alert] The idea is that if A={a1, a2, ...} B={b1, b2, ...} are sets, th
by gus_massa 10y ago
I think that the implicit question is: Why someone choose this behavior?
[spoiler alert] The idea is that if
A={a1, a2, ...}
B={b1, b2, ...}
are sets, then
min(union(A, B)) = min(min(A), min(B))
I don't expect this code will not compile as is in any language, but I hope it's understandable enough.
The what happens if A is the empty set? if we define
x = min(empty)
then
min(union(empty, B)) = min(B)
min(min(empty), min(B)) = min(x, min(B)
so
min(B) = min(x, min(B))
Then x must be a number big enough to be bigger than min(B) for any set B. But min(B) can be very big if B has only big numbers, so the only possibility is that x = +infinity.