Jump to content

Cheryl's birthday: Difference between revisions

m
added whitespace to the task's preamble, changed order of related task and references, corrected a misspelling.
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 10ten possible dates:
May 15, May 16, May 19
 
May 15, MayJune 1617, June May 1918
June 17 July 14, JuneJuly 1816
July August 14, August 15, JulyAugust 1617
August 14, August 15, August 17
 
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.
Write a computer program in your language to deduce, by successive elimination, Cheryl's birthday.
 
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.
;Referrences
* [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>
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.