[Math] Why this question can determine whether he is a knight or knave

discrete mathematicspuzzle

Knight always tell the truth, while knave always lies.
If I ask this question:"If I were to ask you if you always told the truth, would you say that you did?" Why this question can determine whether the one is a liar? Isn't this sentence the same as "Are you a liar?" The response should be "NO" for either a knave or a knight.

Best Answer

The key is to separate what they would do and what they say they would do.

The knight would say "Yes, I always tell the truth." and thus since the knight always tells the truth would say "If you asked, I would say 'yes'." So far so expected.

The knave would say "Yes, I always tell the truth." but since the knave always lies would answer this question: "If you asked this question, I would say 'no'."

The knave has to lie about his lying, and so tells the truth.