Biostatistics 2017


Grader: Yingxin Cao <>

Office hours every Tuesday 1pm to 4pm on the forth floor where the open space is. 

Recommend Text Books:

Statistics for Engineers and Scientists (2nd edition)
William Navidi MGraw Hill

Purchase second-hand at sites such as Amazon, abebooks and alibris

OpenIntro Statistics 3rd Edition, Deiz et al



z-table (Standard Normal Cumulative Probability Table DOWNLOAD


Python Information:

As part of the biostatistics class, you will be using Python (at a basic level) to do some assignments. One of the things I hope to do on Thursday is to introduce Python and make sure you have Python set up on whatever computer you have (even the humble iphone)

For Windows and Mac (and probably linux) you can use either:




or our own distribution (Get the IDE version, if you happened to like notebooks, get the notebook version, the notebook version works well on Linux)


What is common with all of them is they use a front-end called Spyder which givens the development environment a Matlab like look.

For the iPad and in theory the iPhone, you can install (costs you $10, there are also free ones but I don’t know if they have all the bits)

Pythonista 3:

If you’re using an Android device you can try:

but I don’t know how good it is, I think it has all the plotting bits we’ll need.

Finally, you’ll see references to Python 2.7 or Python 3.5, doesn’t matter really which one you use but Python 3.5 is the most modern.

Week 1:

Introduction to Python and plotting

Here is zip file that contains all the Python examples

Assignment (Due the following Thursday, 5th October)

  1. Write a small python script that  plots the running average of uniformly generated random numbers. Show that as
    the number of averaged random numbers increases, the mean tends to a value of 0.5. Details of how to compute a running average can be found at the Wikipedia page: On the page find the section “Cumulative Running Average”, the second equation can be used to compute the moving average.Provide a commented script as well as the results of your runs.
  2. Studying the sample variance.a) Create a population of random uniform numbers between 0 and 1, a hundred numbers will be sufficient.
    b) Compute the population mean and variance.
    c) Sample 10 randomly chosen numbers from this population. Compute the mean and variance of the sample using the (1/n-1) correction for the variance
    d) Do c) n times and average the sample mean and variance.
    e) Compute the relative error between the averaged sample mean and variance and the population mean and variance
    f) Sample 10 randomly chosen numbers from the population. Compute the mean and variance of the sample using the equations for computing the population means and variance, ie use n in the denominator of the variance equation rather than n-1.
    g) Do f) n times and average the sample mean and variance
    h) Compute the relative error between the averaged sample mean and variance and the population mean and varianceIn the section d) and g), vary n from 100 to 1000,000 and plot the relative error as a function of n
    i) Finally, write your own function to compute the variance but make sure you use the population mean rather than the sample mean to compute the variance. Does this make any difference to the relative error? What do you conclude from these studies? What issue is the n-1 correction (also know as Bessel’s correction) fixing?

Requirements for assignment:

1. Correct program, no matter how it is written

I don’t care if it’s the simplest way, what’s more important is that
the logic it uses is clear.

2. Good commenting
3. Examples of output to show the program works as expected
4. Brief introduction to the problem (i.e. I don’t just want a Python
listing, needs an intro), the intro doesn’t have to be long, just long
enough to explain the problem at hand. In question two, it asks:

What do you conclude from these studies?
What is issue is the n-1 correction (also know as Bessel’s
correction) fixing?

Answer these after you’ve presented the introduction.

Week 2:


Reading Material. For those who want a gentler start, read Diez first.

Diez Chapter 2: sections, 2.1 (Intro), 2.4 (Random Variables)

Navidi Chapter 2: sections, 2.1 (Intro), 2.2 (Counting methods), 2.4 (Random Variables), 2.5 (Linear Functions of Random Variables)

 Introduction to Probability Slides

Assignment 1

Week 3:

Random Variables and Intro to Probability Distributions

Linear Combinations

Counting Rules

Assignment 2

Week 4:

Discontinuous Distributions

Continuous Distributions