Live data from Hacker News

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

theguardian.com

401–410 of 419 posts

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

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

I'm not a mathematician so please bear with me here, but I think a problem stems from the fact that the set of reals is "infinite". So, whatever interval you choose, there are infinitely more reals outside the interval as inside (by that I mean that you can fit an infinite number of copies of that interval up to infinity). So the probability e is not >0, it is effectively 0. The second problem is, what does it mean to choose a real at random ? There is an implication that you can choose such number, but as a human living in the finite universe there are limitations to your choice. Any number you can write using all the atoms in the universe is infinitely outnumbered by all numbers that you can't. So effectively it is impossible to pick a random real number. You have to pick a real in some interval, implicitly the interval of reals you can write in an envelope. Which is a different problem than stated originally and for which your "e" can be >0.

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

#402
post #401

Earlier quoted context omitted.

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…

I'm not a mathematician so please bear with me here, but I think a problem stems from the fact that the set of reals is "infinite". So, whatever interval you choose, there are infinitely more reals outside the interval as inside (by that I mean that you can fit an infinite number of copies of that interval up to infinity). So the probability e is not >0, it is effectively 0. The second problem is, what does it mean t…

I'm not a mathematician so please bear with me here

I am a mathematician, so please bear with me when I try to explain how this can work.

The rational numbers are countable, and that means that I can write a list of them. There are several ways of doing this, but personally I like the Calkin-Wilf tree[0]. That only gives the positive ones, but we can include zero and the negative ones by interleaving them.

So, whatever interval you choose, there are infinitely more reals outside the interval as inside (by that I mean that you can fit an infinite number of copies of that interval up to infinity). So the probability e is not >0, it is effectively 0.

One you have chosen the two numbers, L and U, I note that there are rational numbers in between. Choose one of those numbers, call it M.

M is in my list above. Now I roll a die, discarding numbers from the list until I get a 6. There is a non-zero probability that the number retained is M, so there is a non-zero probability that my chosen number is between L and U. So e is definitely non-zero.

The second problem is, what does it mean to choose a real at random?

It doesn't have to be uniformly at random -- that's the mistake nearly everyone makes -- and the above process does it perfectly well. It only ever chooses a rational number, but that's OK. It's still a real number, it's still a random number, and for any non-empty interval, there is a non-zero chance the chosen number is inside.

... as a human living in the finite universe there are limitations to your choice.

Yes, but that is accounted for in the explicit description of how to choose the number.

Any number you can write using all the atoms in the universe is infinitely outnumbered by all numbers that you can't.

Again, this is accounted for by the fact that we are not choosing uniformly at random.

[0] https://en.wikipedia.org/wiki/Calkin%E2%80%93Wilf_tree

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

#403
post #401

Earlier quoted context omitted.

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…

I'm not a mathematician so please bear with me here, but I think a problem stems from the fact that the set of reals is "infinite". So, whatever interval you choose, there are infinitely more reals outside the interval as inside (by that I mean that you can fit an infinite number of copies of that interval up to infinity). So the probability e is not >0, it is effectively 0. The second problem is, what does it mean t…

> The second problem is, what does it mean to choose a real at random ?... So effectively it is impossible to pick a random real number

Yes, it's established there isn't "uniform distribution over all real numbers" without violating axiom of probability. You're 100% correct on this.

But it doesn't make Colin's solution wrong, because e > 0 for any* well-defined distribution.

> Which is a different problem than stated originally

There are two ways to inteprete the original problem:

A. The numbers are truly randomly picked over all real numbers.

B. The numbers are picked from a well-defined distribution which is unknown to the player.

Since A. is invalid mathematically speaking (without changing the commonly accepted definition of probability), it's reasonable to only consider B., in which case, Colin's solution is correct.

I made a more intuitive explantion on why a strategy better than coin toss exists here: https://news.ycombinator.com/item?id=42372972

*: More strictly, any distribution that guarantees the probability that the two numbers in envelope are the same = 0.

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

#404

Earlier quoted context omitted.

Consider 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 AN…

But you have specifically initialized your AND and OR results to be True and then False, respectively, thus specifying the resulting value for their processing of the empty set. What I'm saying is that you always need to specify that default value to handle the empty set properly. In no way would I consider ANDing or ORing an empty set's boolean values to be automatically True or False, (no pun intended). You have ch…

But you have specifically initialized your AND and OR results to be True and then False, respectively, thus specifying the resulting value for their processing of the empty set.

I've read through your reply several times, and I think you've missed the point.

The code here is the code that produces the right result for non-empty collections. It's the shortest, cleanest, clearest code that does so. These aren't random initial values, chosen arbitrarily. They are the unique values that make the code give the right answer.

Then we ask: What result does it give for the empty collection?

The answer is that for "sum" it gives "0", for "product" it gives "1", for "AND" it gives "True", for "OR" it gives "False".

In particular, in each case it gives the identity element of the algebraic structure. This isn't a coincidence, it's a part of how algebraic operations work.

That's why for any operator, the result of applying it to an empty collection is the identity element. It's algebraically consistent.

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

#405
post #401

Earlier quoted context omitted.

I'm not a mathematician so please bear with me here, but I think a problem stems from the fact that the set of reals is "infinite". So, whatever interval you choose, there are infinitely more reals outside the interval as inside (by that I mean that you can fit an infinite number of copies of that interval up to infinity). So the probability e is not >0, it is effectively 0. The second problem is, what does it mean t…

> The second problem is, what does it mean to choose a real at random ?... So effectively it is impossible to pick a random real number Yes, it's established there isn't "uniform distribution over all real numbers" without violating axiom of probability. You're 100% correct on this. But it doesn't make Colin's solution wrong, because e > 0 for any * well-defined distribution. > Which is a different problem than state…

How the numbers in the envelopes were picked doesn't matter. What's important is that they exist, and are specific numbers.

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

#406
post #386

Earlier quoted context omitted.

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

You're correct. I realized that I completely misunderstoond the original problem after reading McDonnell's paper more carefully. I thought you meant the strategy can make the winning chance always >50% even after the player opens the first envelope, which isn't possible. However you actually meant the strategy can make the expected winning chance >50% before the player opens the first envelope, for any well-defined d…

Exactly right. After you've picked the envelope, you may be nearly guaranteed to be wrong. For example both numbers are large positives and you picked the smaller. Now you're almost guaranteed to guess larger, and be wrong.

But before you pick, your odds were still bigger than 50%. Just not by much.

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

#407
post #391
post #386

Earlier quoted context omitted.

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

That code has the same problem that Colin Wright's explanation does. Your computation of the success rate explicitly uses the fact that you're between the two values, but till you've seen the second value you can't possibly know whether you are or are not and thus can't adjust your guess based on that fact.

No, I'm not doing anything other than tracking it. I'm doing that to show the user, "How much of this success was chance 50% choices, how much was guaranteed?" And so people can see how much of a good or bad result was blind luck versus the strategy successfully sticking a thumb on the scales.

In other words, I'm merely trying to be informative.

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

#408

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.

In my opinion a lot of these puzzles are about empathy toward the examiner as they generally ask variations of "what would I answer to this question?".

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

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

#409

Earlier quoted context omitted.

"More or less" is the key and the rub. The specific semantics must be determined and utilized in place. For me, the evaluation of the empty set should have separate semantics than that for how a non-empty set's elements are logically combined to produce a value. This is the result of doing stats programming for grad students, doing lots of database design and programming, and lots of regular programming in imperative…

function areAllTheirHatsGreen(someone) { return someone.getHats().every(hat => hat.color === 'green') } I wonder if there's a language or programming paradigm where this function wouldn't be determined simlarly. I think best you could do is make a validation check that throws an error if there's no hats at all, but would that make sense? What if you have a function that has to return a boolean and not throw an error.

The best I've found are languages like F# that allow you to return a pair of values, which for your example would be a tuple of (bool, bool), where the first is isError and the second is the evalResult. Of course, you better not mix `em up!

As to paradigms, I've not seen anything yet, but I haven't seen it all, and corporate America has their legacy systems that limit their explorations.

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

#410
post #401

Earlier quoted context omitted.

I'm not a mathematician so please bear with me here, but I think a problem stems from the fact that the set of reals is "infinite". So, whatever interval you choose, there are infinitely more reals outside the interval as inside (by that I mean that you can fit an infinite number of copies of that interval up to infinity). So the probability e is not >0, it is effectively 0. The second problem is, what does it mean t…

I'm not a mathematician so please bear with me here I am a mathematician, so please bear with me when I try to explain how this can work. The rational numbers are countable, and that means that I can write a list of them. There are several ways of doing this, but personally I like the Calkin-Wilf tree[0]. That only gives the positive ones, but we can include zero and the negative ones by interleaving them. So, whatev…

Am I right to assume one could also sample from a Gaussian distribution for the method to work? Of course, the probability e of sampling between the two real numbers would be very small, but it would be nonzero.
Post reply on HN