Live data from Hacker News

A liar who always lies says "All my hats are green."

theguardian.com

151–160 of 419 posts

Re: A liar who always lies says "All my hats are green."

#151

I never liked this type of puzzle. It is not formal logic but more about the idiosyncrasies and conventions of the English language. I put this puzzle on par with Agatha Christie’s murder mysteries. It requires a suspension of disbelief and logic to be believable. Someone who always lies means in the purest sense means you cannot trust anything they say. Even the word “hat” could mean they are talking about their pet…

> What the author would probably say is “All my hats are green” means the liar is either lying about All or Green. Either all their hats are some other color or only one hat is green. This means you have to assume the liar has a hat. How do we know that?

This is almost certainly not what the author will say, and it does have some tangential connections to computing so it's worth expanding on briefly.

In computing you often reduce problems to smaller problems, this can be done with recursion but it doesn't have to be, dynamic programming kind of is the reverse of it; whatever. When you do that though, you get these questions about really small collections, sets, lists, data structures.

Just for a quick concrete example so that we're not an abstract theory land, is a one-element list sorted? Is a zero element list sorted? Is [5, 5, 5] sorted ascending, descending, both, or neither? If you choose the wrong answer, then it means that your algorithm needs to be more complex, you don't trust zero-element lists to be sorted so your quicksort HAS to pivot on a median of 3, you don't trust one-element lists to be sorted so your quicksort HAS to pivot on a median of 5, or maybe when you see that you would recurse into a list of size 1 you generate a new median-pivot or something.

In mathematics, there is a convention which attempts to generalize this idea that an empty list is always sorted. In fact, an empty list is also always randomly sorted. It is always sorted descending, too. If it's an empty array of ints, all of those ints are greater than 1000—and they are also less than 50.

The mathematical convention is, in lay speak, “if you are talking about nothing, pretty much anything you say is going to be true unless it's gibberish.” If I said every int is green, well, synesthesia excepted ints don't really have colors, that's crap.

Everything else is “trivially true.” More formally, any predicate of the form {for all elements in S, this is true of that element} is taken to be “trivially true” when S is an empty set. It is something like the code,

    let agg = true
    for (const element of mylist) {
      agg = agg || f(element)
    }
where no matter what f is, if mylist was empty, agg is true. (“Trivial” here is sometimes replaced with the word “vacuous” because “trivially” is also a common English word meaning “easily,” so something “trivially true” might also by normal English rules mean “is easily seen to be true, is easily proven to be true, we can debunk the opposite with a 5 second look at the Wikipedia page,” etc.)

So that's the convention and besides making base cases much easier, one reason to do this is that the negation of any “for all Xs in the set, Y” is always perfectly specified as “there exists an X in the set such that not-Y.” The other convention you'd have to negate as “Either the set is empty or (...)”.

So the claim is that the perfect Liar is lying according to mathematical rules of Truth and falsehood, and according to those rules, this statement “all of my hats are green” can only be false if there exists at least one hat belonging to the liar which is not green. If there are no hats then the statement was trivially true.

Re: A liar who always lies says "All my hats are green."

#152

I never liked this type of puzzle. It is not formal logic but more about the idiosyncrasies and conventions of the English language. I put this puzzle on par with Agatha Christie’s murder mysteries. It requires a suspension of disbelief and logic to be believable. Someone who always lies means in the purest sense means you cannot trust anything they say. Even the word “hat” could mean they are talking about their pet…

Agreed. Not to mention that a liar doesn't necessarily have to mean someone who tells a falsehood in every single statement. It could just mean someone who frequently tells falsehoods. Or, more deviously, someone who wants to cause maximum uncertainty in his listeners, in which case some mix of true and false statements would probably be the way to go.

> Not to mention that a liar doesn't necessarily have to mean someone who tells a falsehood in every single statement.

FTA: >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.

I think it's pretty clear how on definitions

Re: A liar who always lies says "All my hats are green."

#153
post #20

The 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.

As I think you would hope from a practical standpoint -- you don't want to have to handle a special case of false and always check if the array is empty.

I agree it's only logical in engineering contexts like that though, not in everyday language.

Re: A liar who always lies says "All my hats are green."

#154

I never liked this type of puzzle. It is not formal logic but more about the idiosyncrasies and conventions of the English language. I put this puzzle on par with Agatha Christie’s murder mysteries. It requires a suspension of disbelief and logic to be believable. Someone who always lies means in the purest sense means you cannot trust anything they say. Even the word “hat” could mean they are talking about their pet…

I agree.

It reminds me of the math "puzzles" on Twitter which go:

1 shoe + 1 shoe = 2

2 shoes + 2 shoes = 4

3 shoes + 2 shoes = ???

And the answer isn't 5 because a) we're not counting shoes and b) the shoe laces were different colors. There's nothing clever, it just teaches you to be hyper cynical and question every little detail which isn't relevant to either Math or the real world.

Re: A liar who always lies says "All my hats are green."

#155

  things.every(thing => thing.type == 'hat' && thing.color == 'green')
now negating this gives:

  things.some(things => thing.type != 'hat' || thing.color != 'green')
So liar has something that is not a hat OR has something that is not green

So only "E) The liar has no green hats" is true

Re: A liar who always lies says "All my hats are green."

#156

I never liked this type of puzzle. It is not formal logic but more about the idiosyncrasies and conventions of the English language. I put this puzzle on par with Agatha Christie’s murder mysteries. It requires a suspension of disbelief and logic to be believable. Someone who always lies means in the purest sense means you cannot trust anything they say. Even the word “hat” could mean they are talking about their pet…

The end of the article notes "A liar is someone who only says false statements." I agree that this is quite different from the colloquial definition of a liar, someone who mixes truth and lies in order to mislead.

The beginning of the article quite clearly states "A liar who always lies", though.

Re: A liar who always lies says "All my hats are green."

#157
post #131
post #95

SPOILER The 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 a…

Wait a second. If the liar says, "All ten-foot tall men have brown hair," we cannot conclude that there must exist a ten-foot tall man. EDIT: I'll clarify to say I wasn't taking issue with the derivation , but rather with the translation of the English statement into first-order predicate logic. No non-logician would conclude that there must be a ten-foot tall man if "All ten-foot-tall men have brown hair" is false.…

Yes we can because if there are no ten-foot tall men, then it is indeed true that "All ten-foot tall men have brown hair"

Re: A liar who always lies says "All my hats are green."

#158

I never liked this type of puzzle. It is not formal logic but more about the idiosyncrasies and conventions of the English language. I put this puzzle on par with Agatha Christie’s murder mysteries. It requires a suspension of disbelief and logic to be believable. Someone who always lies means in the purest sense means you cannot trust anything they say. Even the word “hat” could mean they are talking about their pet…

The article clearly defines someone who always lies to mean they only make false statements. It's not hard or ambiguous to determine various scenarios in which "all my hats are green" is false.

The solution article also discusses vacuous truths ("all my hats are green" is true if you have no hats, vacuously). Truth has a definition in formal logic too, but we've gotten far enough that this problem is already solvable and unambiguous.

Re: A liar who always lies says "All my hats are green."

#159
post #131
post #95

SPOILER The 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 a…

Wait a second. If the liar says, "All ten-foot tall men have brown hair," we cannot conclude that there must exist a ten-foot tall man. EDIT: I'll clarify to say I wasn't taking issue with the derivation , but rather with the translation of the English statement into first-order predicate logic. No non-logician would conclude that there must be a ten-foot tall man if "All ten-foot-tall men have brown hair" is false.…

Then the liar isn't lying, as the statement is true.

Re: A liar who always lies says "All my hats are green."

#160

I never liked this type of puzzle. It is not formal logic but more about the idiosyncrasies and conventions of the English language. I put this puzzle on par with Agatha Christie’s murder mysteries. It requires a suspension of disbelief and logic to be believable. Someone who always lies means in the purest sense means you cannot trust anything they say. Even the word “hat” could mean they are talking about their pet…

This is generally the case for the vast majority of puzzles, and it equally drives me mad in those areas where academics set "puzzles" and conclude that people's inabilty to "solve" them is some cognitive deficiency. I've rarely encountered a case where it is isnt an extreme lack of self-awareness in the questioner -- eg., being extremely overfit to language/notation/etc. localised to their own area of expertise.

Logic itself is a relatively new invention, and is symbolic itself. That is to say, logic is a map not the territory.

That said, if someone can't fathom the most widely used symbolic languages humans use (math, logic, language, etc) they probably do have a cognitive deficit of some sort when compared to those who can.

Post reply on HN