The riddle “My oldest plays the piano!” is one example of what we call a metapuzzle: a riddle with a solution that can only be reached after realizing that this solution is implicitly stated in the body of the riddle. Smullyan describes it better:
It is the kind of puzzle in which you are not given complete information but can solve the puzzle only on the basis of knowing that someone who had more information was or was not able to solve it.
In the example presented in “My oldest plays the piano!”, one can only arrive to the final conclusion after realizing that Ernie and Bernie had some extra information that we (as problem solvers) do not have a priori. We do not even need to use that extra piece of information, but its mere existence is enough to help us reach the solution. Smullyan presents many examples of this kind of riddle in his books. Let me give you a few examples:
There is a small island in the Mediterranean with two kinds of inhabitants: sinceros and mentirosos. A sincero (worshiper of the god Verdad) is a person that always tells the truth, while a mentiroso (worshipper of the god Mentira) always lies. It was suspected that there was a traitor in the island, but it was not known whether he was a sincero or a mentiroso. The two main suspects—which we will refer as suspect-number-one, and suspect-number-two—were brought before the magistrate. This is what happened at the trial:
MAGISTRATE (to suspect-number-one): Are you the traitor?
SUSPECT-NUMBER-ONE: No, I am not.
MAGISTRATE (to suspect-number-two): Do you both worship the same god?
The second suspect answered (either yes or no), and the magistrate proceeded to convict one of them. Which one did he convict (and why)?
The trick in this problem resides in one key fact: After the magistrate has the answers to his two questions, he can convict one of the suspects. Since only one of the suspects has answered directly to the question “Are you a traitor?”, it can only be this person. This implies that whatever answer gives the second suspect, it needs to incriminate the first.
It looks complicated at first, but with the aid of a diagram (or a truth table) the reader should have no trouble arriving to the right solution:
As it can be readily seen, no matter the religion of the second suspect, a negative answer forces the statement of the first suspect to uncover himself as the traitor. On the other hand, a positive answer leaves no direct incrimination from any of the suspects, and therefore the magistrate cannot convict anybody.
We can actually go a little further: notice that, if the second suspect is a mentiroso, his negative answer to the magistrate’s question forces him to willingly admit that he is indeed a mentiroso! This would of course violate the premise that mentirosos always lie. As it turns out, the second suspect can be nothing else that a sincero.