Good girls and bad boys (12)

Logic Level 3

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.


The answer is 11011.

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.

2 solutions

Noel Lo
Feb 1, 2016

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.

This is a good question indeed. I guessed this question may be a test on number 1 since it is neither prime nor composite and got it correct.

ASHWIN K - 5 years, 4 months ago

Log in to reply

Haha thanks! Yeah great minds think alike! My intention was to test you guys on the number one!

Noel Lo - 5 years, 4 months ago
Saya Suka
Feb 20, 2021

When the middle one says, "The oldest child is a boy", their (gender neutral, singular they) statement isn't just an accusation towards the oldest child for being a boy and thus, a liar, but is also serves as a contradiction towards the youngest's "We are all girls here". Since we can always find a boy between an accuser (middle child) and the accused (oldest kid), then the youngest must be a boy, while the middle one a girl and the oldest a big brother.

The lying big brother said that the number of girls is a prime number, so we know that it cannot be 2 or 3 or 5. Since we already identified 2 of them as boys and 1 a girl, the possible numbers of girls are 1 or 2 or 3, but we already eliminated both 2 & 3, so that middle child is the only daughter and sister in their family.

Answer = { B, B, G, B, B }
= 11011

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...