Although untrained, his inheritance from his grandfather, the Duke of Devonshire, enabled him to live as a recluse and study science. In his experiments with gases (1766), he correctly distinguished between hydrogen and carbon dioxide, and in 1781 synthesized water by exploding hydrogen in oxygen. He also constructed a torsion balance in 1798, with which he measured the mean density (and hence mass) of the earth. Many discoveries that Cavendish made in chemistry and physics were not published, with the result that they were rediscovered by others. The Cavendish Laboratory in Cambridge is named after him.