How to get n unique numbers uniformly from a given range?

I have a integer range [0, Z). I need to obtain n (where n <= Z) random numbers from this range, but they have to be unique. So I know I can just code up rejection sampling to do this, but I’m wondering if there’s a one line python function that can do this for… Read More How to get n unique numbers uniformly from a given range?

Demonstrating the Universality of the Uniform using numpy – an issue with transformation

Recently I wanted to demonstrate generating a continuous random variable using the universality of the Uniform. For that, I wanted to use the combination of numpy and matplotlib. However, the generated random variable seems a little bit off to me – and I don’t know whether it is caused by the way in which NumPy’s… Read More Demonstrating the Universality of the Uniform using numpy – an issue with transformation