Ibn Khaldun was born in Tunis, in North Africa, in 1332 AD, not long after the birth of Ibn Battuta. Like Ibn Battuta, Ibn Khaldun was from a rich Muslim family. Ibn Khaldun's family was originally from Spain, but like many others they had fled the Christian reconquest of Spain and moved to Tunis a short while before Ibn Khaldun was born. In Tunis, Ibn Khaldun went to the best schools. He memorized the entire Quran and studied the works of Ibn Rushd (Averroes), al Ghazali, and Ibn Sina (Avicenna). He knew the works of Aristotle and Plato, too. But in 1348, when Ibn Khaldun was only 17, both of his parents and some of his teachers died in the Black Death.
As an adult, Ibn Khaldun had many adventures and traveled all over the place. He made the hajj to Mecca, and also visited Morocco and Spain. Ibn Khaldun lived in Egypt for a long time, where he lost his wife and children in a shipwreck. As a representative of the Egyptian army, Ibn Khaldun met the invader Tamerlane, and got to know all about the Mongols.
When Ibn Khaldun was older, about 1375-1400 AD, he put together all this knowledge to write a History of the World. Ibn Khaldun was the first historian to introduce the ideas of scientific method to history and economics. He used this method to explain the differences in world-view between nomads and farmers. He also pointed out that empires like the Roman Empire or the Abbasid Empire rise and fall in a cycle. Ibn Khaldun also was the first historian to describe business cycles where the growth of the economy feeds more growth. Scholars living in the Ottoman Empire were very much interested in Ibn Khaldun's ideas about the rise and fall of empires, hoping to find practical messages for the Ottoman rulers. Although Ibn Khaldun's work was not well known in Europe until the 1800s, it then became important to the development of modern sociology and historical thinking.