Let's reason through this problem together:
- We know that the product of the ages is 36. So, the possible age sets are (1,1,36), (1,2,18), (1,3,12), (1,4,9), (1,6,6), (2,2,9), and (2,3,6).
- The second man initially says he doesn't have enough information, which means that there must be more than one valid age set with a product of 36.
- After the first man reveals the sum of their ages, the second man still can't determine the ages. This implies that there's more than one age set with the same product (36) and the same sum. Looking at our list, we see that both (1,6,6) and (2,2,9) share the same sum of 13. However, none of the other age sets share a sum.
- Since the second man still couldn't determine the ages after learning the sum, the sum of the ages must be equal to the number on the bus for both the (1,6,6) and (2,2,9) sets.
- When the first man reveals that his eldest child's name is Peter, the second man can finally determine the ages. This means that in the correct age set, Peter must be the eldest child.
- In the (1,6,6) set, the eldest child is 6, and in the (2,2,9) set, the eldest child is 9. Since Peter is the eldest, the (2,2,9) set cannot be the correct one because Peter wouldn't have been born yet in a two-year interval.
- Therefore, the correct ages for the children must be 1, 6, and 6. So, X=1, Y=6, and Z=6.
However, there's a problem with this reasoning: we don't know if the number on the bus is 13 or not. It's true that the story implies it is, but it's not explicitly stated. The problem would be better if it mentioned that the second man knew the number on the bus was 13 before the first man revealed his eldest child's name. With this additional information, the ages would indeed be 1, 6, and 6.
Without that explicit information, though, we can't be 100% certain that the ages are 1, 6, and 6, since the number on the bus might not be 13. It's an important lesson in making sure all necessary information is provided when creating logic puzzles.