In the late 19th century, when Sherlock Holmes was created, there was widespread scientific interest in the workings of the mind, particularly the thin line between genius and madness.