Earlier quoted context omitted.
I learned about Vacuous Truth the hard way recently when I found out that `every` method in JavaScript returns `true` for empty arrays as well.
But if you consider “liar” to be an object, > liar.hats.every((hat) => hat.color === "green") will throw a TypeError: Cannot read properties of undefined. That’s definitely not `true`.
A liar who always lies says "All my hats are green."
91–100 of 419 posts
Re: A liar who always lies says "All my hats are green."
#92Earlier quoted context omitted.
I learned about Vacuous Truth the hard way recently when I found out that `every` method in JavaScript returns `true` for empty arrays as well.
But if you consider “liar” to be an object, > liar.hats.every((hat) => hat.color === "green") will throw a TypeError: Cannot read properties of undefined. That’s definitely not `true`.
Re: A liar who always lies says "All my hats are green."
#93Earlier quoted context omitted.
Speaking mathematically , you are right. However, linguistically I disagree. Consider: Someone tells you that "all of their kids are doing great in school". Turns out they have no kids. They obviously were trying to deceive you, and make you think they do have kids - in fact, since plural, more than one kid. Hence, it is effectively a lie. So if the liar speaks of "all my hats" while having none, that is deceptive. I…
And that's why SO gets mad when I come home with six cartons of milk[1]. [1]: https://blog.bryanbibat.net/2013/01/02/programming-joke/
A wife asks her programmer husband” on your way home, can you swing by the store and buy one carton of milk, and if they have eggs, get six?”
It’s funnier and more relatable to programming if he comes home empty handed, crashes the car into the garage door, and says, with perfect alacrity, “six what?”
Re: A liar who always lies says "All my hats are green."
#94My take (possible spoiler): If he had no hats, then his statement would technically be true. Therefore he has at least one hat. He may have some green hats and some non-green hats, but must have at least one non-green hat. He could have any number of green hats, including zero, as long as he has at least one non-green hat. So the only derived statement that we can conclude to be true is A.
Yeah, I'm a bit confused there is no option "he has at least one non-green hat", which is what I would answer. Perhaps that means I'm wrong.
Re: A liar who always lies says "All my hats are green."
#95The statement translates to:
∀x ( IsAHatOfMine(x) => Green(x))
That's just equivalent to ∀x (~IsAHatOfMine(x) ∨ Green(x))
by the definition of implication (it's only false if the antecedent is true, and the conclusion false).The negation of that is (by repeated application of De Morgan's):
~∀x (~IsAHatOfMine(x) ∨ Green(x))
∃x ~(~IsAHatOfMine(x) ∨ Green(x))
∃x IsAHatOfMine(x) ∧ ~Green(x))
Thus, the liar has at least one hat, that, furthermore, is not green, so A) [EDIT: but not D - I misread it].In ordinary English, the meaning of the original phrase, thus the answer to the puzzle, is different.
Re: A liar who always lies says "All my hats are green."
#96Earlier quoted context omitted.
One of the points of this puzzle is to see beyond your social intuition. So yes, this puzzle plays on being able to figure out the logic while it goes against common social intuition.
Fascinating. I think many people here have applied their own social intuition- - a programmer’s idea of an empty sets- to the puzzle.
Re: A liar who always lies says "All my hats are green."
#97Earlier quoted context omitted.
No, the liar having no hats would not make the statement true. ‘All my hats implies’ implies the liar stating they have hats. 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.
No. In formal logic, if you have no hats, it is true that all your hats are green. You can claim anything about those hats, it is even true that each one of those hats is the same size as the universe, or that they are all completely green and completely red at the same time. In normal language, this would be different, but that is not the context here. > Note: this question was originally set in a maths exam, so the…
But told by someone who cannot make a true statement.
Re: A liar who always lies says "All my hats are green."
#98The puzzle is referring to the concept of a vacuous truth ( https://en.wikipedia.org/wiki/Vacuous_truth ). In most logic frameworks, the All function (upside down A in standard logic notation) is true if and only if no statement within the set is false (i.e. All his hats are green if he has no hats). This is for several reasons: - it allows for more coherent empty set functions. For example if we take the power set o…
I learned about Vacuous Truth the hard way recently when I found out that `every` method in JavaScript returns `true` for empty arrays as well.
Re: A liar who always lies says "All my hats are green."
#99Earlier quoted context omitted.
I learned about Vacuous Truth the hard way recently when I found out that `every` method in JavaScript returns `true` for empty arrays as well.
In programing, you can always rewrite that first rule as "all" and "some" must compose over set union. So, "all (A ∪ B) == all A && all B", and "some (A ∪ B) == some A || some B". That lets you discover the answer for the empty set.
Re: A liar who always lies says "All my hats are green."
#100The phrase “All my hats are green” implicitly carries the premise “I have hats” in conversational language. Thus, if this statement were to be expressed as a logical proposition, it should be: “I have hats, and all my hats are green.” This means there are two potential falsehoods in the statement: 1. “I have hats.” 2. “All my hats are green.” Therefore, what we can deduce is: • He might not have any hats. • If he doe…
You could have a similar situation in pure logic or math - if I were to say "the largest prime number is odd", is that false? Or something else entirely? (This is what Hofstadter calls mu, from a related concept in Zen.)