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

There are 2^3 = 8 possibilities of T (truth teller = 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.

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).

lib/DbaDatabase.php:134: Warning: dba_replace() [<a href='function.dba-replace'>function.dba-replace</a>]: You cannot perform a modification to a database without proper access