Dimensional reduction by Monte Carlo