On an island, there is this strange pattern - boys always lie while girls always tell the truth. Now you encounter five children.
•The oldest one says, "The number of girls among us is a prime number."
•The second one says, "The number of girls among us is a composite number."
•The middle one says, "The oldest child is a boy."
•The fourth one says, "The second child is a girl."
•The youngest one says, "We are all girls."
Let 1 denote boys and 0 girls. In order of birth, identify the gender of each child and convert it into a number accordingly. Submit your answer as a string of 5 ones and/or zeroes. For example, if all five are boys, then your answer is 11111.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Suppose the youngest one is a girl. Then it is indeed true that all are girls. But we run into a couple of issues, for example the middle one, who is a girl, will be correct in saying that the oldest child is a boy but we know the oldest is also a girl since all are girls. So the youngest one must be a boy. This means it is untrue that all are girls which means there is at least one boy. This is definitely a possible scenario as the youngest child is already assumed to be a boy.
Suppose the second child is a girl. Then it is true that the number of girls is composite. The only possible number for this is 4. This means the youngest child must be the only boy. Again, the middle child, who is definitely a girl in this case, would be correct in saying that the oldest child is a boy. But this is impossible as the youngest child is the only boy so the oldest child is also a girl. Hence the second child must be a boy too. This means the number of girls is non-composite. We also gather that the fourth child must be a boy since his statement that the second child is a girl is a lie.
So far we have determined that the second, fourth and fifth child are all boys.
Suppose the oldest child is a girl. Then it is true that the number of girls is prime. The only possible number of girls would be 2 (not 3 as we already have 3 boys). This is only possible if the middle child is also a girl. However, the middle child would be incorrect in saying the oldest child is a boy. This means the middle child must be a boy as only boys lie. We have a contradiction. Hence the oldest child must be a boy. This means the number of girls is non-prime.
The middle child would be correct in saying that the oldest child is a boy. So she must be a girl. She is the only girl and this puts the number of girls at 1, which is neither prime nor composite. This tallies with our deduction that her two older siblings are both boys. This is the only workable case.
So we have boy, boy, girl, boy, boy. The middle child is the only girl with two older brothers and two younger brothers. Our answer is 11011.