Ibn al-Haytham (Alhazen) was born c. 965 to a family of Arab or Persian origin in Basra, Iraq, which was at the time part of the Buyid emirate. His initial influences were in the study of religion and service to the community. At the time, society had a number of conflicting views of religion that he ultimately sought to step aside from religion. This led to him delving into the study of mathematics and science. He held a position with the title of vizier in his native Basra, and became famous for his knowledge of applied mathematics, as evidenced by his attempt to regulate the flooding of the Nile.