推理
第一句话确定:July 14 July 16 August 14 August 15 August 17(告诉B日期不可能为18,19,==>告诉A的月份不可能为May,June)
第二句话确定:July 16 August 15 August 17(日期14有两个,B不可能确定,排除)
第三句话确定:July 16(月份August有两个,A不能确定,推出July16)
###Khanacademy
Python
1 | #!/usr/bin/env python |
Mathematica(1)
1 | (* |
Mathematica(2)
1 | cand = {{"May", 15}, {"May", 16}, {"May", 19}, {"June", 17}, {"June", |
cand
is candidate birthdaysc1
toc3
are the clues from the three statements:(i) rule out months that have unique day (ii) rule out birthdays without unique days (iii) find remaining birthday which has unique month the rest is for “prettiness”