Win a copy of Functional Reactive Programming this week in the Other Languages forum!

# Can you spot the fallacy?

Tim Holloway
Saloon Keeper
Posts: 18304
56
http://www.mycoted.com/4_men_in_hats

One of the things that really irritates me is "intelligence tests" that assume a certain level of ignorance. What irritates me even more is when prospective employers inflict such things on me.

No, I didn't have a job interview recently, but this particular puzzle did set me off.

Read the puzzle. Read the description of the puzzle. If you can't figure it out, read the solution to the puzzle. Once you've done that, explain the fallacy, and you'll understand why the way you frame a question can be as important at the question itself.

Ernest Friedman-Hill
author and iconoclast
Marshal
Posts: 24212
35
Hmmm. Well, the only thing I could think of is if everything were geometrically perfect, aligned, and still, D would see only one black hat. He would not be able to see B because C would block his view. C assumes that D can see B as well as himself, but I suppose that's by no means certain.

Tim Holloway
Saloon Keeper
Posts: 18304
56
Good point, but not what I was thinking of.

Jayesh A Lalwani
Rancher
Posts: 2756
32
Sorry, I don't see the fallacy. It needed a bit of thinking but I figured out the answer. I think it's a good interview question because it makes the interviewer think beyond the most obvious.

Ernest Friedman-Hill wrote:Hmmm. Well, the only thing I could think of is if everything were geometrically perfect, aligned, and still, D would see only one black hat. He would not be able to see B because C would block his view. C assumes that D can see B as well as himself, but I suppose that's by no means certain.

They do mention C can see only B, and D can see B and C and each of them know where the other 3 are buried

Tim Holloway
Saloon Keeper
Posts: 18304
56
Ernest was more realistic. In the real world, perspective would tend to obscure B. Unless B had a much larger head. But, that wasn't what set me off. Especially since they did weasel around the perspective issue anyway.

Bert Bates
author
Sheriff
Posts: 8900
5
I'll confess that I think it's a solid logic puzzle, and while I agree with the answer, I think the explanation is lame - there is a much cleaner, simpler way to arrive at the same answer.

Bear Bibeault
Author and ninkuma
Marshal
Posts: 65228
95
• 3
Jayesh A Lalwani wrote:I think it's a good interview question because it makes the interviewer think beyond the most obvious.

I hate these type of interview questions. They do nothing to find out if a candidate has the qualifications I'm looking for.

Tim Holloway
Saloon Keeper
Posts: 18304
56
Bear Bibeault wrote:
Jayesh A Lalwani wrote:I think it's a good interview question because it makes the interviewer think beyond the most obvious.

I hate these type of interview questions. They do nothing to find out if a candidate has the qualifications I'm looking for.

Interviewer or interviewee? Cynic that I am, I tend to suspect that questions such as this were probably handed out at some overpriced management seminar or the like and that the interviewer probably never thought about it at all. Other than in terms of what the "correct" responses were.

I'm curious about Bert's "cleaner, simpler way".

Bear Bibeault
Author and ninkuma
Marshal
Posts: 65228
95
• 2
Tim Holloway wrote:
Interviewer or interviewee?

Either way. I won't ask them, and I won't answer them. That may sound arrogant, but really, with 33 years of experience surely we can find something more technically interesting to talk about other than how the pirate gets the gold rope?

Jayesh A Lalwani
Rancher
Posts: 2756
32
• 1
Bear Bibeault wrote:
Jayesh A Lalwani wrote:I think it's a good interview question because it makes the interviewer think beyond the most obvious.

I hate these type of interview questions. They do nothing to find out if a candidate has the qualifications I'm looking for.

One of the problems that we consistently have with many new hires is that when faced with a problem, they do a quick google search or scratch their head for 5 minutes or so, and they give up. The architect/lead has to step in to try the not so obvious solution. Perseverance and looking beyond the first step is a qualification that we look for. The obvious possible solution is D and its easy to see that s not the right solution. It's easy to see that C can't see D, and A and B see nothing. A lot of people will give up at this point and not go beyond the obvious. Most people won't make the deductions that lead you to the answer. Analytical skills like this is a god skill to have.

Bear Bibeault
Author and ninkuma
Marshal
Posts: 65228
95
• 1
Jayesh A Lalwani wrote:Analytical skills like this is a god [sic] skill to have.

Absolutely. But I'll find this out in a technical context without resorting to asking them to find the heavy marble.

Michael Matola
whippersnapper
Ranch Hand
Posts: 1821
4
C is too optimistic in interpreting the others' silence. For example, C interprets D's silence as an indication that D knows he can't answer. Suppose C has a white hat and D has a black hat, but D remains silent because he's not bright enough to figure it out.

Mike Simmons
Ranch Hand
Posts: 3090
14
• 2
Yes, the solution requires the assumptions that C and D (at least) are bright enough to figure it out, and that C knows that D is bright enough. Also that both want to live - what if one is suicidal? And of course, D has to be able to see both B and C's hats, and C has to know that D has a clear line of view to both.

Bear Bibeault
Author and ninkuma
Marshal
Posts: 65228
95
• 2
Turns out D is mute! They all get shot!

Jayesh A Lalwani
Rancher
Posts: 2756
32
What if A has X-ray vision?

Jayesh A Lalwani
Rancher
Posts: 2756
32
I just remembered what this puzzle reminded me of. Someone had posted the 100 blue eyes puzzle in MD couple of months ago. This is the same puzzle except smaller

Here it is Wikipedia has a good article on logic theory called common knowledge. Basically at the first iteration every one knows that D knows what B and C are wearing, and hence in certain conditions should know the answer. Since doesn't speak up, the silence eliminates the condition, and provides More information to everyone else.

Maneesh Godbole
Saloon Keeper
Posts: 11196
15
Jayesh A Lalwani wrote:What if A has X-ray vision?

...and B, C, D are all ladies

@Bear,
I like your common sense and judgement Sir! You da man.

Jayesh A Lalwani
Rancher
Posts: 2756
32
• 2
It doesn't matter what sex they are. They are buried from the head down anyways

Tim Holloway
Saloon Keeper
Posts: 18304
56
We have a winner!

Jayesh has seen it. The strictures say that "nor other ways of communicating". But SILENCE is communication as well!

I just got done reading one of Frank Herbert's works (not one of the Dune series). Herbert was big on indirect forms of communication, whether it was in the ways that people (or aliens) revealed things unknowingly or private communications consisting of minimal hints and gestures or even ways of whistling or fidgeting.

Of course the real danger of such a system of communication is that in the circumstances described, it's not reliable. A few reasons why D might not sing out right off have already been mentioned. And what if D has an attack of hysterical laryngitis? What if D gets so befuddled that he misses the obvious? What if D is a vicious bastard who's willing to wait NINE minutes before speaking up, even at the risk that one of the others will panic and make a wild incorrect guess, figuring that 50/50 odds are better than none?

I used to have a relative who'd employ this tactic. Put you in a situation where you daren't speak and then say "Silence implies Consent". A lot of real atrocities in this world have been justified by that phrase, whether uttered or merely accepted as a given.

And Bear, if Ganesha shows up looking for a job, hire Him. I hear he's really good a problem-solving.

Maneesh Godbole
Saloon Keeper
Posts: 11196
15
Jayesh A Lalwani wrote:It doesn't matter what sex they are. They are buried from the head down anyways

That's unfair. If superman can see through buildings with his x-ray vision, why cannot these quasi-inverted ostriches?

Steve Luke
Bartender
Posts: 4181
22
• 1
Tim Holloway wrote:We have a winner!

Jayesh has seen it. The strictures say that "nor other ways of communicating". But SILENCE is communication as well!

I think you are finding something wrong with the problem just because you want to find something wrong with the problem, not because there is a fallacy. The problem set tells you they have the ability to communicate: The can call out the color of their own hat and are told they are not allowed to talk to each other. If the ability to talk is part of the communication defined by the problem, the ability to not talk is assumed and in fact required. Silence is not an 'other way of communicating' but simply the other end of the same way of communicating already defined and allowed by the problem set.

Jayesh A Lalwani
Rancher
Posts: 2756
32
Tim Holloway wrote:
Of course the real danger of such a system of communication is that in the circumstances described, it's not reliable. A few reasons why D might not sing out right off have already been mentioned. And what if D has an attack of hysterical laryngitis? What if D gets so befuddled that he misses the obvious? What if D is a vicious bastard who's willing to wait NINE minutes before speaking up, even at the risk that one of the others will panic and make a wild incorrect guess, figuring that 50/50 odds are better than none?

I used to have a relative who'd employ this tactic. Put you in a situation where you daren't speak and then say "Silence implies Consent". A lot of real atrocities in this world have been justified by that phrase, whether uttered or merely accepted as a given.

Right, the problem assumes perfectly rational, reasonable and able actors. That's an assumption that doesn't really hold true in real life. That's why in real life you need to communicate and establish clear consent.

Ernest Friedman-Hill
author and iconoclast
Marshal
Posts: 24212
35
Tim Holloway wrote:We have a winner!

Jayesh has seen it. The strictures say that "nor other ways of communicating". But SILENCE is communication as well!

OK, you got me, I guess. The hidden assumptions are the Nash Game Theory assumptions, and they are latent in many puzzles like this, as well as real-world sciences like economics and diplomacy.

So Tim, let me guess, you threw down "Foundation" in disgust after the first few chapters?

Tim Holloway
Saloon Keeper
Posts: 18304
56
Ernest Friedman-Hill wrote:
So Tim, let me guess, you threw down "Foundation" in disgust after the first few chapters?

Funny that you mention "Foundation", since the Second Foundationers were big into minimalist communication themselves - I'd considered them as an example in addition to Herbert.

I did read the whole series through, though. Can't recall why the first few chapters would be off-putting. Besides, Seldon was pretty up-front about things. It's a fine old tradition to be perfectly honest while letting people draw the wrong conclusions - the ancient Greeks (among others) considered it an outright virtue.

My objection here was that the puzzle specifically and explicitly stated no forms of communication, and I maintain that that was an outright lie, since silence is communication, too. Anyone who disagrees I invite to listen to John Cage.

In mathematical terms, it would be like defining a number puzzle and saying that "nothing" couldn't exist while expecting an answer of Zero. Which is something we gave up on a long time ago.

Mike Simmons
Ranch Hand
Posts: 3090
14
Tim Holloway wrote:My objection here was that the puzzle specifically and explicitly stated no forms of communication, and I maintain that that was an outright lie, since silence is communication, too.

It said, no other means of communicating. After it had talked about the fact that there was a minute of silence, followed by one person calling out. What did you think "other" meant here?

Saurabh Pillai
Ranch Hand
Posts: 524
What if the arrangement is (a,b,c,d) -> (w,b,w,b). Even in this situation d would remain silent and c would not know his hat color.

Tim Holloway
Saloon Keeper
Posts: 18304
56
Mike Simmons wrote:
Tim Holloway wrote:My objection here was that the puzzle specifically and explicitly stated no forms of communication, and I maintain that that was an outright lie, since silence is communication, too.

It said, no other means of communicating. After it had talked about the fact that there was a minute of silence, followed by one person calling out. What did you think "other" meant here?

I'll have to grant you that one, although it comes under the heading of misdirection, because it's a psychological trick. The explicit solution is not given, but by making a distinct and separate paragraph of the fact that there is a solution, it gives the impression that that statement is not part of the strictures enclosing the problem, when in fact it is the most essential part of the definition of the problem.

Stuart A. Burkett
Ranch Hand
Posts: 679
Saurabh Pillai wrote:What if the arrangement is (a,b,c,d) -> (w,b,w,b). Even in this situation d would remain silent and c would not know his hat color.

c knows he is not wearing black otherwise d would have known where both the black hats are and hence would have called out that he was wearing white

Jayesh A Lalwani
Rancher
Posts: 2756
32
C knows that if D stays silent then the color of C's hat is differrent than the color of B's hat. SO, even if the color of the hats were reversed, C would be able to answer the question.

If you want to understand this in detail, look at the differrent permutations

w|wbb - D sees a white hat and a black hat. doesn't know A's hat so stays silent. C sees a white hat and deduces that A saw a black hat on C's head
w|bwb - D again sees a white hat and a black hat, doesn't know A's hat, so stays silent. C sees a black hat and deduces that A saw a white hat on C's head
w|bbw - D sees 2 black hats, and deduces that he himself has a white hat
b|wwb - D sees 2 white hats and deduces that he himself has a black hat
b|wbw - D sees a white and black hat, doesn't know A's hat so stays silent. C sees a white hat and deduces that A saw a black hat on C's head
b|bww - D sees a white and black hat, doesn't know A's hat so stays silent. C sees a black hat and deduces that A saw a white hat on C's head

Ernest Friedman-Hill
author and iconoclast
Marshal
Posts: 24212
35
Tim Holloway wrote:
I did read the whole series through, though. Can't recall why the first few chapters would be off-putting.

Just the notion that people's behavior was rational or computable.

Tim Holloway
Saloon Keeper
Posts: 18304
56
Ernest Friedman-Hill wrote:
Tim Holloway wrote:
I did read the whole series through, though. Can't recall why the first few chapters would be off-putting.

Just the notion that people's behavior was rational or computable.

Ha! You think that people have to be rational to be computable? I know folks that if I quack out the right words, I can almost predict their exact blood pressure readings.

Besides, psycho-history disclaimed the idea that individuals were totally predictable. It required very large populations. Planet-sized or bigger.

Even in Orwell's 1984, you could see signs of applied psycho-historical forces. Since then, with the assistance of advances in mathematics and computer technology, Hari Seldon doesn't look too unbelievable at all. A lot of that kind of stuff is now used routinely in advertising, and, alas, in election strategies.

Jayesh A Lalwani
Rancher
Posts: 2756
32
• 1
Tim Holloway wrote:

Besides, psycho-history disclaimed the idea that individuals were totally predictable. It required very large populations. Planet-sized or bigger.

SO, if you changed the puzzle to have planets instead of persons, you are fine with the puzzle? Let's say that it takes 10 years for a message from one planet to reach another planet and they have 1 year to solve the puzzle.

Tim Holloway
Saloon Keeper
Posts: 18304
56
Jayesh A Lalwani wrote:
Tim Holloway wrote:

Besides, psycho-history disclaimed the idea that individuals were totally predictable. It required very large populations. Planet-sized or bigger.

SO, if you changed the puzzle to have planets instead of persons, you are fine with the puzzle? Let's say that it takes 10 years for a message from one planet to reach another planet and they have 1 year to solve the puzzle.

No. Planets or people either one, it was a psychological trick to make one of the puzzle inputs appear as though it was an output, so to speak.

Psycho-history is a tangential matter I was commenting on with no direct bearing on the puzzle itself.

Mike Simmons
Ranch Hand
Posts: 3090
14
Jayesh A Lalwani wrote:SO, if you changed the puzzle to have planets instead of persons, you are fine with the puzzle? Let's say that it takes 10 years for a message from one planet to reach another planet and they have 1 year to solve the puzzle.

Then there would be no solution, clearly. Perhaps you wanted the 10 and 1 reversed?

Mike Simmons
Ranch Hand
Posts: 3090
14
I'm not seeing this "psychological trick" you keep referring to.

Tim Holloway wrote:I'll have to grant you that one, although it comes under the heading of misdirection, because it's a psychological trick. The explicit solution is not given, but by making a distinct and separate paragraph of the fact that there is a solution, it gives the impression that that statement is not part of the strictures enclosing the problem, when in fact it is the most essential part of the definition of the problem.

I see six paragraphs in their problem statement. You object to the fact that some essential data is in a separate paragraph from the essential data in the other five paragraphs?

The existence of a solution is suggested in the fourth paragraph, strongly implied in the fifth, and further affirmed in the sixth by "this is not a trick question". What's so tricky about that?

I don't think the existence of the solution is necessary to solve the problem. The (admittedly unstated) assumption of perfectly rational behavior would also suffice. Even without that, the solution given is easily a best guess, better than saying nothing. As long as C believes that D is not a complete idiot, it's reasonable for C to think that D would have said something if he had enough info to work out a solution. C can certainly work out that there's no possible way for A or B to know their hat colors, so if D can't solve it, there's no reason for C not to make his best guess, which is in fact a very good guess as long as D is not an idiot. Now if I were C I would have waited longer to make sure D had time to think everything through. But that also risks the possibility that someone else will panic. If you wait too long, the others will figure that any random guess they make has a 50% chance of being right, and so a random guess is better than doing nothing, if no one has a better idea. So C needs to say something before the others get too desperate.

Matthew Brown
Bartender
Posts: 4568
9
• 1
Mike Simmons wrote:Also that both want to live - what if one is suicidal?

Then they're all stuffed anyway. The suicidal one just has to say something other than "black" or "white". What if a meteor hits while they're trying to work it out? Not worth worrying about.

Matthew Brown
Bartender
Posts: 4568
9
• 1
There's one advantage of questions like this over more realistic scenarios.

- An intelligent person will be able to give you the correct answer.
- An intelligent person who will be a nightmare to work with will refuse to answer on the grounds that it's a silly question.

Bear Bibeault
Author and ninkuma
Marshal
Posts: 65228
95
• 1
I'll disagree on both counts. I would not have been able to come up with the answer, and I think I'm reasonably intelligent, and few people I've worked with find me a nightmare to work with. In fact, many jobs have been with former coworkers who wanted to work with me again.

But everyone's experiences may be different. Mine tell me that brain teasers are best for dinner parties, not technical interviews.

Tim Holloway
Saloon Keeper
Posts: 18304
56
As a measure of programming aptitude it fails, because one of the first things you want to do when solving a problem is to obtain as much data as possible. But this puzzle is predicated on the absence of something, not its presence.

To reference Sherlock Holmes: The dog didn't bark.

Mike Okri
Ranch Hand
Posts: 83
• 1
Tim Holloway wrote:As a measure of programming aptitude it fails, because one of the first things you want to do when solving a problem is to obtain as much data as possible. But this puzzle is predicated on the absence of something, not its presence.

To reference Sherlock Holmes: The dog didn't bark.

The puzzle tests "thinking out-of-the-box" intelligence and I don't blame companies for looking for people who possess this type of intelligence because they tend to be very good at analyzing complex real-world problems. Some programmers spend a lot of their time analyzing and looking for solutions to complex real-world problems. The puzzle gives you sufficient information and it's up to you what you do with that information:
• the men cannot talk to each other
• D can see C and B
• C can see B
• A & B can only see their respective sides of the wall
• one man must call out the color of his hat

• The only problem I have with the puzzle is that C cannot be 100% certain of the color of his hat. He can only be reasonably certain.