Cheryl's birthday: Difference between revisions
Content added Content deleted
m (added whitespace to the task's preamble, changed order of related task and references, corrected a misspelling.) |
|||
Line 3:
Albert and Bernard just became friends with Cheryl, and they want to know when her birthday is.
Cheryl gave them a list of
May 15, May 16, May 19
Cheryl then tells Albert and Bernard separately the month and the day of the birthday respectively.
1) Albert: I don't know when Cheryl's birthday is, but I know that Bernard does not know too.▼
2) Bernard: At first I don't know when Cheryl's birthday is, but I know now.▼
3) Albert: Then I also know when Cheryl's birthday is.▼
▲1) Albert: I don't know when Cheryl's birthday is, but I know that Bernard does not know too.
;Task▼
▲2) Bernard: At first I don't know when Cheryl's birthday is, but I know now.
▲3) Albert: Then I also know when Cheryl's birthday is.
;Related task:▼
* [[Sum and Product Puzzle]]▼
▲;Task
;References
▲Write a program in your language to deduce, by successive elimination, Cheryl's birthday.
* [https://en.wikipedia.org/wiki/Cheryl%27s_Birthday Wikipedia article] of the same name.
* [https://en.wikipedia.org/wiki/Tuple_relational_calculus, Tuple Relational Calculus]
▲;Related task:
▲* [[Sum and Product Puzzle]]
<br><br>
|