Suppose \(f:[0,\infty )\to \mathbb {R}\) is bounded and measurable, and \(f(x)=0\) for all \(x\geq 2\).
(a) Prove that if \(X_1,X_2,\ldots \) are independent, all distributed uniformly in the interval \((0,1)\), then \[ \frac {1}{n}\sum _{j=0}^{n} f\left (\frac {j+X_j}{n}\right ) \xrightarrow {\mathbb {P}} \int _0^{\infty } f(x)\,dx \qquad \text {as } n\to \infty . \]
(b) (Extra credit) Deduce from this the following version of Riemann sums for Lebesgue integrals [Chaterjee’s theorem]: There exists a sequence \(\{\delta _{j,n};\ 0\leq j\leq n,\ n\geq 1\}\) of real numbers in \((0,1)\) such that \[ \lim _{n\to \infty }\frac {1}{n}\sum _{j=0}^{n} f\left (\frac {j+\delta _{j,n}}{n}\right ) = \int _0^{\infty } f(x)\,dx. \]