According to how this is worded the prisoners can just simply take off the hat and look to see what color he/she has!Otherwise, there is no way to logically figure it out!