5 ms·
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.
by davidt84 2y ago
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.
- gpderetta 2y agoAgree it must be true that it has at least one hat, and it must be non-green (he might have other green hats).
- MrMcCall 2y agoWhy would you conclude that the liar is telling the truth that they have any hats at all?
- rcxdude 2y agoThis is the contentious, formal-logicy part of the puzzle. "All my hats are green" as a logical statement, in most formal logic systems, would be true if I didn't own any hats (a so-called vacuous truth, because it doesn't mean anything, for similar reasons any statement conditioned on a false statement is true, e.g. "if 2+2=5, then I am god" is similarly vacuously true). So if I'm a liar and that statement is false, it must be false by me owning a non-green hat. But colloquially, people will usually break it down into the logical statement: "I own at least one hat and all my hats are green" (because most people don't consider vacuous truths to be relevant in most contexts), in which case it will be false if I own no hats (other systems of logic exist which will attempt to resolve this. Forcing such statements to be false makes things much trickier formally, as does e.g. three-valued logic to try to avoid assigning truth or falsity to such statements)
- MrMcCall 2y agoThanks for breaking that down for me. I guess, to me, a programmer logician not a mathematician logician, the real problem for me here is the definition of "liar" as it applies to how we parse the problem statement's facts.
- n4r9 2y agoI'd argue that this bit of mathematical logic carries over to many programming languages. For example using LINQ expressions in C#: https://dotnetfiddle.net/3QGurc https://dotnetfiddle.net/3QGurc
- gpderetta 2y ago"for each hat in the set of hats I know. the statement 'the hat is green' is true"; the previous statement would be true if the set of hats I know is empty. Incidentally, if you are a programmer it should be obvious that folding 'and' on an empty set must return True.
- MrMcCall 2y agoUninitialized variables are 90% of our bugs, or so I've been told. I don't consider a boolean "and" or "or" of a list of bools to be automatically true or false of an empty set, my friend. To me, the specific case for a boolean function applied to an empty list of bools would have to be explicitly stated in the design. Thanks for explaining how mathematicians and logicians treat the empty set. I have more pragmatic situations to address :-)
- ColinWright 2y agoConsider iterative code to sum a collection of ints: sum = 0 for value in collection: sum += value return sum For every non-empty collection this returns the correct result, and for the empty collection it returns 0. Now the product: product = 1 for value in collection: product *= value return product For every non-empty collection this returns the correct result, and for the empty collection it returns 1. Now the AND: A = True for value in collection: A = A AND value return A For every non-empty collection this returns the correct result, and for the empty collection it returns True. Now the OR: R = False for value in collection: R = R OR value return R For every non-empty collection this returns the correct result, and for the empty collection it returns False. Let's abstract it: Def FOLDR( initial, OP, collection ) result = initial for value in collection: result = result OP value return result So now: sum( collection ) = FOLDR( 0 , + , collection ) product( collection ) = FOLDR( 1 , * , collection ) and( collection ) = FOLDR( True , AND, collection ) or( collection ) = FOLDR( False, OR , collection ) This is why we define the results we do on empty collections. It's not just a convenience or a convention, it's consistent, and to do otherwise, even if documented, is to lay a trap for future maintainers.
- qsort 2y agoIt's a multiple choice question, it's asking "which of the following is necessarily implied", and A is the only one.
- InsideOutSanta 2y agoWhether you are wrong depends on whether you interpret his statement in a mathematical or in a colloquial sense. Colloquially, if I have no cats and tell you "all my cats are brown", you'd say that I'm lying, beause I'm implying that I have cats. Mathematically, if I have no cats, then it is true to say that all of the ones I have, which are zero, are brown.
- SirMaster 2y agoIf you have none how can you say they are specifically brown? You could say they are any color then which makes them being just 1 specific color not true. Your non-existent cats aren't brown, they are every color or even no color. 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.
- InsideOutSanta 2y agoYou are talking about the colloquial meaning of these words.
- SirMaster 2y agoAt most people reading The Guardian would?
- InsideOutSanta 2y agoThe article states that "this question was originally set in a maths exam, so the answer assumes some basic assumptions about formal logic." This is a funny way of phrasing it, but should make it sufficiently clear to any perceptive reader of The Guardian that they are supposed to ignore the colloquial interpretation of the phrase. At any rate, it would hardly qualify as a puzzle if the answer was so obvious
- JKCalhoun 2y ago"Which, if any, of the following statements can we conclude from what the liar has said?"