# Path: stationary/utils/math_helpers.py
# def normalize(x):
#     s = float(sum(x))
#     for j in range(len(x)):
#         x[j] /= s
#     return x
# 
# def multiply_vectors(a, b):
#     c = []
#     for i in range(len(a)):
#         c.append(a[i]*b[i])
#     return c


from ..utils.math_helpers import normalize, multiply_vectors


# Random-death probability distributions

def moran_death(N):
    def p(pop):
        s = sum(pop)
        if s == N + 1:
            return 1
        return 0

# Path: stationary/utils/math_helpers.py
# def normalize(x):
#     s = float(sum(x))
#     for j in range(len(x)):
#         x[j] /= s
#     return x
# 
# def multiply_vectors(a, b):
#     c = []
#     for i in range(len(a)):
#         c.append(a[i]*b[i])
#     return c


# Path: stationary/processes/variable_population_size.py
from ..utils.math_helpers import normalize, multiply_vectors



# Random-death probability distributions

def moran_death(N):
    def p(pop):
        s = sum(pop)
        if s == N + 1:
            return 1
        return 0

    return p