Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

albert and bernard's logic puzzle

 
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having trouble following the solution to this.

I understand why 18 or 19 can't be the date. I understand why June can't be the month (because then only the 17th is left.) I don't understand why this rules out May 15th and 16th? Can someone explain it?
 
Marshal
Posts: 25669
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If Albert is told "May" then it's possible that Bernard is told "19", and then Bernard would know the answer.

But Bernard doesn't know the answer initially, because Albert tells us he knows that. Therefore Albert could not have been told "May"; if he was, then he wouldn't be sure that Bernard didn't know the answer.

So May 15 and 16 are eliminated.
 
Jeanne Boyarsky
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:If Albert is told "May" then it's possible that Bernard is told "19", and then Bernard would know the answer.


But it's also possible Bernard is told 15. Then the answer can be May 15th or 16th. I feel like I'm still missing the point here.
 
Paul Clapham
Marshal
Posts: 25669
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I just edited my post to make it clearer.
 
Paul Clapham
Marshal
Posts: 25669
69
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's put it the other way around. Suppose Albert is told "May". Then he says to himself "Bernard might have been told 19, so he might know the answer."

But in fact he says that he knows that Bernard doesn't know the answer. So we have to conclude that Albert wasn't told "May".
 
Jeanne Boyarsky
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:But Bernard doesn't know the answer initially, because Albert tells us he knows that. Therefore Albert could not have been told "May"; if he was, then he wouldn't be sure that Bernard didn't know the answer.


'm still not there. Albert knows Bernard wasn't told 19 because then Bernard would know the answer.

I know Albert can't assume Bernard wasn't told 15 or 16. In fact, he has to assume Bernard was told 15, 16 or 17. I don't see how knowing Bernard wasn't told 19 lets us assume he wasn't told 15/16.

Let's put it the other way around. Suppose Albert is told "May". Then he says to himself "Bernard might have been told 19, so he might know the answer."


Bernard might have been told 19. But he might have been told 15.


Oh! I get it now. The key is that Albert knows that Bernard doesn't know *based* on the month Albert is given.
 
Paul Clapham
Marshal
Posts: 25669
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's right. We assume Albert was told May, and that leads to a contradiction between what he knows (based on May) and what he actually says. The contradiction means that the assumption was wrong (yeah, I'm a math person) and therefore Albert wasn't told May. (Same reasoning tells us he wasn't told June either.)
 
Sheriff
Posts: 15733
264
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was just on G+ trying to figure out this puzzle, too. It took me a while but I get it now. The logic in the writeup that Jeanne cited is correct.
 
Ranch Hand
Posts: 373
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Albert knows that Bernard dont know the birthday ,(Albert has been told that month which has date which has occured more then once in the list of 10)

Now Bernard understood it,and he got to know (it cant be may or june as both have date which occured only once in list of 10)
After this calculation he got the answer means he has bern told a date which occured once in july or aug
 
For my next trick, I'll need the help of a tiny ad ...
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic