Skip to content
Advertisement

Tag: probability-density

How to generate random numbers with predefined probability distribution?

I would like to implement a function in python (using numpy) that takes a mathematical function (for ex. p(x) = e^(-x) like below) as input and generates random numbers, that are distributed according to that mathematical-function’s probability distribution. And I need to plot them, so we can see the distribution. I need actually exactly a random number generator function for

Advertisement