Consider there are two tribes living on the Island: Knights and knaves. Knights always tell truth while Knaves always tell lie. Let we encounter two random people A and B, upon asking a question to ‘A’, A says “If B is Knight then I am a Knave”. What can we conclude about person A and B?
(A) A is a knight and B is a knave
(B) A is knave and B is knight
(C) Both A and B are Knight
(D) Both A and B are knave
My Analysis is
The given implication is
if B is a Knight then I am a Knave be denoted as
p: B is a knight
q: I am a knave (Means A is a knave)
$p\rightarrow q$ is our given implication
(A) A is a knight and B is a knave If A is knight, then we can take the given implication as said by A in it's original form since Knights always tell truth but then if B is a knave, then the antecedent of the implication becomes false,there making the implication true so A can be a knave or knight both.
(B) A is knave and B is Knight
If A is knave, then whatever A said need to be complement to get original result since knaves always lie. So complement of $p\rightarrow q$ is $p \land \sim q$ which is false as A is knave which makes $\sim q$ false. So this cannot be our answer.
(C)Both A and B are knight-This will make our implication false. So ruled out.
(D)Both A and B are knave.
So we again need to reverse statement of A and it is $p \land \sim q$
but since B is knight, $p \land \sim q$ becomes false.
So only possible answer is (A).
Is my analysis correct with the answer?
Instead of using $p$ and $q$, I recommend using:
$A$: '$A$ is a knight'
$B$: '$B$ is a knight'
This way, you have more meaningful letters, and you have that $A$ is true if and only if $A$ is a truth-teller ... which (unlike your use of $p$ for '$B$ is a knight' and $q$ for '$A$ is a knave') is consistent in its usage between $A$ and $B$, and also uses the 'positive' $A$ for the 'positive' claim that $A$ is a knight/truth-teller.
In fact, given that $A$ is a knight if and only if what $A$ is saying is true, we can symbolize the given information as:
$$A \leftrightarrow (B \rightarrow \neg A)$$
OK, and now we can do some algebra to find out answer:
$$A \leftrightarrow (B \rightarrow \neg A) \overset{Equivalence}\Leftrightarrow$$
$$A \rightarrow (B \rightarrow \neg A) \land (B \rightarrow \neg A) \rightarrow A \overset{Implication}\Leftrightarrow$$
$$(\neg A \lor (\neg B \lor \neg A)) \land (\neg (\neg B \lor \neg A) \lor A) \overset{Idempotence, DeMorgan}\Leftrightarrow$$
$$(\neg A \lor \neg B) \land ((B \land A) \lor A) \overset{Absorption}\Leftrightarrow$$
$$(\neg A \lor \neg B) \land A \overset{Reduction}\Leftrightarrow$$
$$\neg B \land A$$
And there you have it: $A$ is a knight, and $B$ is a knave.
But yes, your analysis was correct as well, and took a kind of 'exhausting all possibilities' approach, which is what truth-tables do. In fact, there are two ways to use a truth-table here:
First: let's just evaluate $A$'s claim:
\begin{array}{cc|c} A&B&B \rightarrow \neg A\\ \hline T&T&F\\ T&F&T\\ F&T&T\\ F&F&T\\ \end{array}
For this table, we are ghoing to find the row where the truth-value of $A$ ('$A$ is a truth-teller?') matches up with the value of $B \rightarrow \neg A$ ('what $A$ is saying is true'). We see that this is only in row 2, and so there is our answer: $A$ is a knight, and $B$ is a knave
A second possibility is to take that whole statement $A \leftrightarrow (B \rightarrow \neg A)$, and see where it is true:
\begin{array}{cc|c} A&B&A \leftrightarrow (B \rightarrow \neg A)\\ \hline T&T&F\\ T&F&T\\ F&T&F\\ F&F&F\\ \end{array}
And again, we find the only row where this is the case is row 2: $A$ is a knight, and $B$ is a knave