67.6k views
3 votes
in this homework you are supposed to use the random number generater random.random sample from the numpy package to generate random numbers with three different distributions. recall from the lecture that if ????:ℝ→[0,1] is a distribution function with generalized inverse ????−1:[0,1]→ℝ and ???? is a uniform random variable, then ????−1(????) is a random variable with distribution function ???? . using the function random.random sample from numpy package write three functions: exponentialrv(seed, mean,n) that returns for given seed a bunch of n random variables from an exponential distribution with the provided mean. derive the generalized inverse distribution function analytically for your simulation. binomial(seed, p,m,n) that returns for given seed a bunch of n binomial distributed random numbers with the provided success probability p and the number of trial equal to m. you have to numerically calculate the inverse distribution function. funnydicerv(seed,n) that returns for given seed a bunch of n random number which describe a biased die with distribution ℙ({1})

User Mwarning
by
4.4k points

1 Answer

4 votes

eeeeeeeeeeee

eeeeeeeeeee

User Aneesh Sivaraman
by
4.2k points