Drawing random values from a distribution

200 Views Asked by At

If I have a set of $n$ elements, and I want to assign to each-one some value $\phi$, drawn at random from a distribution $f(\phi)$ such that $\int_0^1f(\phi)\;d\phi\:=\:1$

Does this mean that the sum of the values of all my elements should be equal to one?
If not, what does it mean?

EDIT As I've learned from the below answers, the sum is not one. The integral is describing the probability density of $f(\phi)$.

Does anyone know how I would go about generating these $n$ values so it was like I picked them randomly from the above distribution?

2

There are 2 best solutions below

5
On BEST ANSWER

No, it does not mean that your n elements must sum to 1. The pdf for $\phi$ is just a way of giving the probabilities for different values of $\phi$.

Although, I have absolutely no idea how to choose n elements randomly from such a distribution. It's equivalent to choosing a real number between 0 and 1 randomly... and I don't think this can be done.

3
On

It means any value drawn from this probability distribution will be between $0$ and $1$ with probability $1$ (usually called "almost surely").

$f$ is the density function, and [0,1] is the support of $f$.

In general the probability that any value is in $[0,x]$ is $F(x) = \int_0^x f(\phi) \textrm{d}\phi$. $F$ is the repartition function.

Let me know if something is still unclear.