Hello, when I generate my graph for the guassian generator, my output looks incorrect. Any help with what I am doing wrong?
any help would be appreciated?
use this
def binomial_generator(n, p, num_samples):
“”"
Generates an array of binomially distributed random numbers.
Args:
n (int): The number of trials in the binomial distribution.
p (float): The probability of success in each trial.
num_samples (int): The number of samples to generate.
Returns:
array: An array of binomially distributed random numbers.
"""
### START CODE HERE ###
# Generate an array with num_samples elements that distribute uniformally between 0 and 1
u = np.random.uniform(0, 1, num_samples)
# Use the uniform-distributed sample to generate binomial-distributed data
# Hint: You need to sample from the inverse of the CDF of the distribution you are generating
array = inverse_cdf_binomial(u, n, p)
### END CODE HERE ###
return array