PDF/CDF and expected value of a function How can I compute the PDF/CDF and expected value of the following function:
$$
\frac{\alpha}{r^2}
$$
where $r$ is generated as follows:


*

*draw $x$ and $y$ from a uniform distribution in the range $[-r_\max,+r_\max]$.

*if $r_\min \le \sqrt{x^2+y^2} \le r_\max$ then $r=\sqrt{x^2+y^2}$ else repeat step (1)


$r_\min$, $r_\max$, and $\alpha$ are given constants.

This is really the same as drawing the pair $(x,y)$ uniformly from inside the annulus bounded by concentric circles of radii $r_\min$ and $r_\max$.  If $s$ is between $r_\min$ and $r_\max$ then the probability that $r\le s$ is the area between the circle of radius $s$ and the circle of radius $r_\min$ divided by the whole area of the annulus.  I.e.
$$
\Pr(r \le s) = \frac{\text{area of annulus between radii }r_\min\text{ and }s}{\text{area of annulus between radii }r_\min\text{ and }r_\max}  = \frac{\pi s^2 - \pi r_\min^2}{\pi r_\max^2 - \pi r_\min^2} = \frac{s^2-r_\min^2}{r_\max^2-r_\min^2}.
$$
So that's the CDF as a function of $s$.  Differentiate it to get the PDF, and the numerator becomes $2s$ while the denominator stays as it was.  Call the CDF (capital) $F$ and density (lower-case) $f$, and then the expected value is
$$
\alpha\int_{r_\min}^{r_\max} \frac{1}{s^2} f(s)\;ds.
$$
