Marginal Revolution commented on the following paper, Engineers of Jihad and I added my two cents in the comments but I wanted to clear my mind on what my implicit assumptions had been when I commented.
1. In developing (and Islamic) countries, the numbers of slots for various fields (i.e. engineers, lawyers, etc.) are fixed.
2. Men are more likely to become engineers/scientists/doctors because of cultural preferences.
3. There are more slots in social sciences than there are in sciences and more slots in engineering than medicine. (Medicine is harder to teach than engineering, for instance).
I'm basing all this on my experience in Malaysia about 20 years ago. At the end of the A-levels (more accurately, it was called the STPM at the time) we apply for a field of study in university. We take our performance on the A-levels as given and decide if these are good enough to get us into our chosen fields. If our grades aren't good enough for medicine (which is usually the hardest to get into) then we would pick something else and in a lot of cases if we wanted to get into sciences then engineering would be the likely default (as one other person commented on Marginal Revolution). We would list our three choices and then at some point in the future we would receive a letter telling us if we had been accepted and if not then we could be admitted into something else that was leftover.
Moreover, the government also sponsors many students to go abroad to study engineering. This is in part due to its policy of supporting the development of science and technology in the country. However, upon their return from abroad, many of them are unable to find jobs even though the government is supposed to place them. Someone I knew spent a year being unemployed as a petroleum engineer until he was finally accepted at Petronas.
In any case, it's easy to generate any result we want with these assumptions and I made one up. I assumed the probability of being a terrorist is 0.1. The probability of being male and applying and being an engineer/doctor/lawyer is 0.8 while for an economist is 0.5 and social science is 0.3. This gives an expected number of terrorists of 220 with 36% of the terrorists being engineers.