Islam is meant to be for spiritual well being and attainment. Some may call it closeness to God and others may call it something else. Some, not all, Muslims (actually religious people in general) think that religion has the answer to every question. However, that is not the case. It has answers to most questions, especially, questions related to spiritual well being: This includes social and judicial laws since they are needed for spiritual well being. But it does not have answers for all question and this question is one of them.
Answer to a question such as this will not be found in Quran or Hadith because it is outside the context of what Islam brings to this world. Therefore, for questions such as these, one should not depend on religion (Islam, Christianity, Judaism etc.) but depend on History, Science etc.
There are Muslims who would argue and say that Quran has answers to every question one can possibly have, and I am not disagreeing with them because they would point me to a verse such as this:
If you can pass beyond the zones of the heavens and the Earth, then pass!
which they claim speaks of travelling to space. Now whether they are correct or not is beyond the argument here. What I am trying to say is that sure everything in this world ties to Quran (if you are a Muslim) or Bible (if you are Christian) in some way but it would be foolish if one was to look inside The Holy Quran, or Hadith or The Bible to try and find how binary arithmetic works.
In conclusion, you will have better luck and a more informed answer if you were to ask this question on another site.