MATH 314 Quiz 09

Please submit a Jupyter notebook to the following repository by today at 3.40pm with your solution(s) to problem 1. below. https://classroom.github.com/a/9CpN7kT-

  1. For the family of Binomial distributions, with unspecified K,pK, p, write a Python function that estimates the median for the distribution.
    1. The median is defined as the any number xx that puts (approximately) half the probability to the left of xx and (approximately) half the probability to the right of xx.
    2. In math, we might write x=minssf(s)>=0.5x = \text{min}_s \sum_s f(s) >= 0.5 but techincally the definition is a bit more complex.
    3. Get started with the following Numpy code
      import scipy.stats as sp
      K = 10
      p = 0.5
      B = sp.binom(K, p)
      x = 3
      B.pmf(x)
    4. Binomial distribution
  2. If you finish the above, work on Homework 04.
  3. If you want a challenge, complete 1. above with no for loops.