Foundation by Isaac Asimov
"Hari Seldon, the greatest scholar of the Galactic Empire, creates the science of "PsychoHistory" to predict the future by mathematically modelling the behavior of the galactic society. He forsees the fall of the Galactic empire into "barbarity" for tens of thousands of years. To prevent this, he sets up a "Foundation" at the fringe of the galaxy. Their mission - though the settlers don't realize it at the time - is to be the foundation for a new and more stable Galactic society and government."