Skip to content

Latest commit

 

History

History
17 lines (16 loc) · 448 Bytes

4-2-random_dist.md

File metadata and controls

17 lines (16 loc) · 448 Bytes

Think Stats Chapter 4 Exercise 2 (a random distribution)

import random import thinkstats2 import thinkplot sample=[] for i in range(1000): sample.append(random.random())
pmf=thinkstats2.Pmf(sample) cdf=thinkstats2.Cdf(sample) thinkplot.Pmf(pmf) thinkplot.show() thinkplot.Cdf(cdf) thinkplot.show()

The distribution is close to uniform but not perfect.