Earlier quoted context omitted.
Which part is the trick? It all seems very straightforward to me.
Its understanding what the question actually means when it says things like 'Bernard: At first I don't know when Cheryl's birthday is, but I know now.' ... this is actually a cryptic coding of the rules of the puzzle. If you properly understand those rules and convert them to code (as in the OP) then searching the possible answers for a match is trivial.
When Is Cheryl's Birthday?
81–90 of 136 posts
Re: When Is Cheryl's Birthday?
#82Earlier quoted context omitted.
can you make your whole comment more explicit, I don't follow your objection.
Let's consider the question: 1. "Why did Albert speak first?" Before we answer this, we need to develop a set of assumptions to operate under. Given the synthetic nature of the problem, we might assume that both Albert and Bernard are of equal ability, and able to make logical inferences based on reasonable assumptions. We'll also assume that both Albert and Bernard are only going to announce the binary state of each…
The speed at which they come to their conclusions, and who speaks first is meaningless. I think perhaps if you are taking them into account then you are trying to come up with a completely different problem, or intentionally being disingenuous.
Given the context (that this is a question on a high school test), it is safe to assume that Albert and Bernard are only drawing logical conclusions from the information Cheryl provides and what each other say.
Given that the problem works with no problems under these assumptions, and that there is enough information to re-word it with Bernard speaking first that does not change the answer, it seems pointless to try and look for timing attacks or other outlandish ways to change the answer...
Re: When Is Cheryl's Birthday?
#83The problem with this problem, the way it was originally put, was the utterly confusing English masked into a logic problem. Write your specifications clearly, and then it does not become an internationally shared 'problem' to solve. [I work with insanely documented specifications just like this, year after year. Not putting a problem clearly is not something to aspire to.]
Why do you think that confusion over the English description is more to blame than the difficulties many people face with logic puzzles?
Heck, it's not even clear that Albert and Bernard are communicating with one another and not merely with the answerer. If you assume they do not communicate at all then the puzzle becomes impossible.
Re: When Is Cheryl's Birthday?
#84Earlier quoted context omitted.
Trust me, its cryptic to most people, and that's why this puzzle has gone viral round the world in an omg-singapore-schoolkids-can-do-this-insane-puzzle kind of way.
Why do you suspect the crypticness of the puzzle's language is the problem, rather than the fact that a large portion of people haven't studied basic logic and are thus unable to complete basic logic puzzles?
Incidentally, I get a similar feeling from these puzzles that I get from code questions or examples where every variable or function is named 'a' or 'b' or 'foo' or 'bar'.
(aaand I just had a mini-epiphany of sorts that when I see those types of programming puzzles I should probably write them out and substitute the variable names as I go....)
Re: When Is Cheryl's Birthday?
#85Could one use Julia instead of Python? "iPython" already supports Haskell and Julia kernels too. A iPython Javascript kernel would also make sense given its popularity and its functional inspired syntax.
Re: When Is Cheryl's Birthday?
#86Maybe I'm missing something, but the "hard" part of this problem is figuring on the trick. Once you know that, it becomes relatively easy – and you can't use a program to figure out the trick.
I don't know, can code like this reason about knowledge-about-knowledge in general? For example, can a version of the code be used to solve the 'hardest puzzle' - https://xkcd.com/blue_eyes.html (solution: https://xkcd.com/solution.html ) ?
If you know someone else doesn't know, that just gives you more knowledge you yourself can use.
For the "hardest puzzle", on each day everyone learns that no one was able to figure out the solution the day before. Because of this, a person knows that for a possible number of blue-eyed people to be valid, a person who sees one less blue eyed person than that, must have been unable to figure it out on the previous day.
An Arc/Common Lisp solution I just wrote up: https://gist.github.com/malisper/80625bcda75c66780f81
Re: When Is Cheryl's Birthday?
#87Earlier quoted context omitted.
I don't know, can code like this reason about knowledge-about-knowledge in general? For example, can a version of the code be used to solve the 'hardest puzzle' - https://xkcd.com/blue_eyes.html (solution: https://xkcd.com/solution.html ) ?
I find the problems with puzzles like these is not the rules, but the ridiculously contrived situations. Why do these entities that function like inert logic gates have to be human? It means that the question has to have silly rule placed on silly rule in order to keep the contrived situation afloat. It means I end up thinking of ways for the mute, inert people to free themselves from the island (who is feeding them?…
I get your point. Still, it's hard to define the puzzle in terms of not-people. Maybe you could call them intelligent robots -- people might find it easier to picture mute robots with hats.
Re: When Is Cheryl's Birthday?
#88Re: When Is Cheryl's Birthday?
#89Couldn't resist. This is the solution ported to C#: https://github.com/kyberias/cherylsharp
Re: When Is Cheryl's Birthday?
#90This is quite disturbing for me. My Aunt's name is Cheryl. Her husband, Bernard. Guess his brother's name!