title: How to generate a set of values that follow certain distribution in c++/java?
body: <p>For example, I have a p.d.f f(x) = 1/25 - x/1250 (from x = 0 to 50);
  My question is that how to generate a set of values that satisfy the given p.d.f.
  Please give an idea about how to implement in c++ or java.
  Thanks so much. </p>