Maxwell's Demon is a thought experiment created by the physicist James Clerk Maxwell in 1867 in which he suggested how the second law of thermodynamics might hypothetically be violated. In the thought experiment, a demon controls a small door between two chambers of gas. As individual gas molecules approach the door, the demon quickly opens and shuts the door so that only fast molecules are passed into one of the chambers, while only slow molecules are passed into the other. Because faster molecules are hotter, the demon's behaviour causes one chamber to warm up and the other to cool down, thereby decreasing entropy and violating the second law of thermodynamics.