import random


def population(distribution, count=2048):
    """
    Creates a list of numerical values (no uncertainty) of the specified
    length that are representative of the distribution for use in less robust
    statistical operations.

    :param distribution:
        The distribution instance on which to create a population

    :param count: The number of numerical values to include in the returned
        population list.
    :type: int

    :return: A list of numerical values that approximate the the measurement
        probability distributions distribution
    :rtype: list
    """

    out = []
    x_min = distribution.minimum_boundary(10)
    x_max = distribution.maximum_boundary(10)

    x = x_min
    delta = (x_max - x_min) / 512.0
    total = float(len(distribution.measurements))

    while x <= x_max:
        n = int(round(count * delta * distribution.probability_at(x)))
        for i in range(n):
            out.append(random.uniform(
                x - 0.5 * delta,
                x + 0.5 * delta
            ))
        if x == x_max:
            break
        x = min(x_max, x + delta)
    return out