I was triggered by a C# puzzle on twitter by Bill Wagner.
I’ll repeat the puzzle here:
Create a sequence where Any() returns false, and All() returns true.
That got me pauzed for a while. Then it occurred to me it could only be true for an empty set, but I was not sure …
I had to check it with some code. Code speaks the truth, doesn’t it? 😉
It feels so counter intuitive, but we can say anything about all elements in an empty set! Wow, mind blowing!
I was trying to explain it to my daughter (16) but I could not find any convincing example that could explain it properly.
Suddenly I had a brilliant idea™: Take the function
f(x) => 1 / x.
X’s close to zero will give values of near infinity (or at least very large numbers). Thus an empty set can be really anything!
But she debunked it by saying I had not proved any reason why I chose f(x) => 1 / x as my basis!
Uhmm, well … thanks for the brilliant idea™ so far …
In the end we could agree that a bag with zero blue marbles is equal to a bag with zero red marbles. Or a bag with zero euros (or dollars if you prefer). Or a bag with zero of anything!