Edgar Allan Poe may be known for his tales of the supernatural, but he had a remarkably analytical, even mathematical mind. He was extremely wary of romantic ideas of literary inspiration, claiming that, in writing “The Raven”, the work “proceeded, step by step, to its completion with the precision and rigid consequence of a mathematical problem.” And he had no love at all for his more romantically minded colleagues. He thought Emerson “over-rated” and once insulted the poets Cornelius Mathews and William Ellery Channing with an algebraic pun: if Mathews was “ex ecrable,” he said, Channing was “x plus 1-ecrable”.
Even a story as fanciful as “The Gold-Bug” originated in Poe’s obsession with logic. The plot is far-fetched: William Legrand, who has lost his family fortune, one day notices a golden beetle on the beach at Sullivan’s Island. He has his servant, Jupiter, wrap the bug up in a piece of parchment, on which he later discovers a coded message written in invisible ink, revealing the spot where Captain Kidd buried his treasure two centuries earlier. Once he has decoded this message, Legrand heads out with Jupiter — and their neighbour, who narrates the tale —to unearth the treasure, whose exact location he determines by ordering Jupiter to drop the bug through the left eye socket of a skull nailed to the end of a tree branch.
At this point the narrator, like the reader, is bewildered — “dying with impatience for a solution of this most extraordinary riddle”. But Legrand does not waste anyone’s time. He promptly gives a systematic explanation, several pages long, of how he discovered and decoded the secret message.
First, Legrand says, he determined the language of the message (English), before proceeding to ascertain the most and least frequently used characters. Since in English “the letter which most frequently occurs is e,” he substituted the most frequently used character in the coded message (8) with the letter e, then searched for a three-character combination ending in 8 (;48), which he guessed to represent “the” (the most common English word), and so on, until he had completely solved the centuries-old riddle — and become rich to boot.