  We study a Monte Carlo algorithm that is based on a specific (randomly
shifted and dilated) lattice point set. The main result of this paper is that
the mean squared error for a given compactly supported, square-integrable
function is bounded by $n^{-1/2}$ times the $L_2$-norm of the Fourier transform
outside a region around the origin, where $n$ is the expected number of
function evaluations. As corollaries we obtain the optimal order of convergence
for functions from the Sobolev spaces $H^s_p$ with isotropic, anisotropic, or
mixed smoothness with given compact support for all values of the parameters.
If the region of integration is the unit cube, we obtain the same optimal
orders for functions without boundary conditions. This proves, in particular,
that the optimal order of convergence in the latter case is $n^{-s-1/2}$ for
$p\ge2$, which is, in contrast to the case of deterministic algorithms,
independent of the dimension. This shows that Monte Carlo algorithms can
improve the order by more than $n^{-1/2}$ for a whole class of natural function
spaces.
