A different version of a classic exercise in logic. Another, more difficult version of this well-known brain teaser goes like this: "Two guards are standing in front of two doors, identical except one door has #1 on it, the other #2. One leads to Heaven and the other to Hell, the guards know which is which, but you don't. One guard always lies, and the other always tells the truth, but you don't know which does what. You can only ask one of them one question in order to find out which door leads to Heaven - and the guards have no knowledge of the world around them, except which door leads to heaven and which leads to hell, and whether the other guard lies or tells the truth. So the guards can't answer any questions like 'How many heads do you have?' or the like, although, in this scenario, those questions would be useless anyway because you don't know which door the liar and truth-teller is guarding. So what question would you ask?"
The answer is: "What would the other guard say if I asked him which door leads to Heaven--door #1 or door #2?."
Assuming door # 2 leads to Heaven, if you ask the liar, he will say "the other guard will say door #1". If you ask the truthful guard, who knows the other guard always lies, he will say "the other guard will say door #1". You then know, through logical deduction, that door #2 actually leads to Heaven. It makes no difference which doors the liar and the truth-teller are guarding. It works the same either way. The important element is that the guards are talking about the nature of the doors themselves, not the nature of the doors they're guarding.
But Ricky stipulates at the start that the liar is guarding the door to Hell, and the truth-teller guards the door to Heaven. The way Ricky frames the "right" question - "What would the other guard say if I asked him which door he was guarding?" - would result in one guard answering "Hell", and the other "Heaven"-- the liar standing in front of the door to Hell would lie and say "the other guard would say he is guarding the door to Hell', while the truthful guard in front of the door to Heaven, knowing the other would lie, would tell the truth and say "the other guard would say he is guarding the door to Heaven". You would then logically assume that the guard who said "The other guard would say "Heaven" was standing in front of the door to Heaven, and the one who said "The other guard would say "Hell" is actually guarding Hell.
But I don't think any of them, including Ricky, realize that a much simpler way to solve Ricky's version of the puzzle is to ask either of the guards if they're standing on their heads.