Last October, Brynn Berkowitz’s fifth grade extra-credit math assignment involved graphing her large Halloween candy haul.