This exercise relate to the inhabitants of the island of knights and knaves created by Smullyan, where knights always tell the truth and knaves always lie. You encounter two people, A and B. Determine, if possible, what A and B are if they address you in the way described. If you cannot determine what these two people are, can you draw any conclusions?

A says “The two of us are both knights”, and B says “A is a knave”.

part 2:
A says:if B is a knave, then I am a knight
B says: we are different

Who is who?

If A says we are both knights, then you know that he is lying because both can't be.

In part two which is the only statement that can be true?

If A is a liar, then both are not knights, and A is a knave.
If B is the liar, then A is a knight.

let a be knave, b be knave, A be knight, B Knight.

IF Then
a ab or aB
b Ab
A AB
B aB

Conclusions. cant be Ab, or AB, or aB
Think out why.

Part II
A can be Ab or AB
a can not be Ab
B aB or Ab
b ab

check my thinking.

A is knave

Bis knight

because from second statement it is true that both are different.
if so, the statement by A is lie.
so the one who lie is a knave that means A IS KNAVE. As both can't be same obviously the other is knight means B IS KNIGHT

Your thinking is correct. Let's go through each statement and determine the possible identities of A and B based on their statements:

Statement 1:
A says "The two of us are both knights."
Since A is stating that they are both knights, but we know that only knights tell the truth, A must be a liar (knave).

B says "A is a knave."
If B tells the truth, then A is indeed a knave. But B can also lie. If B is a knave, then A is not a knave (since B's statement would be false), which means A must be a knight. Therefore, B cannot be a liar (knave) because it contradicts A's statement. This implies that B is a knight.

So, based on these statements, we deduce that A is a knave and B is a knight. Therefore, A always lies and B always tells the truth.

Now let's move on to Part II:
A says "If B is a knave, then I am a knight."
If A is a liar (knave), then the statement is false. This means that B cannot be a knave, or else A's statement would be true. So, A must be a knight.

B says "We are different."
If B is a liar (knave), then the statement would be false. But if A is a knight, and A and B are indeed different, then B must be a knight as well. Thus, B's statement is true.

In conclusion, based on the statements in Part II, we can determine that A is a knight and B is a knight.