Question 117
each of 1000 dwarves wears a hat, it inside surface being red (or Vice Versa). A dwarf tells only the truth if he wears a blue hat; On the other hand, he only lies if he wears a red hat (a dwarf can turn his hat inside out); turning*). One day, each dwarf table to each other: "Your hat is red!" find the least possible number of turning this day. Each of the 1000 gnomes has a cap, blue outside and red on the inside (or vice versa). If a gnome wears a red cap, then he can only lie, and if blue, only tell the truth. For one day, each dwarf said to each “you have a red cap!” (At the same time, some dwarves turned their cap inside out during the day). Find the smallest possible number of twists.