A zero-variance solution exists for any linear Monte Carlo problem, and this solution can be obtained by sampling the random numbers proportional to the expected score subsequently produced by using these random numbers in the random walk.