<pre>
In the first case, the third statement determines the hat colors to be black, white, white and the tribe of the third native to be Knight.
The fourth statement determines the tribe of the first native to be Knight and the second native to be Knave.

There are 2^3 <code> 8 possibilities of T (truth teller </code> Knight) and F (liar = Knave) and for each possibility there are one or three hat assignments for a total of twenty possibilities.
The possibilities are listed below followed by the first statement that eliminates it and the reasoning.

<pre>
LLL
1.  BBB (1) A liar can only know his hat color at (1) if he sees WW.

LLT
2.  BBW (1) A liar can only know his hat color at (1) if he sees WW.
3.  BWB (1) A liar can only know his hat color at (1) if he sees WW.
4.  BBW (1) A liar can only know his hat color at (1) if he sees WW.

LTL
5.  BBW (1) A liar can only know his hat color at (1) if he sees WW.
6.  BWB (1) A liar can only know his hat color at (1) if he sees WW.
7.  BBW (1) A liar can only know his hat color at (1) if he sees WW.

LTT
8.  BWW (4) A liar knows his color at (4) (8 is the only possibility).
9.  WBW (1) A liar can only know his hat color at (1) if he sees WW.
10. WWB (1) A liar can only know his hat color at (1) if he sees WW.

TLL
11. BBW (3) A liar at (3) seeing BB knows his color (19 is the only possibility).
12. BWB (2) A liar at (2) seeing BB knows his color (12 is the only possibility).
13. WBB (1) A truth teller will know his hat color at (1) if both other hats are B.

TLT
14. BWW
15. WBW (2) A liar at (2) seeing WW knows his color (15 is the only possibility).
16. WWB (2) A liar at (2) seeing WB knows his color (16 is the only possibility).

TTL
17. BWW (3) A liar at (3) seeing BW knows his color (17 is the only possibility).
18. WBW (2) A truth teller at (2) seeing WW cannot tell his color (18 & 20 are possible).
19. WWB (3) A liar at (3) seeing WW knows his color (19 is the only possibility).

TTT
20. WWW (2) A truth teller at (2) seeing WW cannot tell his color (18 & 20 are possible).
</pre>

In the second case, the fifth statement provides no informations.
The colors are white, white, black and the tribes are Knight, Knave, Knight.

<pre>
LLL
1.  BBB (1) A liar can only know his hat color at (1) if he sees WW.

LLT
2.  BBW (1) A liar can only know his hat color at (1) if he sees WW.
3.  BWB (1) A liar can only know his hat color at (1) if he sees WW.
4.  BBW (1) A liar can only know his hat color at (1) if he sees WW.

LTL
5.  BBW (1) A liar can only know his hat color at (1) if he sees WW.
6.  BWB (1) A liar can only know his hat color at (1) if he sees WW.
7.  BBW (1) A liar can only know his hat color at (1) if he sees WW.

LTT
8.  BWW (2) A truth teller at (2) seeing BW knows his hat color (8 & 17 both imply W).
9.  WBW (1) A liar can only know his hat color at (1) if he sees WW.
10. WWB (1) A liar can only know his hat color at (1) if he sees WW.

TLL
11. BBW (2) A liar at (2) seeing BW cannot know his hat color (11 & 14 are possible).
12. BWB (6) A liar at (6) seeing BW knows his hat color (12 is the only possibility).
13. WBB (1) A truth teller will know his hat color at (1) if both other hats are B.

TLT
14. BWW (2) A liar at (2) seeing BW cannot know his hat color (11 & 14 are possible).
15. WBW (3) A truth teller at (3) seeing WB knows his hat color (15 is the only possibility).
16. WWB

TTL
17. BWW (2) A truth teller at (2) seeing BW knows his hat color (8 & 17 both imply W).
18. WBW (4) A truth teller at (4) seeing BW knows his hat color (18 is the only possibility).
19. WWB (2) A truth teller at (2) seeing WB knows his hat color (19 is the only possibility).

TTT
20. WWW (4) A truth teller at (4) seeing WW knows his hat color (20 is the only possibility).
</pre>
</pre>
