Why are there so few women in highly paid careers as chief executives and, more generally, in finance, business, science, technology, engineering and mathematics? Analysing Danish data on young people whose educational and professional lives have been tracked over two decades since they started high school, this research suggests that part of the reason lies in restrictive bundling of courses, which deters talented young women from acquiring advanced mathematical skills. Changing the learning environment and designing the curriculum to identify and foster young women with high mathematical abilities would attract more of them and help to reduce the gender pay gap.