Even if there were 3 white and 2 black it wouldnt matter under the assumption that the room is completly dark.when he answers the question. If the hats were white blue purple red and green. the answer would still be black because in total darkness all the hats would be black.. It is only when the light is turned back on when the hats get a different color .If the problem would have waited till after the light was turned on before he answered the question it would eliminate that option though. it only works if he answers while it is still dark.
As i was reading the problem and got to the point where the one man said he knew what color his hat was before the master turned on the lights and was right. Well i stopped there and realized what the right answer was. i was dissappointed that it wasnt the correct solution you choose .although the answer black was correct his reasoning i feel was not. he knew the hat was black BEFORE the lights were on because regaurdless of the color of the hat in the light. in a completely dark room (which is what i gathered from the problem ) everything is black since there is no light to reflect color.