thinkstats.code example from thinkstats