I need a function $f(x)$ such that given a set of values $X=\{x1, x2, ...\}$ and a function $rand()$ that returns a value between 0 and 1,  $P[f(a) \ge f(b)] = \frac{a}{b} \forall\ a,b\ \epsilon \ X$