The liar either has zero hats or some amount of hats. The only thing we know for certain is that if they do have hats, there is at least one non Green hat.
The liar either has zero hats or some amount of hats. The only thing we know for certain is that if they do have hats, there is at least one non Green hat.
> Note: this question was originally set in a maths exam, so the answer assumes some basic assumptions about formal logic. A liar is someone who only says false statements.
In this case, the reader is given the special definition of liar, but not the special definition of “lie”. (As in, it’s not a lie to make definitive claims about nonexistent hats.)
A lot of the “trick” in logic puzzles boils down to this issue of word play. This puzzle could have been drafted so that the liar’s statement leaves proper room for the no-hats case, but then it would be too easy.
But told by someone who cannot make a true statement.
Really? Any human I have ever met when presented with that statement would likely immediately point out that there are no books on that shelf.
For every hat H that I have, H is green.
If I have no hats, this statement is true, just as
* the empty sum is 0,
* the empty product is 1,
* the empty AND is True, and
* the empty OR is False.
So with this interpretation, the liar having no hats would make the statement true.
e.g. "all my lamborghinis have magical goat skin seat covers" is true if 1) I have no lamborghinis or 2) All the ones I own have magical goat skin seat covers.
(fr I have no logical or mathematical background)
I would appreciate it if you would correct my thinking on the subject, if I have erred: https://news.ycombinator.com/item?id=42365506
Thanks in advance.
Common source of confusion/trickery/divergence between ordinary language and formal logic.
Edit: Logically speaking, the following two are equivalent:
They married and had kids.
They had kids and married.
Depends on your logical system! There are temporal logics to allow one to capture logically the difference between the two.
For all x in A, x has XYZ property
is taken to be true when A is the empty set.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.
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