It has been a year since this code was posted and the user has deleted their account, but for the benefit of anyone else reading for the first time, I would like to point out that the case for breed == 3 (two girls) is unhandled; because the default answer := 0 this means that in the case of two girls, the mathematician is modeled as saying “at least one is a boy”. Incorrect code gives the incorrect result.
It has been a year since this code was posted and the user has deleted their account, but for the benefit of anyone else reading for the first time, I would like to point out that the case for
breed == 3
(two girls) is unhandled; because the defaultanswer := 0
this means that in the case of two girls, the mathematician is modeled as saying “at least one is a boy”. Incorrect code gives the incorrect result.