0
$\begingroup$

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?

  • 0
    It sounds to me that you need to see [Devroye's book](http://cg.scs.carleton.ca/~luc/rnbookindex.html). There, he gives a lot of suggestions for generating non-uniform pseudorandom numbers...2011-08-07

2 Answers 2

0

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.

  • 0
    Thank you for your answer. I'll accept since you answered my question. I should have put an extension to my question asking how to do it. @Michael could you possibly write an answer detailing your method some more, please?2011-08-05
0

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.

  • 0
    As André Nicolas says above, there are a lot of different answers for a specific $f$. Section 3.4 of Knuth's The Art of Computer programming - Seminumerical algorithms is dedicated to that question.2011-08-06