It amounts to an assumption of an implied conditional ("If I have hats...") which is not always warranted. The "gotcha" here says more about the vacuous truth assumption than it does someone who falls for it.
Because for efficiency reasons you make a lot of assumptions constantly that may or may not be true, and 99% cases it would work for your favour.
Sometimes assumptions need to be challenged or we need to be reminded of that it can be good to challenge assumptions in certain cases, it can allow us to discover some new things.
I guess I disagree, although I don't mean that disrespectfully. Vacuous truth is one reason why nonclassical logics exist. The wikipedia article gives a good example of how allowing for vacuous truth can lead to absurdities: "All my children are goats" said by someone without children. This is a statement that is vacuously true technically, but (assuming laws of biology hold, and a human is making the statement), it is something that could never be true even if the antecedent ("I have children") were true. It's not just something playing on incorrect intuition, it's a statement that is true only by convention or a certain line of reasoning that to me is made only out of convenience because of certain implications.
It stretches the definition of "true" so far that the term "vacuous truth" no longer means "truth" in the general sense in which it is understood. It plays on the use of the term "truth" more than anything else to me; one could redefine "vacuously true" statements as "vacuous" statements in the sense of "undefined" and then the "gotcha" would no longer apply.
I think the example also captures a sort of flaw in applying classical logic (at least classical logic with vacuous statements) to everyday speech in another way that I don't think is just incorrect intuition. If someone asserts "All my hats are green", it's understood to be an assertion that the speaker does in fact have hats, otherwise there would be no point in structuring the statement as it is. That is, the statement is evaluated as true or false with reference to the antecedent because it (the antecedent itself) exists, and another, different statement could have been made. Classical logic evaluates the statement "All my hats are green" as if it were the same as "If I had hats, all my hats would be green" — but they are not the same statement, they have different meanings. There's a counterfactual possibility in natural language, which I think requires nonclassical logic.
if you dont assume the vacuous truth, and instead leave it undefined, then when hes got no hats, "all my hats are green" is absurd, rather than false.
the gotcha only stops applying when you put a vacuous false, rather than true or undefined.
is this really a flaw in applying classical logic? with the vacuous true, the only information you get from "all my hats are green" being false is that they have at least a hat, same as the intuitive result
For me, the evaluation of the empty set should have separate semantics than that for how a non-empty set's elements are logically combined to produce a value.
This is the result of doing stats programming for grad students, doing lots of database design and programming, and lots of regular programming in imperative and functional languages.
The key is that we are always working within a context, and this problem's context involves both formal logic and regular old language. And, whew!, is there a disconnect and interference pattern.
What a delightfully unserious discussion!
function areAllTheirHatsGreen(someone) {
return someone.getHats().every(hat => hat.color === 'green')
}
I wonder if there's a language or programming paradigm where this function wouldn't be determined simlarly.I think best you could do is make a validation check that throws an error if there's no hats at all, but would that make sense?
What if you have a function that has to return a boolean and not throw an error.
As to paradigms, I've not seen anything yet, but I haven't seen it all, and corporate America has their legacy systems that limit their explorations.
my-hats is not empty
for every hat in my-hats, is-green(hat) is true
We know that the speaker always lies, so both statements must be false: my-hats must be empty, and it must be that it exists at least one hat in my-hat that is not green. This is a contradiction. So either the speaker or the puzzle is not consistent (and uninteresting), or the 'my-hats is not empty' is not a valid assumption.> We know that the speaker always lies, so both statements must be false: my-hats must be empty, and it must be that it exists at least one hat in my-hat that is not green.
No. Since it is one statement as written, and the rules of common logic are not created by the liar, as I said up in the thread, either possibility is true. The person may have no hats or have one hat that is not green.