# Generating Random Sample

#### sandeep249

##### New Member
I know that SAS can easily generate random samples for know distributions - normal, exponential, uniform. But how can I generate a random sample from a known probability distribution (that is not listed)?

The probability distribution is rather simple: f(x) = 2x^-3

So, how can I generate a random sample of X's that come from this distribution?

#### Mean Joe

##### TS Contributor
This isn't the best way, but I think you can do it by generating uniform random numbers between 0 and 1. Denote these random numbers $$F(x_1), F(x_2), ..., F(x_{1000}), ...$$ Then you can find $$x_1, x_2, ..., x_{1000}, ...$$ since you know $$F(x)=1-\frac{1}{x^2}$$; pick the $$x$$ such that $$x>1$$