Often when devising laws, physicist test them by performing a number of various experiments. Sometimes scientists prefer to use thought experiments (experiments that are carried out in though alone) to test an idea.
James Clerk Maxwell (a 19th century physicist) came up with a thought experiment which tested the second law of thermodynamics. Maxwell wondered whether if there was any possibility to entropy without doing any work. Maxwell imagined a chamber filled which was full of gas at uniform temperature, which was divided by a barrier containing a door which was able to be opened and closed.
In spite of the fact that the gas is at a uniform temperature, it is known that the temperature actually refers to the average energy of the molecules. Some molecules move faster having more energy, likewise some molecules move slower having less energy. Maxwell proposed a question, what if a demon was guarding the door? Coming to a conclusion that the demon would be able to let high speed molecules in from left to right and block their return. Therefore, the demon could only let slow-moving molecules travel from right to left. In Maxwell’s proposed scenario, the result would be that the system would gradually become unbalanced , having one hot side and one cold side.