93 points · by ColinWright · 1y ago · 400 comments
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 of a set, that power set has the same All value as the standard set (since the power set includes the empty set)
- it allows for early stopping on false statements. So you can define the statement as a lazy executor of all child conditions
That lets you discover the answer for the empty set.
I agree it's only logical in engineering contexts like that though, not in everyday language.
> liar.hats.every((hat) => hat.color === "green")
will throw a TypeError: Cannot read properties of undefined. That’s definitely not `true`.
const liar = { hats: [] };
liar.hats.every(hat => hat.color === "green")
trueSum is the "sequence extension" of Plus.
Sum([a, b, c]) = a + b + c -- basically our definition
Sum([a, b, c]) = Sum([a, b]) + Sum([c]) -- distributive
Sum([]) = 0 -- identity
Let's keep things simple by assuming our operator is associative and has an identity (i.e., it is a monoid). We can take any monoid and extend it to sequences. Assume @ is some monoid. We define the sequence aggregate "Agg" as: [0] Agg([a, b, c]) = a @ b @ c == ((a @ b) @ c) == (a @ (b @ c)) -- definition + associativity
[1] Agg([a, b, c]) = Agg([a, b]) @ Agg([c]) -- distributive
[2] Agg([]) = Identity(@)
Note that property 2 is required if we want Agg([]) to have a value at all, since Agg([]) == Agg([] concat []) == Agg([]) @ Agg([]). If Agg([]) doesn't have a value, then it's not really properly distributive, since Agg([a]) == Agg([a] concat []) == Agg([a]) @ Agg([]) == ???. So we see that if we have an identity for the operator, it really should be the same as Agg([]).So let's extend AND and OR to sequence operators. The extension of AND can be called "Every", and it operates on sets of booleans. In particular, Every([]) == Identity(AND). The Identity of AND is "true", so Every([]) == True. The extension of OR can be called "Any", and Any([]) == Identity(OR) == False.
This is the easiest way for me to remember the truth values of Every([]) and Any([]): they must be the identities of the corresponding boolean operators.
Any([Your name is Bob, you can fly]) == Any([Your name is Bob, you can fly] concat []) == Any([Your name is Bob]) OR Any([You can fly]) OR Any([]) == (Your name is Bob) OR (You can fly) OR (False). Any([]) == False.
I propose that when translating such statements to a formal logic, if that's what you really mean, use an "allsome" quantifier as I've described here: https://dwheeler.com/essays/allsome.html
It's really easy to forget to include an existence quantifier. Having notation specifically designed to automatically include it can avoid some problems.
Perhaps. But what if someone asks you "are all your hats green?" Then the interpretation is not so clear.
No, you're not.
I would actually agree user dwheeler here.
Whether or not you agree with Gricean implicature theory (I do not), the point is that making a claim about a group that doesn't exist is absurd. Absurd statements do not convey meaning, and language is a tool for communication, thus it is generally an assumed axiom that statements will have meaning. Here, even when people make borderline nonsensical statements, we assume there is a metaphor or language game involved.
So, by making a statement about 'all my hats', if the number of hats you have is zero, then any predication is absurd and the statement is absurd, so given an axiom of not making absurd statements for natural language, you can assume there are at least two hats. Obviously there are no formal rules here, but the functionality of natural language demonstrates that these heuristics exist.
A simple program to test "all my hats are green" allows the empty set to be all green:
AllGreen = True
For each hat in MyHats:
If hat <> green:
AllGreen = Falsea joke
> "all my hats are green" - bill
> "but green hats catch fire in the sunlight" - joe
> "and thats why i dont have any hats" - bill
from the link:
> Many conversations have goals other than the exchange of information. One is amusement, which speakers often pursue by making jokes (Lepore & Stone 2015: §11.3). Because the goal is not to provide information, the maxims of Quality, Quantity, and Relation do not apply. If for any of these reasons the Cooperative Principle does not apply, reasoning based on it will be unsound.
i think i disagree - the joke is intended to say that bill doesnt have any hats, but would like one, and only a green one, and only if they didnt catch fire in the sunlight
So I'd put all that theory in a drawer somewhere and acknowledge that, when we're talking about logic puzzles, the rules of logic are paramount, not grammar.
It does not. All my unicorns fly. There is no assumption that I have a unicorn. There is an assumption, based on the claim but it is not a fact.
The puzzle also assumes that "my" implies there is some ownership (we'll take for granted "my" means "has" for simplicity), which is another quibble that unravels the whole thing.
E is correct. I don't see how A comes to be the accepted answer.
(assuming you have no unicorns) "all of my unicorns fly" is true; "some of my unicorns fly" is false; "true->false" is false.
"All my hats are green" is still false even when I own a red hat and a green hat.
The liar doesn't necessarily "have" any hats. Again, the assumption that the liar has hats is incorrect because it's relying on an conversational implication, rather than a specific assertion.
The fact that we compact these edge cases into arbitrary truth values is just for ease of computing.
This is also relevant to the arbitrary choice of the 'inclusive or' as a default over an 'exclusive or', which most people use in natural language.
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 cat that they like to carry on their head.
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?
We only know that because of similar puzzles that came before. In other words this is not logic but more pattern recognition.
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.
"All" bring a common colloquial term doesn't have a strict set theory definition here. It is reasonable many people think zero hats is means the lie is in this very first word.
A lot of people will consider "all" to implicitly mean 1 or more, while I think strict logicians will map colloquial all to 0 or more.
All mat imply colloquially 2 or more as well, as why bother say "all" if you had one hat in the truthful sense
"My hats" contrasts with the "has a hat" because having a hat in your possession that you could have borrowed does not confer ownership that the word "my" can imply.
So great, a three letter word and a two letter word and we are knee deep in ambiguity.
They could be wearing the hat to try to publicly locate the true owner who might say "hey I lost that hat at x".
"Are green"... Green as in vegetable? Green as in the specific wavelength defined as green and not lime or some other named shade? Completely green dyed being undermined by a black spot or a pattern on the hat?
Imo zero hats of ownership is a viable lie to the statement, as is having one red-green hat.
It really isn't. The problem is usually given in this form:
> Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice? [1]
The only correct ansewr to this question is "I don't know." People who answer yes are just taking way too many standardized tests.
The green hat problem hinges on subjective interpretations of the meaning of both "liar" and the different ways in which the liar's sentence may be false. It may be false because the liar owns many hats, none of which are green. Or they own many hats, only some of which are green. Or they own no hats. These are all reasonable interpretations of how the sentence might be false, and the answers presented are not necessarily mutually exclusive.
Edit: from your other reply I see your beef is more with the wording.
Edit edit: although I disagree with your point even then. But it seems to lead to rather fruitless argument, so let's leave it here.
Yes, it's also correct that you don't "know" the result, and you might prefer goats to cars (even then you should probably sell the car and buy several goats), but there's a reasonable enough interpretation of "advantage" that you shouldn't dismiss the problem outright.
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.
To speak in your analogy, people walk around with different maps of the same territory and realizing this is the self-awareness mjburgess is talking about.
If you are a primitive farmer abstract thinking isn't really useful to you. Everything you deal with in your life, except religion, can almost entirely be dealt with absolutes with little in the way of abstractions.
If it rains at the right time then you can have a good harvest. If the weather is bad then it sucks. If there is animals threatening your crops or herd you need to take steps to deal with them.
There is a lot of logic in dealing with these things. You have to know the seasons, know the stars, know the dirt, etc. You have to understand the life cycle and manipulate the behavior and biology of plants and animals at the right stages in their lives. Things have a logical sequence and there are direct consequences that are predictable from events and your actions.
Where as in modern society you have been conditioned to think in terms of hypothetical and abstractions through being exposed to testing your entire life.
You first need to know how test questions work before you are able to answer them accurately.
For a person who isn't exposed to this then the whole affair of asking hypotheticals and assuming imaginary situations with specific rules that don't actually apply to the present reality is very confusing.
They don't even understand the question. So, of course, they are going to suck at answering them.
And ultimately that is all IQ testing measures.. your ability to take tests.
- the local Russell hater
In the case of a logician and the properties of the elements of the empty set the frame of mind of the examiner is probaly going to be about using algebraic logical connectives.
For another nice example I can quote [0] via [1]
> Luria: All bears are white where there is always snow. In Novaya Zemlya there is always snow. What color are the bears there?
> Peasant: I have seen only black bears and I do not talk of what I have not seen.
> Luria: What what do my words imply?
> Peasant: If a person has not been there he can not say anything on the basis of words. If a man was 60 or 80 and had seen a white bear there and told me about it, he could be believed.
This is a more extreme case, but in my opinion it is the same phenomenon of being asked to take external things as true and work on them.
[0] https://languagelog.ldc.upenn.edu/nll/?p=481
[1] https://www.astralcodexten.com/p/somewhat-contra-marcus-on-a...
Does that actually happen in academia? It seems to mostly be a social media thing.
Suppose you're writing a paper what do you write: option A) Average People Cannot Understand Probaility!?!?!, option B) Inexperienced test takers with unfamiliar notation fail to grasp meaning of a novel question; option C) survey participants on technical questions often do not adopt a literal interpretation of question; D) etc. etc.
In general researchers are extremely loath to, or poor at, recognising there's 101 alternative explanations for any research result using human participants and 99.99% of the time just publish the paper that says the experiment evidences their preferred conclusion.
The contrapositive is a rule that says that "A => B" is the same as "not B => not A". This is very confusing to people, and few can follow verbally why it works.
But here is a fun experiment. People are presented with a selection of envelopes, all face down, and are asked to verify the fact that, "All unstamped envelopes are small." They immediately begin turning over the large envelopes, then have trouble explaining their (correct) reasoning!
Here is a correct implication process for their actions.
"All unstamped envelopes are small." => "unstamped envelope => small envelope" => "not small envelope => not unstamped" => "large envelope => stamped"
At which point it is easier to just check the large envelopes!
I agree that puzzles alone shouldn’t e.g. determine whether you’re a good fit for a job, though. That’s one of the more annoying parts of software interviewing.
Eg., rather than asking about the risks of A,,B,C given various probabilities etc. ask them to make bets in a highly familiar environment with a resource that has uniform marginal utility to them... so eg., "suppose you were at home and your friend does..., how much of your time on a sunday would you bet to do... "
You find that when "the very same question" is asked in highly familiar terms people get it right.
Then this investigator-academic should ask: what features of their own puzzle induce the kind of mistakes they see?
In my experience its often that people are far less socially incompetent than questioners, so put "interpretation & trust" priors on terms/presentations of questions that mean they don't parse the presentation into the problem the investigator has in mind.
People who write puzzles tend to be the most bureaucratic sort of literalists who have profoundly eccentric modes of interpretation
The problem that most people are solving is: "what do i say to make this person/question go away"
No, because the point is that they always hinge on an arbitrary distinction to give one answer. But if you made a different arbitrary distinction you'd get a different answer. And the arbitrary distinctions are, well, arbitrary. They reflect neither truth nor capability. Just whether you can read the questioner's mind as to what arbitrary and intentionally unstated assumptions they are making.
No thanks.
If we reframe it using C++ "std::all_of" function over an array of strings called "hats", and say that the following must be false (because he is a liar):
std::all_of(hats.begin(), hats.end(), [](std::string hat) { return hat == "green"; })
Then we can answer the questions without ambiguity:A) The liar has at least one hat. Yes, because std::all_of returns "true" on an empty list
B) The liar has only one green hat. Unsure, because { "green", "green", "red" } is false, and { "green", "red" } is also false
C) The liar has no hats. No, it is the opposite of A
D) The liar has at least one green hat. Unsure, because { "green", "red" } is false and { "red" } is also false
E) The liar has no green hats. Unsure, for the same reason as in D
[1] https://www.boost.org/sgi/stl/MonoidOperation.html
[2] note: Monoid, not Monad, and yes, category theory left its mark in C++ as well.
Yes! Before it became a programming problem, I considered the implications of this decision for common speech. In that case, it will generally be expected that when someone says "all my hats are green", they have at least one hat, probably because otherwise it doesn't hit the relevance threshold to make such a statement worth saying.[1]
Based on this, with my younger, hornier mind, I would joke that, "I have gone on a date with every female cheerleader at my university." (All the cheerleaders at my university are male.)
The idea being, an equally valid convention would be to read the statement as "there exists no element violating all the predicates" i.e. no one who is both a "female cheerleader at my university" and "someone I have not gone on a date with".
And this convention, it turns out, is what C's all_of (and Python's all()) uses.
But I'd still balk at someone using that trick in common speech -- it's at least an attempt to be misleading.
[1] See the "Maxim of Relevance": https://en.wikipedia.org/w/index.php?title=Cooperative_princ...
For example, you may want to use all_of to check if all the preconditions are met before running a command, is there are no preconditions, then you can run the command.
Or, in a test report, a test case is successful if it and all of its sub-cases are successful, if there are no sub-cases, then that part is considered successful.
Or, you are making a task runner, you exit if all the tasks are completed, if there are no tasks, then you can exit immediately.
Saying that all of nothing is true is the most appropriate behavior, both in theory and in practice.
Because it is, if you'll forgive my Haskell-ese, the only implementation that means that `all_of $ l1 ++ l2 == (all_of l1) && (all_of l2)` for all lists `l1` and `l2`, including empty ones.
Unfortunately, there are some obvious discrepancies. My favorite is that "can't" really means something closer to "not can".
This can be demonstrated with a close analysis of the statement, "I can't not do that." To get our usual understanding of the sentence we need to parse it as, "I (not can) (not do that)." And then turn that into, "I must not (not do that)." And now cancel the double negative to get, "I must do that."
Suppose that you try to parse it as, "I can not not do that." You quickly get, "I can do that." Which is not at all what that sentence actually means.
Just like the barber paradox isn't literally Russell's paradox, but it made more people to look up the history of it and perhaps learned what Russell's paradox is. Hopefully 0.1% of them turn out to be mathematicians.
I think it meant "hopefully at least 0.1%." (I can imagine someone who feels that it's hopefully at most 0.1%, but probably that person wouldn't be kindly disposed towards efforts to fool people into being interested in complex mathematical topics, as your parent seems to be.)
My point is that not everyone who understands barber paradox (in plain english) has to understand formal logic, and not everyone who understands formal logic has to become a mathematician. However I still believe the existing of the plain english puzzle is a net positive for humanity's collective mathematical comprehension.
Some is good, but more isn’t necessarily better.
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.
It's a handy stance because I'm no good at either solving logic problems or getting inside other people's heads!
Another on that really irritates me is the kind that presents a series of integers and asks which integer comes next. Any integer will do, you just have to fit the appropriate polynomial.
This one bugs me to no end because it's part of the standard elementary school curriculum, for example here: https://byjus.com/maths/patterns-questions/
But surely someone with a strong imagination could come up with a pattern to fit any number as the next in the sequence. I doubt most elementary educators even grasp the issue.
That is an excellent way to put it!
It explains why it appeals to non-math people. They are (usually) better at these more verbal-based games ime.
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.
"The liar says All my hats are green" becomes "¬∀x|x∈hat,OWNS(x) (GREEN(x))" or similar.
And then from there you can also translate the five provided answers and try to find a contradiction.
If the liar owns no hats the statement “All my hats are green” would be true. Under the parameters of the question it must be a lie and therefore cannot be true. So the liar owns at least one hat which is not green. They may own additional hats which can be of any colour.
People who are saying “if they are a liar they might not even be talking about hats” are somewhat missing the point:
1) Whether or not they are talking about hats they have made a statement about hats and under the “rules of the game” of formal logic it must be untrue because we are given they are a liar. That’s enough to answer the question.
2) The “rules of the game” are about predicates and properties and inference. The language is plenty precise enough to convey both the question and to deduce the solution.
Color of non existing object is undefined.
The correct solution is:
!(all && my && hats && are && green) == !all || !my || !hats || !are || !green.
When you’re writing functions that work on lists or sets, you need to decide what to do about statements that are vacuously true. Call it out in the documentation? Put in a special case? Assert that the set is non-empty? Or maybe even create a new datatype to make the corner case unrepresentable. These design choices have side-effects, making a function easier or harder to use, more or less error-prone.
Recognizing vacuous statements is pattern recognition, but it’s sometimes useful pattern recognition, and for children, learning about it might even be fun.
Well yea, that's the fun part! Logic puzzles without interaction with language are dull affairs indeed, basically just computation.
In fact, I would extend this to arguments as well: Let's be clear up front what we mean by important words and go from there. Too often people ending up arguing about definitions, but in roundabout ways.
Which is another listener’s bias: is lying by omission a lie?
All my horses are unicorns. I don’t have any horses, nor unicorns. So it’s true but also not.
It’s why puzzlemaking a truly challenging and impressive skill. It must be fair, a challenge, and obvious in retrospect.
I think it’s why the twist in Bioshock worked so well for me: it was right there in plain sight numerous times, while other twists in mystery games/films elicit a groan.
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.
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
I agree with the first stipulation, but, outside of Lewis Carroll's puzzles, I think that the second isn't true. For example, I believe you'll find just the opposite in Raymond Smullyan's books.
"I never make a true statement" says the liar.
In js if I write:
const allHatsGreen = hats.every(hat => hat.color === 'green');
it will be true if hats is empty. Same thing for C# Linq. Imo this makes sense, because if I write: const matchAllConditions = conditions.every(condition => condition.matches(item))
In some condition matcher (lets say I want to check rules before an user is allowed to post), the correct behavior is the result to be true, when the array is empty.I'm not well versed, in functional programming, but in Ocaml (of F#, hehe) it would be
let rec all_hats_green = function
| [] -> true
| hat::rest -> hat.color = "green" && all_hats_green rest
so in a recursive implementation, this is the behavior that makes sense.>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.
1. A deceit is an attempt to make somebody believe something false.
2. A falsehood is a statement which is false.
3. A lie is a deceitful falsehood.
Regardless of whether they miscommunicated about hats vs cats, and regardless of whether they were being deceitful in the process, for the statement to be a lie it would also have to be a falsehood, implying they have at least one hat which is not green.
Yes, these problems require suspension of disbelief, especially given the shorthand "he's a liar" always meaning that the person is often deceitful (usually with other negative implications), but the problem statement being that the "person always lies" is pretty clear and doesn't require special pattern recognition or other mental gymnastics, and it's not that different from the suspension of disbelief you invoke when playing a game of chess and not literally sending a knight to murderously dethrone your opposition.
The article mentions a maths exam, and of course the answer to the hats puzzle is very straightforward if you convert to statements about sets and logic in the way the teacher expects.
But converting ambiguous language into logical statements by taking everything extremely literally is the opposite of a useful life lesson, so I think it's a terrible exam question.
Trying to return to your more naive understanding of logic not only helps understand the intent of the puzzle, it also makes the puzzle more fun.
No; it makes the puzzle illogical and thus about as much fun, for those who prefer logical outcomes, as discussing religion or politics.
Just for example I play a game with my children where we tickle each other when we see a yellow vehicle. Is a yellow tractor a vehicle for purpose of the game? How about a yellow baby cart. How about a billboard with a photograph of a yellow baby's toy car?
We honestly have more fun discussing what is a vehicle for purpose of the game than we do tickling. Especially when it becomes clear that a yellow baby carriage is a vehicle only if it is daddy to be tickled... Honestly a good lesson to learn early that life is not fair and that rules are subjective.
We know this is occurring on a math exam, so it must be a logic puzzle. The exam-taker would've probably known this refers to a first-order logic question, and have been taught a certain way of translating sentences like this into first-order logic.
This is true of all word puzzles that they need to be mapped to math in a way that assumes knowledge about the world and context.
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.
the one I hate the most is the Monty Hall Problem.
but you realize that it's unambiguously mathematically true without gimicky word-play or puns or other logic puzzle trickery.
it's just simply an un-intuitive result. most statistics really is.
curious: why the hate for the monty-hall problem?
The reason I hate it is that it's a example of how to lie and mislead using statistics and that the only reason it exist is that a content creator in the print media wanted to give an edgy true answer to farm engagement, and now as a consequence many introductory statistics course make students suffer for the same reasons. The assumptions made to reach that answer are not made explicit and it changes the response. And teachers mess it up a lot of the time which lead to a lead of head-scratching (or sometime just leave under-specified on purpose).
It was the right answer to a question that wasn't asked. the host opens the door before giving the choice and the door he's choosing isn't random.
Wikipedia explains this better than I would be here's the part I'm talking about:
> In Morgan _et al four university professors published an article in _The American Statistician_ claiming that Savant gave the correct advice but the wrong argument. They believed the question asked for the chance of the car behind door 2 _given_ the player's initial choice of door 1 and the game host opening door 3, and they showed this chance was anything between 1/2 and 1 depending on the host's decision process given the choice. Only when the decision is completely randomized is the chance 2/3 .
[Monty Hall problem - Wikipedia](https://en.wikipedia.org/wiki/Monty_Hall_problem)
The game theoretic explanation (in the same page) as to why you should switch is more convincing and less click-baity though without needing to give a specific probability value or assume the host strategy.
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 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.
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. But since we can derive it from the translated logic statement, then there must be a problem with the translation.
In normal discourse people don't accept vacuous truths like that as meaningfully true. Rather I think people would interpret such a statement as a kind of hypothetical: "If there were a ten-foot tall man, he would have brown hair."
It's not clear to me if first-order predicate logic is really equipped to even handle reasoning about these cases of "a liar who always lies." Such a situation seems to be intrinsically higher-order. If a liar states a hypothetical, what does that mean, exactly?
My interpretation of the negation of the statement is, "If there were a ten-foot-tall man, he would not necessarily have brown hair." This doesn't imply the existence of any ten-foot-tall man.
1. The liar stating something must mean that the phrase is not true. They cannot state anything that is not false.
2. "All X are Y" is the phrase.
Now, if we assume there is no X the phrases "All X are Y" and "Not all X are Y" are both true and false.
All X are Y - True. Yes, there is no X that is not Y.
All X are Y - False. Yes, there is no X that is Y.
Not all X are Y - True. Yes, there are no X, so none is not Y.
Not all X are Y - False. Yes, there are no X, so none is Y.
All these statements are (according to the article) vacuous if there is no X. A liar then cannot make them, as they are not false.
So from here you can deduce that either the phrase "All X are Y" stated by a liar indicates the existence of X or that I'm a liar :)
We only would know that either X doesn't exists or, if it exists, not all X are Y.
But it doesn't work the other way around: "Every Frenchman I've ever met has become a good friend, but then again, I've never met a Frenchman". This isn't funny, because the second clause makes the first clause into a lie, as truth is normally understood. This is not a place where we colloquially accept an empty set.
So the puzzle posed translates the English sentence into logic badly. It isn't the conclusion which is counterintuitive, it is the logical analysis which is flawed.
we're using a made up definition of liar, who can only say things that are false. it's not part of the question for the liar to be able to tell a statement they arent certain is false
That being said, I would argue that, "All my hats are green." has different meaning than "I may or may not own a hat. Any hat that I own is green".
The use of 'all' and the plural of 'hat' implies that the author has multiple hats.
~∀x (~IsAHatOfMine(x) ∨ Green(x))
∃x ~(~IsAHatOfMine(x) ∨ Green(x))https://en.wikipedia.org/wiki/De_Morgan's_laws#Extension_to_...
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.
So if the liar speaks of "all my hats" while having none, that is deceptive. I would consider it a lie.
[1]: https://blog.bryanbibat.net/2013/01/02/programming-joke/
Also somehow saying she's my favourite wife was a problem, and yet "least favourite" was worse. Honestly!
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?”
"You can give me the loan, I don't own any companies that have less than 1 million in assets"
Mere deception is not lying. (Though it is dishonest.)
A mere untrue statement is not a lie. (Though it is conterfactual.)
But to lie is to (a) state an untruth (b) that is intended to deceive. Absent both conditions being satisfied, you're not dealing with a lie.
There are other forms of dishonesty, but not all of them are lies.
But conflating dishonesty with lying is harmful, because once you do that, you give ammunition to people who employ dishonesty in instances that don't involve lying, because if everyone is taking it as a given that dishonesty and lying are the same, and they can show that they weren't lying, then they can argue they weren't being dishonest. But that's wrong since dishonesty and lying are not synonymous—people can still be dishonest without lying—and, again, it is the dishonesty that is bad.
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.
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)
For all x in A, x has XYZ property
is taken to be true when A is the empty set.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.
Not sure why so many people got it wrong maybe ESL is at play here
Perhaps that means I'm wrong.
Maybe even more accurately they aren't brown, they are an undefined color.
I'm not really satisfied saying that the characteristics of something that doesn't exist can be anything. I am satisfied saying the characteristics are undefined though.
Personally, I'd change the original wording (from the quoted italic section) to "someone who only tells lies" if I were the author. It's probably specific to me, but I'm always thrown by phrases like that because it seems like it's trying to differentiate in some way from someone else; surely there isn't anyone who "always lies" who _isn't_ a liar, so why say that? It's distracting to me in the same way as if someone said "the speech-capable human being who speaks only in lies". Normally it wouldn't bother me, but because puzzles like this often seem to be used to try to illustrate some smug point about how bad people are at logic, phrasing things in an unnecessarily confusing way just makes it seem even more smug (see https://xkcd.com/169/).
He may also be claiming that the hats are ecologically friendly.
Are we also to assume that if all the hats were each mainly green on the outside but had brown linings, they are, or are not, each said to be "all green"?!
I need a pint.
The tests typically begin by instructing the sitter to try not to assume anything in each question. They presumably mean that you shouldn't assume something like women liking the colour pink more than men.
But actually, there often are a bunch of assumptions you need to make, such as that there are seven days of the week with the standard name and sequence. That the word for each number has not been switched with some other. Etc...
Therefore he lied when he said "All". He isn't talking about all of his hats.
He lied about "my", meaning that the hats aren't his. They belong to someone else.
He lied about "hats", really, they aren't hats at all!
He also lied about "are", because he is not talking about the present, but the past and the future states of the "hats".
Finally, he also lied about "green", the "hats" are anything but green, which proves, conclusively, that when he said 'green' he was actually referring to the very specific shade of green found only in government-issue pickle jars from 1972.
A) "The liar has at least one hat." cannot conclude because may have no hats, thus the lie is in the "all my hats"
B) "The liar has only one green hat." cannot conclude because may have 2+ green hats out of a 3+ set.
C) "The liar has no hats." cannot conclude that because he may have hats that are not green.
D) "The liar has at least one green hat." cannot conclude that because he may have no hats, or no green hats.
E) "The liar has no green hats." cannot conclude that because of the "all my" modifier means that he can have some green hats.
This is however different than what is true or not. Concluding from a set of multiple choice questions is not choosing ones that are potentially true, concluding is choosing something that is definitely true. There is not a single statement in that list of questions that is definitely true given the requirements, but all of the questions are potentially true.
on edit: all questions are potentially true, but not all potentially true at the same time of course - some of them lock out the others.
That makes A) a good candidate.
But E) can also be true — and in fact both A) and E) can both be correct.
on edit: I don't actually think you made my comment "but all of the questions are potentially true." any clearer than I made it, and evidently you seem to think that only A and E are potentially true, which is obviously wrong.
on second edit: ah I see that you believe the idea that some people are saying that All my hats are green indicates that the liar must have hats https://news.ycombinator.com/item?id=42369002 because evidently the assumption is that the 0 hat has a color green for some reason that is not adequately explained.
If that were true then it also follows that if the liar has no hats then all his hats are every color known to humanity. I don't think that is the way it works however.
In many forms of linguistic logic you need to have an existent hat to have the property green, therefore if you do not have any hats you have no green hats. Which is my preferred method of dealing with this.
And obviously there are other forms of logic, as https://iep.utm.edu/liar-paradox/#SH3c
Is the column that was linked more likely to be interested in linguistic logic games or formal mathematical logic games? I'm guessing the second, in which case I guess it's true we can conclude A - but I inherently dislike vacuous truths when applied to logic, especially language like this where the normal argument that the second parameter "Green" is never evaluated because we do not have the first "A hat" in the empty set seems suspect to me because we know what Green is separate from a hat, we just need to know if there is a hat we can assign Green to.
This is so much so that if you use the 'vacuous all', people will suspect that you have ulterior motives, and are being deliberately obtuse to hide them.
I wonder whether, if we attempted to make explicit all these tacit rules and conventions, we would end up with a consistent logic, and I believe that this looseness of natural languages was the main motivation for formalizing logic, from the enlightenment onward.
I doubt, given in what context this was written, that this is a matter of omission.
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 does have hats, at least one of them is not green.
However, considering the options provided by the author, it is clear they did not take into account the implicitly stated proposition (1) in conversational language. Instead, the author assumes that if he has no hats, then “All my hats are green” is true.
This interpretation, however, is conversationally unreasonable; otherwise, one could claim something equally absurd, such as “All my houses are worth over 100 million dollars” but actually has no house.
the statement is ambiguous when i have no hats, therefore, i must have at least a hat. weve seen the case so often as to know its true without thinking about it
>Note: this question was originally set in a maths exam, so the answer assumes some basic assumptions about formal logic.
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.)
By contrast, if you want to play in Math space, you need to be rigorous, and provide a Math-quality conversion.
If you refuse, what this reveals about the one posing the problem is that they themselves labor under the delusion that you can apply math rules to English, that there is exactly one and only one such mapping, that everyone should know and agree upon that mapping, and that is so true that you are justified in playing "gotcha!" games with people who don't know this nonexistent mapping.
It doesn't paint a terribly flattering picture of such people, in my opinion.
In the meantime, the rest of us should meditate a bit on "The Only Way To Win Is Not To Play The Game", because spiraling down trying to figure out the exact nature of the aforementioned nonexistent mapping is just a waste of time. There isn't one, so arguing it is just a waste of time and emotional energy. Pick a lane up front. They're both fine, but anything that functions by always choosing whichever lane maximizes the "gotcha!" in the moment is not worth spending time on.
Which reminds me of a quote from the British TV series Yes Minister: "A good speech isn't one where we can prove he's telling the truth. It's one in which nobody else can prove he's lying!"
Some clarifications. You can ask the same god repeatedly and you can make your questions and to whom you address them depend on previous answers. Think of Random as just flipping a fair coin to decide whether to tell the truth or lie. The puzzle is by George Boolos and titled The Hardest Logic Puzzle Ever for those looking for hints or whatever. Have fun.
If they always lie, then statement one is false - they lied about having hats.
Ɐh G(h)
(for all my hats, the hat is green)
or whatever similar formulation:
Ɐx (H(x) ^ M(x)) → G(x)
(for all x, if x is a hat and x is mine, then x is green)
Either way, the general idea will be that negating the statement (making it a lie) will make it a negative existential quantifier:
Ǝh ~G(h)
(there exists one of my hats such that it is not green)
Or in the case of the alternate formulation:
Ǝh (H(x) ^ M(x)) ^ ~G(x)
(there exists an x, such that x is a hat and x is mine, and x is not green)
So I think we answer (A) The liar has at least one hat.
All that said, I think other commenters are rightly pointing out that this relies on a very questionable distinction between semantics - which is what we've formalized above - and pragmatics. In conversational pragmatics, "All my hats are green" means that I have at least one hat (probably at least 3, even, since the sentence didn't say "My only hat" or "Both my hats"). One might explain this by way of an implicit pragmatic conversational principle that all statements should be relevant and informative in some way, which vacuously true statements (like, "all grass growing on the moon is purple") are not (see the "Gricean maxims").
If we don't make this implausible distinction between semantics and pragmatics (implausible to me because it assumes that sentences in general are usefully analyzed as having "propositional" meanings which can be evaluated outside of any conversational context), we might cash out the statement as:
Ɐh G(h) ^ Ǝh G(h)
so we can conclude, since this is a lie, that:
Ǝh ~G(h) ∨ Ɐh ~G(h)
Which is consistent with the liar owning no hats, as in:
> "All my hats are green"
> "Liar! You don't own any hats"
What if the liar said "I own no hats, but if I did own hats, not a single one of them would be green"? Can we then conclude the liar owns a green hat?
Formal logic generates contradictions easily and confuses people when expressed in word problem format, because humans aren't that logical - liars may only lie 10% of the time, when they see a benefit. It's like rational actor theory in economics - people may only act rationally 50% of the time.
a) they don't have any hats, i.e. that they are lying about having any hats at all.
b) they have some number of hats (n >= 1) and at least one is not green, because they are lying about the color of all their hats.
I would be happy to learn how I am wrong.
If a person doesn’t have any hats, is the statement ”All my hats are hats” false?
I once passed a midterm by abusing the latter. The question was to prove "there exists x such that if |a - b| < x, then something". The professor forgot to specify that x should be positive, so my response was that the implication is trivially true for x = -5 because a modulus cannot be negative.
The actual proof for positive values of x was much harder but the professor respected my math hacking skills and gave me full points for that question.
We have a set of items X1, X2, X3, ... etc.
Each of X1, X2, X3 differently matches conditions A, B, C, D, etc.
Think of "All" as: A AND B AND C AND D AND...
Each term we add we further restricts the result-set.
Thus if we start with lots of conditions, as we remove conditions, we increase the matching results, until we remove all conditions, and "All([])" matches everything, i.e. is vacuously true.
Likewise, think of "Any" as: A OR B OR C OR D.
Here, as we increase the number of conditions, we increase how many things match, thus "Any" on an empty set returns nothing, i.e. is vacously false.
2. by the negation rule, there exists a hat h in {liar's hats}, such that it is not true that h is green.
3. there exists a hat in {liar's hats}
This is really basic first order logic guys.
"For all x in {}, P(x)" is always trivially true without regard for P.
Similarly, "there exists an x in {}, P(x)" is always trivially false.
1) “All my hats are green”
2) We assume that “always lies” means that (1) is false.
3) If the liar has at least one hat that is not green satisfies (2)
4) If the liar doesn’t have any hats also satisfies (2)
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 greenSo only "E) The liar has no green hats" is true
The statement "All my hats are green" would map to
things.every(thing => thing.type != 'hat' || thing.color == 'green')
i.e., everything the person owns must either be green or, if it isn't green, it must not be a hat since all hats are green.The negated form would then be
things.some(thing => thing.type == 'hat' && thing.color != 'green')
i.e., there are some hats that are not green.1. If they don't have any hats, then any sentence about them would be truth.
2. The negation of the sentence, which must be truth, is "not all my hats are green". For this to be true, there must be some hats that are not green, so there must be some hats in general.
Person could really have a neon colored bowling ball and the statement “All my hats are green” is still valid.
I suppose the solution of A is valid assuming the physical object itself is not a lie.
Since we cannot refer to the liar, we can refer to the extended puzzle's author.
The author states that the goal of the extended puzzle is to determine if there is, 'IF ANY' (!!), a correct statement among [A, B, C, D, E]. Thus, there can be zero or at most one statement we can conclude as being true for sure.
The liar didn't said if he has hats. Maybe he has 0. Maybe 1. Maybe n. We just don't know.
'A: The liar has at least one hat.' > We cannot conclude this statement as sure, since maybe the liar has in fact 0 hats.
'B: The liar has only one green hat.' > He has maybe 0 hats. Or maybe n | n>1.
'C: The liar has no hats.' > He has maybe 1 hat. Or maybe n | n>1.
'D: The liar has at least one green hat.' > He might not have any hats at all.
'E: The liar has no green hats.' > Since the liar may have 2 hats, one could be green and the proposition could still be false, as it is a lie.
Since we cannot conclude any of the statements as being definitively true, the extended puzzle's answer is none of them are true for certain. It depends on how many hats the liar has.
And then read https://xkcd.com/169/
Anyway, I'm sure there'll be a YouTube video about this with an AI voiceover soon.
6÷2(1+2) is written in a deliberately confusing fashion. This is a simple math olympiad-style question. All universal quantifications on the empty set are true, for the same reason that the implication A -> B is true when A is false regardless of B. It cannot be any other way. Precedence of infix operators on the other hand is completely arbitrary, we settled on multiplication before addition because otherwise it would be a pain to write polynomials.
It might be a math Olympiad question, but a math Olympiad participant is supposed to know how, say, a vacuous truth works, and, moreover the mapping of formal English to logical operators (see also: the inclusive or) and that is not how everyone in the world will parse the statement of the problem.
Is the point here to educate people on a quirk of formal logic, or is a smugbait to promote a book? Oh look, there's a book. Quelle surprise.
And, as usual, the xkcd is fantastic.
And if I remember correctly it's not something that's obvious although for convenience it's often assumed.
hats.every((hat) => hat === 'green') === false
(A) is the only one of those potential answers that must be true to guarantee the above statement is satisfied.
If you didn’t select A, then the test is great for weeding out less intelligent people; which means it’s a good test if that is the objective.
Also, the novel referenced (Intermezzo) by Sally Rooney is quite good. It makes a few references to analytic philosophy, mostly Wittgenstein. It concerns two brothers whose relationship has broken down. One of them is a "wordcel" and the other is a "shape rotator".
NOT(FORALL(x): my-hat(x) -> green(x))
EXISTS(x): NOT(my-hat(x) -> green(x)) ; https://en.wikipedia.org/wiki/Universal_quantification#Negat...
EXISTS(x): NOT(NOT(my-hat(x)) OR green(x)) ; https://en.wikipedia.org/wiki/Material_implication_(rule_of_...
EXISTS(x): NOT(NOT(my-hat(x)) AND NOT(green(x)) ; https://en.wikipedia.org/wiki/De_Morgan%27s_laws
EXISTS(x): my-hat(x) AND NOT(green(x)) ; https://en.wikipedia.org/wiki/Double_negation#Elimination_an... (note that this assumes non-intuitionistic logic)
EXISTS(x): my-hat(x) ; https://en.wikipedia.org/wiki/Conjunction_elimination
So yeah, the liar must have at least one (non-green) hat.
"All my hats are green"
Is lie.
They are sombreros. Some you borrowed from me. You have no head!