A mathematician analyzed 150 years of women’s fashion to understand 20-year trend cycles, and how “optimal distinctiveness” dives change.