logoalt Hacker News

gpderetta12/09/20241 replyview on HN

> But you have specifically initialized your AND and OR results to be True and then False

No other value would be meaningful.

> What I'm saying is that you always need to specify that default value to handle the empty set properly

no you need a default value to handle the base case of the recursion. The result of the empty set falls off from it.


Replies

MrMcCall12/09/2024

IIUC, using your function with an empty set in SPSS or SAS will result in a NULL value, which is neither True nor False (NPI).

Do you know the truth tables that include NULL? I don't off-hand, but I seem to remember that combining NULL with a True or False results in NULL, which is why I catch my NULLs before they become operands in my operations.

ANDing or ORing the lack of values in the empty-set is always specified by someone's semantics. You're just determining those semantics as a by-product of the way ANDs and ORs are calculated.

This is why the reality of "All my hats are green" has a great deal of real-world ambiguity when there are no hats, because "Color( NULL[-hat] )" is NULL. Now, how you interpret NULL in that case is up to you, because NULL is neither True nor False, in my experience and understanding.

I am open to learning, tho.

ETA: Wouldn't your method also mean that the liar saying "All my hats are not green" would also be true? And, I'm no mathematician, but if "All my hats are green" and "All my hats are not green" both eval to True, I think something has gone very wrong. That looks like why the NULL value is so useful in SQL and stats.