# Your Stanford email address: ____@stanford.edu

"""
Starter code for Problem Set 3
for David Varodayan's Winter 2020
offering of CS109. Assembled by TA
Anand Shankar.
"""


# Do not add import statements.
# Do not remove this import statement either.
from numpy.random import rand

# part (a) - completed for you
def simulate_bernoulli(p=0.4):
    if rand() < p:
        return 1
    return 0


# part (b)
def simulate_binomial(n=20, p=0.4):
    pass  # TODO: delete this line and implement this function!


# part (c)
def simulate_geometric(p=0.03):
    pass  # TODO: delete this line and implement this function!


# part (d)
def simulate_neg_binomial(r=5, p=0.03):
    pass  # TODO: delete this line and implement this function!


# Note for parts (e) and (f):
# Since `lambda` is a reserved word in Python, we've used
# the variable name `lamb` instead. Do NOT use the word
# `lambda` in your code. It won't do what you want!


# part (e)
def simulate_poisson(lamb=3.1):
    pass  # TODO: delete this line and implement this function!


# part (f)
def simulate_exponential(lamb=3.1):
    pass  # TODO: delete this line and implement this function!
