A study has found the exact age of girls when they begin becoming interested in STEM subjects and when they start losing interest.