Live data from Hacker News

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

theguardian.com

381–390 of 419 posts

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

#381
post #350
post #300

Earlier quoted context omitted.

Just be glad that you didn't go for the 2 envelopes problem which was her next. Vos Savant was wrong about that one, and few people like the real answer. The problem is that you're presented with two envelopes with 2 real numbers inside. You randomly select one, then look, and try to guess if you got the larger number. It doesn't seem like you can do better than even, but you can! Unfortunately everyone hates the ans…

The two reals are selected via some distribution, and the only way you can do better than chance is if you have some knowledge of that distribution. The question leaves that distribution completely hidden, and your answer smuggles it back in. That feels less like a counter-intuitive math/stats question and more like a badly worded gotcha.

This turns out not to be the case.

Let's play this game exactly once.

You choose two unequal real numbers. I don't know what they are, and I don't know the distribution from which you choose them. You write them down and put them in separate envelopes.

I'm allowed to choose one envelope and open it to see the number inside, and my job is then to say which envelope holds the larger number.

I claim I have a strategy now which lets me win strictly more than 50% of the time. My strategy is this.

I choose a real number R at random from a distribution that has dense support. In other words, for any two reals, L and U with L 0. This is easy to do ... one method is to list the rationals, positive and negative, then roll a die, discarding numbers until you get a 6.

Now I flip a coin and thereby choose an envelope at random. I proceed by assuming my chosen number is between your two numbers. There is a non-zero chance this is true ... call it e. So e>0.

If I'm wrong then my choice is 50% ... probability is 1-e.

If I'm right then my choice is 100%. ... probability is e.

Combined, my chance of being right is 0.5(1-e) + e = 0.5+e/2, which is strictly greater than 50%.

You can make it as small as you like, and if we play the game repeatedly then you can make it approach 50%. But as it stands, with a one-off game, I can win with a probability that depends on your chosen numbers, but which is strictly bigger than 50%.

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

#382
post #377
post #371

Earlier quoted context omitted.

You don't need a uniform distribution to get guaranteed better than even odds. And many nonuniform distributions work just fine. There are no hidden conditions. It is just a shocking result that we don't expect.

You need some _known_ distribution though, and it's shocking because the distribution is ommitted from the question, and the presence of the same distribution is snuck into the answer.

I think you are wrong ... see my answer here:

https://news.ycombinator.com/item?id=42371563

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

#383
post #112

Earlier quoted context omitted.

My description of the power set is by definition allowing all to imply some

I don’t follow. Can you elaborate?

The power set of a set S, P(S) (or sometimes 2^S) is the set of all subsets of S including both the empty set and the set itself.

To bridge the gap with programming, make a map f: S -> bool which represents our predicate.

all(f, S) => either S is empty or for all elements s in S, f(s) = True.

Now make f work on sets as well as individual values. f({x, y}) means True if f(x) and f(y) are True, False otherwise.

all(f, S) => all(f, P(S))

If we take the opposite and define all(f, {}) = False then this doesn't work and in addition all(f, P(S)) = False for all sets S.

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

#384
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…

As a programmer, my favorite way to think about Vacuous Truth is to think about the relationship between binary operators and their corresponding sequence operators. Think about taking an operator like "plus" and extending it to sequences or lists of things. What properties would we like those extensions to have? Let's start with a simple example:

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

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

#385
post #30

Earlier quoted context omitted.

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…

That's the thing, the problem isn't written in formal logic. It's written in English, which is vague.

It's written in a form of English that is formal enough to have a straightforward translation to logic formulas. Also, in the solution article that now has been posted, it's compared to the statement "I have read all books on my shelf" with an empty shelf, which is indeed vacuously true. The sentence about hats is equivalent, I think even the least exactly-minded English speaker would agree.

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

#386
post #371

Earlier quoted context omitted.

You don't need a uniform distribution to get guaranteed better than even odds. And many nonuniform distributions work just fine. There are no hidden conditions. It is just a shocking result that we don't expect.

https://www.alexirpan.com/2015/09/09/the-other-two-envelope-... If your solution is the same as this article's, it's plain wrong. Even the natural number case is plain strong. It's very easy to demostrate as well: consider a trivia case where the distribution is just {P(1)=1/3, P(2)=1/3, P(3)=1/3} and you see 2 in the first envelope. There is no strategy to get a better chance than 50%. Therefore, any strategy that g…

Sorry, but you're simply wrong. You can read the answer I gave. You can read the answer Colin Wright gave. You can trust that we both have math degrees and know what we are talking about. Or, aw heck, you can try it with an actual program at https://www.perlmonks.org/?node_id=39630. (Yes, I wrote that piece of hackery about a decade ago.)

I don't actually care how you convince yourself. But the explanation is right. If your random number is outside of the range, you've got even odds. If it is inside of the range, you've got 100% odds. As long as there is a positive probability of being between, you've got strictly better than even, by half of the probability of being between.

Many, many distributions guarantee positive odds of being in between. The one I chose for my program was:

    (log(rand) * (flip_coin() ? 10 : -10 ))
Which is the log of a random number between 0 and 1, times 10 times + or - with even odds. The various factors were chosen to fit well with normal human choices that most seek to test it with.

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

#387
post #362
post #205

Earlier quoted context omitted.

monty hall is not a true paradox. it could be classed as "veridical" (truthful) paradox, or i've seen it called a pseudo-paradox. 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?

Yes, I didn't mean it as it being a paradox just the problem I hate the most. I should've worded that better. 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…

very interesting. i love the reply; don't mistake my responses as arguments or disagreement - just ideas:

i think Savant was 100% correct and the original stating of the problem was clear enough. it's not really about torturing students or trying to be tricky or edgy - it's meant to be an important lesson about independence in statistics. it's more of an example of the kind of real problems that are torture. statistics is the torture, not the exposition of it...

> content creator in the print media wanted to give an edgy true answer to farm engagement

this was 1975 and the fight didn't break out until 1990. using terms like "content creator", "farm engagement", etc. gives a vibe that i guarantee was not the case at the time. yes, it was meant to be an engaging puzzle, but back then it didn't have those highly negative connotations.

from wiki: "Several critics of the paper by Morgan et al.,[38] whose contributions were published along with the original paper, criticized the authors for altering Savant's wording and misinterpreting her intention"

if anything people with an axe to grind like the Morgan et. al. analysis were the one twisting words around.

as far as instructors (and many other people) having a bad time explaining it, well... that's not a problem with the puzzle is it? bad teachers are a real thing.

for me the very best most direct way to understand the puzzle and the solution is to look at the decision tree diagram next to "Conditional probability by direct calculation" on the wikipedia page [1]. with only 3 doors and 3 possible first choices and a single 2nd chose (switch or not), you can easily fully directly compute every possible scenario. draw that picture 3 times (one for each initial door chosen) and count up the wins and losses for strategy switch vs no-switch.

[1] https://upload.wikimedia.org/wikipedia/commons/thumb/d/de/Mo...

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

#388
post #383

Earlier quoted context omitted.

I don’t follow. Can you elaborate?

The power set of a set S, P(S) (or sometimes 2^S) is the set of all subsets of S including both the empty set and the set itself. To bridge the gap with programming, make a map f: S -> bool which represents our predicate. all(f, S) => either S is empty or for all elements s in S, f(s) = True. Now make f work on sets as well as individual values. f({x, y}) means True if f(x) and f(y) are True, False otherwise. all(f,…

That doesn’t explain how all(f,{}) => some(f,{}) may be made true with your definition preserving the distributive property.

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

#389
post #350

Earlier quoted context omitted.

The two reals are selected via some distribution, and the only way you can do better than chance is if you have some knowledge of that distribution. The question leaves that distribution completely hidden, and your answer smuggles it back in. That feels less like a counter-intuitive math/stats question and more like a badly worded gotcha.

This turns out not to be the case. Let's play this game exactly once. You choose two unequal real numbers. I don't know what they are, and I don't know the distribution from which you choose them. You write them down and put them in separate envelopes. I'm allowed to choose one envelope and open it to see the number inside, and my job is then to say which envelope holds the larger number. I claim I have a strategy no…

Why, exactly, are you allowed to know why some random guess is between the two numbers or not when computing your choice?

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

#390
post #385

Earlier quoted context omitted.

That's the thing, the problem isn't written in formal logic. It's written in English, which is vague.

It's written in a form of English that is formal enough to have a straightforward translation to logic formulas. Also, in the solution article that now has been posted, it's compared to the statement "I have read all books on my shelf" with an empty shelf, which is indeed vacuously true. The sentence about hats is equivalent, I think even the least exactly-minded English speaker would agree.

> Also, in the solution article that now has been posted, it's compared to the statement "I have read all books on my shelf" with an empty shelf, which is indeed vacuously true.

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.

Post reply on HN