We consider an insurer who has a fixed amount of funds allocated as the initial surplus for a risk portfolio, so that the probability of ultimate ruin for this portfolio is at a known level. We consider the question of whether the insurer can reduce this ultimate ruin probability by allocating part of the initial funds to the purchase of a reinsurance contract. This reinsurance contract would restore the insurer's surplus to a positive level k every time the surplus fell between 0 and k. The insurer's objective is to choose the level k that minimizes the ultimate ruin probability. Using different examples of reinsurance premium calculation and claim size distribution we show that this objective can be achieved, often with a substantial reduction in the ultimate ruin probability from the situation when there is no reinsurance. We also show that by purchasing reinsurance the insurer can release funds for other purposes without altering its ultimate ruin probability.