How physics and mathematics are helping us understand society