Elon Musk in 2008 with a diagram of the Tesla Roadster in the background

Before Elon Musk began launching rockets into space or boring holes underneath Los Angeles to build high-speed trains, he was a kid with an insatiable appetite for books. At around age nine, when he ran out of titles to read at his school's library, he pored through the entire Encyclopedia Britannica, according to Bloomberg. That's around 32,000 pages. Perhaps it's no surprise then that the SpaceX and Tesla CEO has read countless textbooks on rocket science and physics over his career. In fact, it's reported that his self-teaching method taught him about space exploration. Maybe more unexpected? Fiction also plays a significant role in Musk's life. Here are the two novels that shaped the billionaire tech leader.

"Lord of the Flies" by William Golding

Golding's classic novel on survival and competition left its mark on Musk. The interplay between two of the book's main characters likely shaped his life's mission: to save mankind.

"The heroes of the books I read ... always felt a duty to save the world," he tells The New Yorker. Ralph, one of the English boys on the remote island where "Lord of the Flies" takes place, wants to create moral and ethical codes to save humanity. Meanwhile the book's antagonist, Jack, initially just rebellious, finds himself consumed by power and greed. Their struggle is a cautionary tale about what can happen when men are left to their own devices. The book shaped Musk's worldview on his own future. For instance, he has publicly spoken about the dangers of artificial intelligence in the hands of humans. In an open letter, he's writes that people should "be worried."

"Foundation" by Isaac Asimov

The first of Asimov's science fiction trilogy, "Foundation" explores humanity at a crossroads. In the story, one man tries to save the world from a fast-approaching descent into ignorance and warfare by creating an alternate empire. The universe he creates, called "Foundation," is a place where science, technology and the arts provide refuge to people. But only if the protagonist can successfully protect it. Asimov's books taught Musk that "civilizations move in cycles," according to a 2013 interview with The Guardian. That lesson encouraged the entrepreneur to pursue his radical ambitions.