Homework #3
ASTR 3800
Due February 2, 2016

1. Download the python modules from ThinkStats. As a test that you can run somebody else's modules and packages, run the code of chap06soln.py.  Take the  part of the main that reads:
sample = np.power(10, log_sample)

mean, median = density.Summarize(sample)


cdf = thinkstats2.Cdf(sample)

print('cdf[mean]', cdf[mean])


pdf = thinkstats2.EstimatedPdf(sample)

thinkplot.Pdf(pdf)

thinkplot.Show(xlabel='household income',

ylabel='PDF')

and  comment it out.

If you get a blank plot, like I did in Canopy, edit the hinkplot.py module.  Go to line 627&628 and comment out

the Clf lines as shown below.

 def Show(**options):

"""Shows the plot.


For options, see Config.


options: keyword args used to invoke various pyplot functions

"""

clf = options.pop('clf', True)

Config(**options)

# if clf:

# Clf()

pyplot.show(options)


Print out your plot and turn it in.


2.  Make a plot of a normalized Gaussian distribution.  Center it at 100 and give it a 15 point standard deviation as for IQ.
Sum up the bins.  How many bins does it take to get the total to be within 10^-6 of unity?

Use your python code to integrate between values.
What IQ has a probability of 10billion to one of being above?  (That's the smartest person in history.)
What is the probability of having an IQ below zero?  (yes, yes, I know its zero.  But mathematically it's not.)